It's too easy to get Windows 11 VM on Linux
Yesterday, I mentioned that I will probably set up a Windows virtual machine on my Thelio, My Linux Pop OS desktop. Later, I decided to play around with it, and I was surprised to find out how easy it was to get Windows 11 up and running. I’m surprised. Here are my notes:
Checking requirements
Before we start, we need to make sure our Host—the Linux computer we’re going to install the Windows environment on—has a CPU that supports virtualization. Most modern computers today probably do, but in case you have Linux running on an aging computer, you want to make sure.
To do that, run the command lscpu
in the terminal and look under virtualization. It should say VT-X. If it is, you’re ready to go.
Of course, you will also need to get the Windows operating system. Download it from Microsoft and use their official Windows ISO (for this, I used the Windows11 ISO)
Install needed libraries and software
We’re going to install several components needed for virtualization. queue-kvm, the hardware component and the kernel level environment; virt-manager, which is the software and GUI we will be interacting with for configurations; and bridge-utils and libvirt-daemon, which are several components that allow the host to run virtualization as a service and connect your host to your guest virtual machine. We can install them all in one go:
sudo apt install qemu-kvm libvirt-daemon bridge-utils virt-manager
Restart the machine (the host) before continuing, or it will tell you the libvirt service is not available in the next steps.
After restart, verify the service is running with sudo systemctl status libvirtd
. It should show as active in green. If not, enable it with sudo systemctl enable libvirtd
and start it with sudo systemctl start libvirtd
. Then check again.
Next, we also need to add our user to the appropriate groups for access. This is useful:
sudo usermod -aG libvirt $(whoami)
and then: sudo usermod -aG kvm $(whoami)
.
Inside virt-manager
- Launch virt-manager from the terminal or find it in your apps.
- Select Local install media (ISO image or CDROM) and then Forward.
- From the Choose ISO or CDROM install media select Browse and navigate to your downloaded Windows11. Notice that if the ISO is not in the libvirt library (the default location), virt-manager will prompt you for permission to access the location.
- To install Windows 11, I used 8 GB of RAM, 8 CPU Cores, and 50 GB of storage (the minimum is 64GB, I’m not sure how I passed this, but you’d probably want more than that anyway). Finish and launch the virtual machine.
- When launched, the virt-manager boot will prompt to “press any key to boot from CD-ROM,” so don’t forget to press something before looking into why it doesn’t work like I did…
- The Windows 11 installer will locate the disk. Go ahead and install there, it’s the only virtual location you have if you followed the above example. Then it will ask you the usual nonsense (agree to terms, Language, keyboard layout,etc). Note: I always choose Windows 11 Pro, because home version doesn’t come with needed utilities.
Sharing common clipboard
Next, we want to install Spice-VDA, which enables us to copy-paste from the Guest to the Host and vice versa.
- Install what’s needed on your Host with
sudo apt install spice-vdagent
. - On your Guest (in Windows), go to https://spice-space.org/download.html to get the Windows guest tools binary
- We also need to install the Windows VirtIO Drivers ISO from https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers ISO on the Host. Download the latest release from under Installtion and then “download the latest stable” link.
- On your host, switch to the virtual machine’s configuration (choose the little “i” from the top bar) and select your VM’s CDROM configuration. Browse to the ISO you downloaded above to mount it.
- Switch back to your Guest (select the display icon to the right of the “i”). Windows will detect the CD and ask you what to do. Select to browse the files, locate the 64-bit installer, and install.
- Leave all options as is.
- Restart the guest, and you’re done. Copy-paste should now work
Next, I want to set up a share between the Guest and the Host, but this is not urgent. It seems the easiest way to do it is to create a shared SMB folder from the Guest.
I know that in the past, I had to work harder to get Windows to work, and I still ran into some issues. The setup here took me maybe one hour and no more than two head scratches. It was easy, too easy, and I’m not sure how much of it was because of my hardware and how much because of what’s now included in the virtualization libraries… but it works. I already installed Photoshop, and it works perfectly in Linux, just as it should.