10 Easy Steps To Install Windows 10 on Linux KVM

Saifudheen SidheeqKVM, Linux, Virtualization7 Comments

I usually use the windows vm machine as a jump server inside my labs, that way I can move around the files and stuff quickly, sometimes I install the windows machine on the ESXi host else I would install it on the KVM. 

For some, they wanted to use windows machines on their Linux box. They can either install Vmware workstation and install windows in it or use a native Linux virtualization platform known as KVM and install Windows 10 in it.

KVM is great if you wanted to run VM’s in Linux environments, You can install multiple VM’s and switch between them and moreover it’s opensource and free.

One of the use cases being I uses my KVM windows box to always connect to VPN.

I have covered the installation of Centos in KVM, and in-depth SD-WAN lab in KVM in my previous blogs, you may check them out if you are interested.

In this lab, we are going to install windows 10 on the Linux KVM espesially on a Centos/Redhat/Fedora version.
If you are using Ubuntu KVM then you may read this blog.

Note: The steps mentioned here can be followed for Windows client VM such as windows 10 and windows 7.
If you are going to install the Windows server then you can follow the guide here.

So let’s see how we can install windows VM on Linux.

Requirements for windows 10 deployment on KVM

  • Linux machine with virtualization enabled, I am using Redhat machine for this example and steps that I am following here is pretty much the same for all the flavors such as CentOS, Fedora, etc.

Ubuntu

If you are using Ubuntu follow the guide here.

Centos/RedHat

yum install qemu-kvm libvirt virt-install virt-manager virt-install -y
  • Windows 10 ISO image for the installation, you can follow the guide here to get the ISO image.
  • Windows virtio drivers to communicate with the KVM, you can download them here.

Steps to install windows on Redhat/Centos KVM.

Once you have the prerequisite ready, you can follow the below steps to start the installation of windows 10 in KVM.

  1. Creation of Windows 10 KVM VM
  2. Customizing the Hardware for Windows 10
  3. Adding the Graphics Hardware.
  4. Update the Virtual Network Interface
  5. Adding Windows 10 storage and hardware drivers for KVM
  6. Configure Boot device order for windows 10
  7. Begin Windows 10 installation on KVM.
  8. Install Windows virtio drivers.
  9. Installation of KVM QXL display drivers for windows 10
  10. Remove the VNC and Cirrus display adapter

1. Creation of Windows 10 KVM VM

In this step, we would create the windows 10 VM in KVM virtualization environment step by step. This include the windows VM CPU, Memory storage and the network interface.

Step 1. Open terminal and type virt-manager, this would open up Linux Virtual machine manager. Click on Create a New virtual machine button.

install operating system with kvm windows

Step 2. Select local install media and click forward.

qemu manager browse for windows 10 image

Step 3. You need to point the windows 10 ISO image to the Virtualisation manager, click on Browse.

qemu manager browse for windows 10 iso image
  • Select Windows 10 iso image and click on open.
install operating system with kvm windows vm
  • Uncheck the option Automatically detect operating system based on install media, and select the OS type as Windows and Microsoft Windows 10 and click Forward.
define the operating system as windows and version microsoft windows 10

Step4. You have to define the memory and CPU here, I am assigning 8192 MB as the memory and 4 CPUs and click Forward.

kvm windows

Step5. For the storage, you may leave it as default 40 GB and click forward.
You can change the storage size following this guide if you are planning to extend the storage later.

define the windows 10 qemu storage and cpu

Step6. Name your VM, and check the option which says Customize configuration before install, also select the network interface which you would like to use for your guest VM.

windows vm network configuration in KVM manager

Note: If this Windows 10 VM wanted to access the host machine internet, then you would have to select ‘Virtual network ‘default’ : NAT’. This means none of the other machine on your network can see this machine.
If you wanted to bring this machine to your network and talk to other machine or network then you would have to use bridge interfaces or macvtap.

2. Customizing the Hardware for Windows 10

Step1. Since we clicked on Customize hardware before install, the KVM installation wizard would now open, you need to change the disk storage type to VirtIO here.

  • Select IDE Disk 1, Click on expand Advanced options and select VirtIO from the Disk bus drop-down list and click Apply.
kvm windows

Step2. Click on CPU, expand Topology and check the option Manually set CPU topology.

