Run installed windows within linux
I dual-boot Windows 10 and OpenSUSE Tumbleweed, but I do most of what I do on linux. My question is, is there a way to run the windows installed on my computer within linux, like a guest in a virtual machine ? The difference here is that the windows I’ll run would not be a freshly-installed virtual system, but a limited version (so as to not conflict with the hosting system) of the real installed system with all its configurations as a guest. A simple use case for that would be to run a windows executable smoothly without needing a risky, unwarranted solution like wine because why would I need wine when I have a legitimate copy of windows. So, can that be done ? This is only a convenience thing, to avoid rebooting multiple times to have a simple task done.
Sorry, no. A kernel needs dedicated hardware access unless there is a virtualization layer emulating it, and the kernel has drivers targeting that virtualization layer. Standard PC hardware cannot run two OSs at once, so there is no way for two kernels to access the same hardware at the same time. One of them must become subservient to the other.
@FrankThomas Yes, I know that. What I’m looking for is a way to configure a virtual machine to run an existing, installed, real system.
Well even if you tried to map the raw physical hard disk to a virtual one, once you do that you won’t be able to boot the OS on hardware again, due to drivers. Just something to consider.
While it’s possible to run an OS both on hardware and in a virtual machine, Windows isn’t suited for this. It doesn’t cope well with “switch the disk to a different PC”.
How to run Windows software in Linux: Everything you need to know
Linux is more capable than ever. With over 1,000 Linux games available on Steam and a general shift towards more web-based desktop software, there’s less need for Windows than ever. After all, you can now watch Netflix on Linux without any hacks, and you can even use Microsoft Office on Linux—a web-based version of it, at least.
But, as most dedicated Linux desktop users will eventually discover, there comes a time when you just need to run a particular piece of Windows software on your Linux PC. There are quite a few ways to do so. Here’s what you need to know.
Wine
Wine is a way to run Windows software on Linux, but with no Windows required.
Wine is an open-source “Windows compatibility layer” that can run Windows programs directly on your Linux desktop. Essentially, this open-source project is attempting to re-implement enough of Windows from scratch that it can run all those Windows applications without actually needing Windows.
This is the only method here that won’t actually require a copy of Windows, but the downside is that it won’t run every application properly. You may encounter bugs or performance issues, especially if you’re using Wine to play video games. But if you’re running a popular game released a few years ago, you may find that it performs very well. Many people use Wine to play World of Warcraft on Linux, for example. You can get an idea of how an application will run and any tweaks it might require by visiting the Wine Application Database website and searching for that application.
First, download Wine from your Linux distribution’s software repositories. Once it’s installed, you can then download .exe files for Windows applications and double-click them to run them with Wine. You can also try PlayOnLinux, a fancy interface over Wine that will help you install popular Windows programs and games.
Codeweavers also offers a commercial version of Wine, known as CrossOver Linux. You have to pay to use it, but Codeweavers tries to go out of their way to officially support popular applications (like Microsoft Office, Adobe Photoshop, and some big PC games) and ensure they work properly. Codeweavers also contributes its changes back to the main Wine project.
Virtual machines
Virtual machines are a very convenient way to run Windows software on your Linux PC. As PCs have gotten faster, virtual machines have become comparatively more lightweight.
This process involves installing a copy of Windows in a “virtual machine” program like VirtualBox, VMware, or Linux’s built-in KVM (Kernel-based Virtual Machine) solution. That copy of Windows thinks it’s running on real hardware, but it’s really running in window on your desktop. Modern virtual-machine solutions can even break Windows programs running in the virtual machine out of that window, allowing them to act like normal windows on your Linux desktop.
This solution is more foolproof than Wine. As you’re running those Windows applications on an actual copy of Windows, you won’t encounter bugs.
Using a virtual machine does require a full copy of Windows, however, and there is more hardware overhead because that copy of Windows has to be running alongside your primary operating system. In particular, demanding PC games that need access to your computer’s graphics card won’t perform well at all—you’re better off with Wine for those. But for productivity applications like Microsoft Office or Adobe Photoshop, this is an excellent solution.
Dual-booting
Dual-booting isn’t technically a way to run Windows software on Linux itself, but it is how many Linux users run Windows software. Rather than using it directly under Linux, you just reboot your computer, choose Windows, and boot into Microsoft’s operating system. The Windows software can then run in its native environment. Thanks to modern solid-state drives, that reboot process should be faster than ever.
This is particularly ideal if you’re a PC gamer who just can’t give Windows up yet. Rather than forgoing all those Windows games, you can just reboot your computer when you want to play Windows-only games. As you’re using plain-old Windows running directly on the hardware, you won’t have to deal with any compatibility or performance headaches.
The best way to set up a dual-boot system is to install Windows first—if your computer came with Windows installed, that’s good enough. Next, install the Linux distribution of your choice and tell it to install alongside Windows. You’ll then be able to choose your preferred operating system each time you boot your computer. This Ubuntu guide to installing Linux beside Windows can help walk you through the process.
Want to stay up to date on Linux, BSD, Chrome OS, and the rest of the World Beyond Windows? Bookmark the World Beyond Windows column page or follow our RSS feed.
The best option really depends on what you’re trying to do. If you need to run a single application or game that works well in Wine, Wine may be ideal. If you need to run a variety of desktop applications—like the most modern versions of Office and Photoshop, which Wine might struggle with—a virtual machine will be best. If you’re a PC gamer who still wants to play the latest Windows games, dual-booting will give you the performance you want without the headaches of Wine.
Run existing windows in linux
I saw a post this morning showing you can run Windows applications from a virtual Windows install on your Linux Desktop. Although this may seem like it’s not that big of a deal, anyone who virtualizes another OS such as Windows from within VMware knows it can sometimes be a hassle to switch between your Linux desktop and the Windows one since you only have access to application windows within each OS and your Guest OS is limited to running within the VMware window. The advantage of integrating the guest OS into your existing desktop allows you to easily switch between different applications and use applications side by side regardless of what OS they are on. As you can see in the pic above (click to enlarge), this method gives you access to the StartMenu from your Linux desktop as well as placing guest OS applications in the Gnome panel. The original website provided a method that needed some modification to work for me. Additionally, the following guide will show you how to safely set this up on an existing Windows partition.
- If you already have a dual boot machine with an existing install of Windows XP, follow the guide here on how to run it in VMware.
- Once you have VMware setup properly, boot into Windows from VMware and go in and create a new user for Windows in Control Panel>>Users. I assigned the username “Linux” for this user. Make sure you also assign a password for security purposes. The reason you should create a new user is that you will be disabling the desktop for this user rather than the user that you normally log into Windows with.
- Now go to Start>>Control Panel>>System>>Remote Tab and enable “Allow users to connect remotely to this computer”.
- Now go to Start>>Run and type”regedit” to bring up the registry editor. Navigate to HKEY_CURRENT_USER/Software/Microsoft/Windows/Current Version/Policies/Explorer and right click to create a new DWORD value. Name the DWORD value NoDesktop and give it a value of 1.
- Download SeamlessRDP and extract it to C:\seamlessrdp.
- Go to Start>>Run and type in in “cmd”. In the command prompt, type ipconfig and note the first IP it reports, this is the IP of your virtual machine.
- Now you can log out of Windows.
- Whenever you want to run the virtual machine and enable Windows applications on your desktop, you will need to type the following command in the terminal:
rdesktop -A -s «c:\seamlessrdp\seamlessrdpshell.exe c:\windows\explorer.exe» IPAddress -u username -p password
Remember to replace IPAddress with the virtual machine’s IP and the username and password with the username and password of the new Windows user you just created. Note that VMware must be running and the virtual machine needs to be booted and at the Windows login screen when you run this command.
That’s all you need to get it working. You will see the start menu at the bottom of the screen. Right click and deselect “Lock the Taskbar” and move it somewhere else (i.e. left of screen).
To make the process easier, you can create the following script and place an icon in the gnome panel or your desktop instead of typing out the command each time:
- Paste the following code in a text editor (change IPAddress & username but not password, for obvious security reasons) and save it as rdesktop.sh:
#!/bin/bash
read -s -p «Enter Password: » mypassword
rdesktop -A -s «c:\seamlessrdp\seamlessrdpshell.exe c:\windows\explorer.exe» IPAddress -u username -p $mypassword
- Run VMware and boot Windows. Once you are at the login screen, run this script and you will be prompted for the password. You should now see the Windows start menu.