Jump to content

Windows 11 in Virt-Manager

Hey, I don't usually write guides, but I couldn't find one to follow for setting up Windows 11 in QEMU, so I figured I'll write what I found myself. I did this on Manjaro, but you should be able to do it from any distro. Since I just wrote the steps I got to get it to let me install, I can't promise it'll work flawlessly. If there's any later-on issues, just let me know.

 

Prerequisites:

Before starting, you need the following:

  • Windows 11 .iso from Microsoft [link]
  • OVMF - you need this for UEFI/secureboot. I used edk2-ovmf from the arch official repos.
  • SWTPM - you need this for TPM emulation. Again, i used swtpm from the arch repos.
  • qemu & virt-manager - if you don't already have these installed, they'll be in your distro's repo, more than likely.
  • virtio - once you have your VM set up, mount the latest image from here to install virtio drivers for things like networking [link]

Getting started:

In Virtual Machine Manager, create a new VM from the top-left corner.

For step 1, choose local install media.

For step 2, pick your Windows 11 iso. if it's not in the drop-down, choose it by clicking "Browse... > Browse local". It'll auto-detect the OS as Windows 10, this is fine.

For step 3, set your memory and CPU cores. the default (4gb & 2 cores) are the minimum for W11, so I set my RAM to 8gb, but you can always change these values later.

For step 4, make a virtual disk image. The minimum drive size for Windows 11 is 64gb, so it needs to be at least that big.

For step 5, choose your VM name, and then tick off Customize configuration before install.

 

Final setup:

In the overview section, set Firmware to UEFI x86_64: /....../OVMF_CODE.secboot.fd. It has to be secure boot, otherwise Windows 11 won't install. While I was looking into this, I saw some things saying OVMF_CODE.ms.fd instead, if your list has that, that should work as well.

image.png.b7594cea636a33080822ac120445ebfe.png

In boot options, tick off your virtual CD-ROM drive, and then set that as the highest boot priority:

image.png.bffb43d1cbd3d08b155e11186de4fe3d.png -> image.png.b170a4e96c4aba2b62d414defe07627d.png

Finally, add a virtual TPM module. the defaults (CRB, Emulated, 2.0) should be fine.

image.png

 

once you've done that, you should be all set! hit begin installation in the top-left, and you should be able to install Windows 11 without issue.

Post-install:

Once you're in windows, I found that I had to set the DNS manually. Just go to Windows' networking settings and set your preferred DNS server:

image.png.b3b63d6b940b022dda23f4b24f0997e9.png

 

 

Edited by Shawnsg
updated networking info
Link to comment
Share on other sites

Link to post
Share on other sites

I've got a couple of questions:
1) Do spice quest tools work? https://www.spice-space.org/download.html 

(direct download link) https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe
They probably do but since you already have it setup it would be easy for you to check heh.

2) Have you tried running WinApps with Win11 client?

WinApps doesn't support Manjaro and is currently looking for maintainers, but there are forks that have Manjaro support, like this one.

I've got that fork setup on two Manjaro KDE desktops, works well with Windows 10 clients.
Curious if Win11 client would work as well. I mean if VirtIO drivers work, RDP is present and if these registry keys are still in use I think it should.

VGhlIHF1aWV0ZXIgeW91IGJlY29tZSwgdGhlIG1vcmUgeW91IGFyZSBhYmxlIHRvIGhlYXIu

^ not a crypto wallet

Link to comment
Share on other sites

Link to post
Share on other sites

I followed the guide.  I used the virtio-win iso to install the Display Adapter.  The "Red Hat QXL controller" driver is installed but comes up with an "!" that says:

 

Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code 52)

 

That same driver works fine in Windows 10 Pro ... so I'm guess Windows 11 is asking for a signed driver.  The result is not able to resize the screen.  Did you have a work around for this?

 

(Nice guide, by the way!)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 4 weeks later...
On 10/14/2021 at 3:05 AM, Mswal2846 said:

That same driver works fine in Windows 10 Pro ... so I'm guess Windows 11 is asking for a signed driver.  The result is not able to resize the screen.  Did you have a work around for this?

 

 

for me changing resolutions work with this installed in the guest

 

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win-guest-tools.exe

 

Thanks for the guide Shawnsg

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 months later...

Currently using Kubntu 21.10, and I'm stuck:

Unable to complete install: 'internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/Windows-swtpm.log' for details.'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4389, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/Windows-swtpm.log' for details.

 

Here's my XML file:

<domain type="kvm">
  <name>Windows</name>
  <uuid>87bceb63-c012-48c6-b933-077e0cab5b13</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>25165824</memory>
  <currentMemory>25165824</currentMemory>
  <vcpu current="12">12</vcpu>
  <os>
    <type arch="x86_64" machine="q35">hvm</type>
    <loader readonly="yes" type="pflash" secure="yes">/usr/share/OVMF/OVMF_CODE_4M.ms.fd</loader>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
    <smm state="on"/>
  </features>
  <cpu mode="host-model">
    <topology sockets="1" cores="6" threads="2"/>
  </cpu>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/home/DATA/870E2TB/yamiyuki/VMs/Windows.qcow2"/>
      <target dev="sda" bus="sata"/>
      <boot order="2"/>
    </disk>
    <controller type="usb" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:6b:2c:65"/>
      <model type="virtio"/>
    </interface>
    <console type="pty"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
    </channel>
    <input type="tablet" bus="usb"/>
    <tpm model="tpm-tis">
      <backend type="emulator" version="2.0"/>
      <alias name="tpm0"/>
    </tpm>
    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
      <image compression="off"/>
    </graphics>
    <sound model="ich9"/>
    <video>
      <model type="qxl"/>
    </video>
    <redirdev bus="usb" type="spicevmc"/>
    <redirdev bus="usb" type="spicevmc"/>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/home/DATA/SGBC2T/yamiyuki/Downloads/ISOs/Win11_English_x64v1.iso"/>
      <target dev="sdb" bus="usb"/>
      <readonly/>
      <boot order="1"/>
    </disk>
  </devices>
</domain>

I'm not sure what I'm doing wrong.

 

compiling from source fixed it so far.

 

Now, Windows 11 won't start.

Desktop

Y4M1-II: AMD Ryzen 9-5900X | Asrock RX 6900XT Phantom Gaming D | Gigabyte RTX 4060 low profile | 64GB G.Skill Ripjaws V | 2TB Samsung 980 Pro + 4TB 870 EVO + 4TB SanDisk Ultra 3D + 8TB WD Black + 4TB WD Black HDD | Lian Li O11 Dynamic XL-X | Antec ST1000 1000W 80+ Titanium | MSI Optix MAG342CQR | BenQ EW3270U | Kubuntu

-------------------------------

Mobile devices

Kuroneko: Lenovo ThinkPad X1 Yoga 4th (Intel i7-10510U | 16GB RAM | 1TB SSD)

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 weeks later...
On 1/15/2022 at 2:10 PM, YamiYukiSenpai said:

Currently using Kubntu 21.10, and I'm stuck:

Unable to complete install: 'internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/Windows-swtpm.log' for details.'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4389, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/Windows-swtpm.log' for details.

Hello, assuming that the swtpm error log mentioned above contains this message: "Need read/write rights on /var/lib/swtpm-localca/.lock.swtpm-localca for user tss.", the fix might be to add your user to the "tss" group and running a few commands from this reddit thread. Worked for me

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Ali9304 said:

Hello, assuming that the swtpm error log mentioned above contains this message: "Need read/write rights on /var/lib/swtpm-localca/.lock.swtpm-localca for user tss.", the fix might be to add your user to the "tss" group and running a few commands from this reddit thread. Worked for me

Sorry. I forgot to update my post.  I decided to just compile it straight from source, and that "fixed" it for me.

But thanks for linking that.  Hopefully whoever had the same issues as I did would be able to use that to help them.

Desktop

Y4M1-II: AMD Ryzen 9-5900X | Asrock RX 6900XT Phantom Gaming D | Gigabyte RTX 4060 low profile | 64GB G.Skill Ripjaws V | 2TB Samsung 980 Pro + 4TB 870 EVO + 4TB SanDisk Ultra 3D + 8TB WD Black + 4TB WD Black HDD | Lian Li O11 Dynamic XL-X | Antec ST1000 1000W 80+ Titanium | MSI Optix MAG342CQR | BenQ EW3270U | Kubuntu

-------------------------------

Mobile devices

Kuroneko: Lenovo ThinkPad X1 Yoga 4th (Intel i7-10510U | 16GB RAM | 1TB SSD)

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 months later...
  • 2 weeks later...
On 10/14/2021 at 2:05 AM, Mswal2846 said:

I followed the guide.  I used the virtio-win iso to install the Display Adapter.  The "Red Hat QXL controller" driver is installed but comes up with an "!" that says:

 

Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code 52)

 

That same driver works fine in Windows 10 Pro ... so I'm guess Windows 11 is asking for a signed driver.  The result is not able to resize the screen.  Did you have a work around for this?

 

(Nice guide, by the way!)

 

 

6 months later I have the same issue. Have you found a workaround?

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, thierrybo said:

6 months later I have the same issue. Have you found a workaround?

I just found one. Reboot and enter UEFI BIOS: unchecked Secure Boot" and that's all. After reboot the vm goes full screen ans there is no error on "Red Hat QXL controller".

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 month later...
On 11/6/2021 at 12:56 AM, AlpacaTechTips said:

for me changing resolutions work with this installed in the guest

 

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win-guest-tools.exe

 

I tried that, and the installer failed with a very non-specific error message.  Any idea how I can get a resolution higher than 800x600?

 

virtio-win-failure.png

 

virtio-win-guest-tools-log.png

Edited by Patrick Pelletier
Adjusted white space for better readability
Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Patrick Pelletier said:

I tried that, and the installer failed with a very non-specific error message.  Any idea how I can get a resolution higher than 800x600?

 

Never mind; I found the answer here.  I just needed to disable a few features in the installer.

virtio-win-guest-tools-disable-features.png

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×