By default the socket is picked up as 4, let’s change that to 1 and 2 core and 2 Threads

Note : You may type the command virsh nodeinfo in the terminal to see your CPU and it’s socket information.

fixing windows kvm cpu issue

Windows Machine KVM Common CPU issue.

How come my windows machine not detecting more than one CPU, even though I had given 4 CPU’s during the installation?
This is the common issue that we see after the installation, so please make sure that you don’t skip the steps above to not to face such CPU issues for windows VM in KVM.

3. Adding the Graphics Hardware.

For the Windows 10 graphics card to work post-install, you would need to use QXL driver in it. However, during the installation of Windows 10, it uses the Cirrus adapter to display the output. Let’s add that.

Step1. Click Display Spice and select the type VNC Server and click Apply.

spice guest tools windows 10

Step2. Click Video QXL, Change the Model to Cirrus and click Apply.

windows kvm Video qxl to cirrus

Once you complete the Windows 10 installation you can install the QXL driver in windows under Device manager. Therefore, we are adding QXL hardware along with Cirrus, and then you can shut down the VM and remove the Cirrus display drivers from the virtualization manager later.

Note: If you use Cirrus as the display adapter then after you reboot you would not be able to see the display output, as it would be just black.

Step 3. Add QXL driver via spice server.

  • Click on Add hardware and click on Graphics and add graphics type as Spice server and click Finish.
windows qemu gui
  • Go back to Add hardware again and click on Video and select the model QXL and click Finish.
qemu gui windows

Your display virtual hardware details would look like below.

qemu KVM graphics driver windows 10

4. Update the Virtual Network Interface.

Step1. Click on the NIC, change the device model from Hypervisor default to virtio, and click Apply.

change the windows vm network to virtio

5. Adding Windows 10 storage and hardware drivers for KVM.

We now need to attach the windows 10 iso image and virtio driver image that you had downloaded earlier in this lab. If you have not downloaded the windows virtio driver yet, please go ahead and download from here.

Step 1. To add windows 10 ISO image as CDROM. Click on Add hardware.

virt manager windows

Step2. Click on Storage, Select Device type as CDROM device, and click Finish.

qemu windows 10

Step3. Click on IDE CDROM1 that we just added and check the box Sharable and click on Connect.

connect IDE cdrom1
  • On the prompt, you need to select the Windows 10 ISO image.
attach the windows 10 vm to the KVM
  • Click OK then Apply.
windows 10 iso  attached

Step 5. Attach the windows virtio drivers

We have to attach the windows virtio driver (This has all the KVM required drivers for windows machines) that you have downloaded earlier. Click on IDE CDROM 2, Check the option sharable. And click on Connect.

 Attach the windows virtio drivers
  • Here you need to attach the virtio-win-0.1.118.iso, select that and Click choose volume. And Ok and Apply.
 Attach the windows virtio drivers

6. Configure Boot device order for windows 10.

Step 1. You need to define the Boot device order for windows 10 to boot up, just like how you would do it on bios of a normal PC.

  • Check the option Enable boot menu under customise hardware window, and select the device you would like to reorder and use the arrow to reorder them.

First, it should be IDE CDROM1, VirtIO Disk1 then IDE CDROM2, once you rearranged click on Apply.

kvm boot order for windows 10 vm

You just completed defining the hardware for windows 10, you can now click on Begin the installation, and start the installation.

7. Begin Windows 10 installation on KVM.

We have successfully created the VM in KVM machine. It is time for us to start the windows 10 installation just like you would do on any other computer.

Step1. On the windows installation screen set the preference according to your requirement. Click next.

kvm windows 10 installation screen
  • Click on Install Now.
install windows 10

Step 2. You will be presented with Activate windows screen, I am not going to activate windows now, which I can do it later. Click on I don’t have a product key.

skip the product key

Step 3. Select the version of Windows you would like to install and click on Next.

select the windows version
  • Accept the license and click Next.
accept the license agreement for windows
  • Click on Custom: Install Windows only (Advanced)
select custom installation for windwos 10

Step4. You will be presented with the screen with an error message that says We couldn’t find any drives, To get a storage driver Click load driver. 

windows 10 installation load driver
  • When you get the below message, click on Ok
