About Windows 10 KVM guest installation

After so long I think I finally managed to install a Windows 10 KVM guest on Leap 42.3 using virt-manager (libvirt), and would like to share some steps in case it could serve as sort of a “guide” for anyone else that may want to try as well.

First, Windows guest seems to really work better with virtio drivers and SPICE installed, I’m starting to compare the later one well with VirtualBox’s guest additions in fact.
So one first needs to download Windows virtio drivers ISO from here.
SPICE is installed in the Windows guest and seemingly the most recommended way (the easy way) is using the spice-guest-tools installer from their website. However it turns that this installer ships the virtio drivers as well, and at the same time ISO has QXL drivers. So I was in doubt and I managed to contact at least once the maintainer of the virtio drivers ISO. Summarizing, he said SPICE guys rarely update the installer and ISO has more up to date versions. He also commented he would certainly like and has been looking for more fedoraproject-SPICE coordination, but…
So I guess there are 2 ways to go, which I’ll call the “easy” and “manual” ways. I myself choose manual one which consists in using all ISO’s drivers.

Unless willing to set up a server in the guest or some other more “advanced” stuff, when installing KVM server through Yast it’s better to reject the offer to install bridging device. The only network service able to use it would be Wicked anyway; Network Manager is not able to.

Once one has KVM server and stuff installed, package spice-gtk will be also needed, so one needs to verify if it’s installed, and install it if it’s not.

For guest network the most direct option is using a virtual network device, which according to libvirt documents it should be automatically created when installing libvirt stuff but for some unknown freaking reason this never happens on Leap. So one must manually create it:
open Virtual machine manager, Edit > Connection details > Virtual networks. Check suggested network segment is not the same as physical LAN’s, and just set physical network passthrough in NAT mode to any device.
This setting will allow host <-> guest(s) communication, guest -> physical LAN PCs communication, and internet access from guest. Also guest <-> guest communication in case there are more guests. However not physical LAN PCs -> guest communication by default due to firewall rules in the NAT. The bridging device case above mentioned would allow it by default though.

For guest’s desktop auto-resizing, open Virtual machine manager, Edit -> Preferences -> Console. Check “Resize guest with window” option (it’s not checked by default).

For USB redirection to guest (through SPICE) running this -as root- will also be necessary (taken from this thread):

chmod u+s /usr/bin/spice-client-glib-usb-acl-helper

Now to proceed creating virtual machine, either from Virtual machine manager or directly from Create virtual machine launcher (better to insert Windows DVD beforehand so it can autodetect OS).
In step 5 check “Customize settings before installation”. In network, device should be already autodetected if virtual device created above is running.
Proceed to configure virtual machine’s options.
In Memory set minimum (assigned) and a maximum values for RAM ballooning.
In IDE Disk 1 go to advanced options and select VirtIO as bus.
In NIC select virtio as device model.
For virtio drivers (and SPICE as well) one must add the ISO. This will add the ISO to virt-manager’s pool storage, changing its ownership and permissions, so better to choose a safe directory where to put ISO before.
Click Add hardware > Storage > select device type CDROM and bus type IDE; click Manage > Explore locally > search for ISO.
Virt-manager seems to ship SPICE ready since it comes with the needed settings for it by default. But verifying just in case:
Spice Display: type Spice server
Spice channel: device type spicevmc
QXL video: model QXL
Now proceed to start installation.

During Windows installation, in disk selection, there will be no disks detected, which is expected. This is the time to load all needed drivers from the already mounted Windows virtio drivers ISO. Just click “Load driver” by bottom left corner and browse ISO:
Hard disk: viostor\w10\amd64
Network: NetKVM\w10\amd64
If preferring the “manual” way rather than “easy” one, following ones are also needed, otherwise skip them:
RAM balloon: Balloon\w10\amd64
Serial (Spice): vioserial\w10\amd64
QXL (Spice): qxldod\w10\amd64
Now continue with Windows installation.