load driver error on windows 10
  • You may get below error message, click OK on it.
load driver error on windows 10
  • Click on Browse.
browse for the virtio driver
  • Remember we had attached virtio driver as CDROM 2 during the VM setup, In the CD Drive (E:) virtio-win-0.1.1
click on the virtio cd drive
  • Goto the location -> viostor/w10/amd64 click on Ok.
select the folder amd64 under w10
  • You can see the drive listed here now as Red Hat VirtIO SCSI controller select that and click on next. 
install the Redhat virtio scsi controller
  • This may take few seconds and you would be able to see the storage that you added earlier as 40 GB, click Next.
select the driver to install windows 10 in kvm
  • The windows installation will start now. This will take some time now.
windows 10 installation is in progress

Step5. After couple of reboots, you will get a screen with windows 10 initial setup wizard. Finish the initial setup wizard and after a couple of minutes, you will be presented with the Windows Desktop.

windows 10 vm kvm desktop

8. Install Windows virtio drivers.

Did you notice the network card is showing error on the icon down right corner?
That means there is some issue with driver. Don’t worry we are going to fix that now by installing virtio drivers on windows.

Step1. In the start menu, type This PC and when you get the This PC icon, right-click on it and click on Manage. This would open up the device manager.

install virtio drivers windows
  • Select Device Manager and you can see there are some hardware needs to fixed.
device manager in windows 10

Step 2. Click on Ethernet Controller, right-click on it and click on Update driver.

udpate windows 10 ethernet driver in kvm
  • Click on Browse my computer for driver software.
browse for the driver
  • Click on Browse and select the CD Drive (E) and click on OK
select the virtio drive
  • Check the option Include Subfolders and Click on Next.
select virtio drive to install the hardware drives
  • You will be prompted with security Warning click on install.
hardware installation prompt
  • Once installed you will get a successful message.
Red Hat VirtIO ethernet adapter installed successfully

Step3. Next right click on the PCI Device and click Update driver.

update driver PCI device
  • Click on Browse my computer for driver software, since we had selected the CD Drive, it is available by default option click next.
browse for windows 10 PCI device in kvm
  • You will get a successful message for the same.
Red Hat VirtIO Balloon driver installed successfully

Step4. Do the same steps for PCI Simple Communications Controllers as well.

Red Hat VirtIO Serial driver installed successfully

9. Installation of KVM QXL display drivers for windows 10.

Step 1. In windows open the virtio CD drive and go to the path \guest-agent\qemu-ga.msi run the qemu-ga-x64. Once the installation is complete goto to the device manager again.

  • And click on Display adapters, you can see its shows Microsoft Basic Display adapter, right-click on it and update hardware. And Just like how you updated the hardware for other devices, install the display adapter from Redhat
Redhat display adapter for windows 10
  • You will get the successful message that the Red Hat QXL controller has been installed.
Red Hat QXL controller installed successfully on windows 10
  • Display adapter has now been updated to the Red Hat QXL controller.
Redhat QXL driver under windows 10

10. Remove the VNC and Cirrus display adapter

Close the device manager window and shut down the windows 10 guest VM.

  • Step 1. We need to remove some software that we had added earlier during the installation, goto windows10 VM in virtualization manager right click and click on Open.
open windows 10 vm in virtual machine manager
  • Click on the bulb icon to Show hardware details.
click on the bulb
  • You need to remove both Display VNC and Video Cirrus from the list of hardware. 
windows 10 display drivers during installation

We have installed Redhat QXL display driver on the windows10 guest in step 9 and that match with the hardware Video QXL in the hypervisor and it should start working fine, that’s it, now you have successfully installed windows 10 VM on your Linux machine KVM and you should be good to go.

  • Also, disconnect the windows and VirtIO ISO from the CDROM1 and 2, that you had attached earlier.
removing windows 10 iso cdrom
removing windows 10 iso cdrom
  • And start your windows 10 machine and it is ready to use.

Congrats! and your windows 10 KVM guest is ready to use. Now how do you manage this VM and access it whenever you want, here I have covered the same.


Learn About This Author

Saifudheen Sidheeq

Saifudheen is in the Computer networking and technology field for about a decade now. He loves technology and new ideas, and in his spare time, he loves to write about them.