Once Windows guest has finished installing and logged in for first time, finish guest configuration from within it.
If preferring the “manual” way rather than “easy” one, following step is needed, otherwise skip it:
from Windows virtio drivers ISO, which should still be mounted inside guest, copy directory Balloon\w10\amd64 and paste it in Program files renaming it as C: \Program files\Balloon. Then install the service by running cmd as administrator, brose to C: \Program files\Balloon and run command “BLNSVR.exe -i”.
Now to download SPICE from its website mentioned near beginning of post, and install it in Windows guest.
Manual way (taken from SPICE documentation):
download Windows SPICE agent (the zip file). Uncompress folder somewhere, run cmd as administrator, browse to newly uncompressed folder and install with commands “vdservice install” and “net start vdservice”.
Easy way:
just download spice-guest-tools file and install it. Should also install the balloon service. Check in Windows services.

This is more of virt-manager stuff, but it can be useful to post it as quick reference.
For ejecting and changing CD/DVD from guest, in virt-viewer itself click “Details” icon, select desired CDROM device and click “Disconnect”.
This is enough for mounted ISOs, but for physical CD/DVDs in physical DVD drive one must unmount it from host as well before changing disks.
To mount new CD/DVD in guest follow similar process, just click “Connect”.

Very nice.

If you’d like to create a Wiki page (or an SDB page) I’d like to link to it as a reference from my own Wiki.

Some recommendations if you’d be willing to create a Wiki or SDB (see instructions in my signature if you haven’t done this before)

  • Perhaps make it a multi-page to separate different sub-topics. You’ve covered a lot of ground with a number of procedures and methods that could stand on their own.
  • Provide a specific command when possible instead of a general description or using a graphical tool. Example might be to provide a zypper command to install something instead of using the YaST Software Manager.
  • When displaying a graphical tool, a screenshot is nice. If you have problems figuring out how to upload and link images, message me (or post in the Forums Feedback forum. The procedure is the same).
  • When you write documentation, there are generally 2 audiences you have to appeal to… Those who aren’t interested in details and only want the commands, and those who might want to understand each step. Try to organize your content to benefit both.
  • There should be a summary of steps, something that a Viewer can see at a glance the overall steps and order. When you format different level Headings, a TOC will be created automatically that might provide the “30,000 foot view.”

If you want,
browse through the Wiki articles I’ve written. They’re not always written in the same layout so there are many ideas which can be borrowed and I wouldn’t say that what I’ve done can’t be improved greatly.

https://en.opensuse.org/User:Tsu2

If you decide to do this, am looking forward to your creation.
Although I’m sure it would take a very long time to create fully, written well you may create something that could stand the test of time(many, many years) and be a benefit to hundreds/thousands of future openSUSE Users.

TSU

Thanks tsu2.

Would be a good idea, but ATM I’m not very sure, still many things in my head right now…
Wouldn’t you yourself give it a try by any chance?

By the way, I missed an important detail in the post. I said the created virtual network device allows host <-> guest(s) bidirectional communication, but Windows’s firewall service blocks connections from the host (cannot ping). Had to disable it and reboot guest to make it work. I think it’s possible to add rules/exceptions to firewall on Windows 10, though after a quick search it seems a not so intuitive process…

I’d encourage you to give it a go, when a person has the personal initiative and drive to do something that might be significant, IMO that person is best positioned to create the documentation because he experiences “The Process of Discovery.”

Major recommendation though is to break what you described into smaller pieces that each can each stand on its own, the entirety of what you’re covering is probably too intimidating to expect to be done as one big, project. And, don’t expect to do the whole thing in a day or two, it might take a month doing a little bit at a time. Just plan and do a little bit at a time, and don’t expect to create a finished document with your first posted drafts, particularly for the first pieces you create.

And, don’t worry about anything that you might not know how to do.
If it’s significant, <someone> reading your doc will know how to do it and could submit a change or addition.

TSU