Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931604 - app-emulation/virt-manager-4.1.0-r1 can't create a new windows11 virtual machine on amd64
Summary: app-emulation/virt-manager-4.1.0-r1 can't create a new windows11 virtual mach...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-08 22:09 UTC by Tohka
Modified: 2024-05-17 06:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,19.00 KB, text/plain)
2024-05-08 22:09 UTC, Tohka
Details
win11-libvirt.log (win11-libvirt.log,6.54 KB, text/x-log)
2024-05-10 20:51 UTC, Tohka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tohka 2024-05-08 22:09:04 UTC
Created attachment 892545 [details]
emerge --info

When I try to create a new virtual machine it gives me this error:

Unable to complete install: 'internal error: process exited while connecting to monitor: 2024-05-08T22:05:01.652731Z qemu-system-x86_64: error: failed to set MSR 0x40000021 to 0x0
Assertion failed: ret == cpu->kvm_msr_buf->nmsrs (../target/i386/kvm/kvm.c: kvm_buf_set_msrs: 3210)'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 695, in start_install
    domain = self._create_guest(
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 637, in _create_guest
    domain = self.conn.createXML(initial_xml or final_xml, 0)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libvirt.py", line 4545, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2024-05-08T22:05:01.652731Z qemu-system-x86_64: error: failed to set MSR 0x40000021 to 0x0
Assertion failed: ret == cpu->kvm_msr_buf->nmsrs (../target/i386/kvm/kvm.c: kvm_buf_set_msrs: 3210)

I can run already created virtual machine images just fine I just can't create any new ones. This error exists with the latest versions of qemu and libvirt on ~amd64.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-08 22:09:42 UTC
A QEMU bug, I suppose.
Comment 2 Michal Prívozník 2024-05-09 03:46:09 UTC
Yeah, this smells like a QEMU bug. Though, maybe libvirt can stop tickling it. ~Tohka, can you please turn on debug logs for libvirt, reproduce and attach them here?

This should be enough to turn debug logs on:
https://libvirt.org/kbase/debuglogs.html#tl-dr-enable-debug-logs-for-most-common-scenario

If you're running monolithic libvirtd instead of split deamon (virtqemud), then just s/virtqemud/libvirtd/ in the virt-admin commands.
Comment 3 Tohka 2024-05-10 20:51:25 UTC
(In reply to Michal Prívozník from comment #2)
> Yeah, this smells like a QEMU bug. Though, maybe libvirt can stop tickling
> it. ~Tohka, can you please turn on debug logs for libvirt, reproduce and
> attach them here?
> 
> This should be enough to turn debug logs on:
> https://libvirt.org/kbase/debuglogs.html#tl-dr-enable-debug-logs-for-most-
> common-scenario
> 
> If you're running monolithic libvirtd instead of split deamon (virtqemud),
> then just s/virtqemud/libvirtd/ in the virt-admin commands.

I have tested this and it seems like the error only occurs when I am trying to create a windows 11 virtual machine. I have posted the libvirt log of what is happening.
Comment 4 Tohka 2024-05-10 20:51:48 UTC
Created attachment 892703 [details]
win11-libvirt.log
Comment 5 Tohka 2024-05-10 20:57:46 UTC
I can however create a dummy linux virtual machine with no storage and once thats done I can replace the iso with a windows11 iso and everything seems to be fine but just directly I cant create a windows11 virtual machine.
Comment 6 Michal Prívozník 2024-05-11 05:46:20 UTC
Yeah, this is a QEMU bug (or maybe KVM even?) and it should be reported to QEMU. But, IIUC, you have:

  <clock>
    <timer name='hypervclock' present='yes'/>
  </clock>

in your domain XML. Now, this timer causes libvirt to put -cpu hv-time=on onto the cmd line which in turn makes QEMU set the MSR and fail. Maybe the workaround is to delete the timer?
Comment 7 Tohka 2024-05-13 08:30:33 UTC
(In reply to Michal Prívozník from comment #6)
> Yeah, this is a QEMU bug (or maybe KVM even?) and it should be reported to
> QEMU. But, IIUC, you have:
> 
>   <clock>
>     <timer name='hypervclock' present='yes'/>
>   </clock>
> 
> in your domain XML. Now, this timer causes libvirt to put -cpu hv-time=on
> onto the cmd line which in turn makes QEMU set the MSR and fail. Maybe the
> workaround is to delete the timer?

It seems that anything hyperv related causes the vm to show that error so after removing <hyperv>...</hyperv> it works. However, maybe its also a kernel issue as I may not have support for it?
Comment 8 Tohka 2024-05-13 08:32:46 UTC
It seems like a similar issue has already been mentioned here https://forums.gentoo.org/viewtopic-p-8826149.html
Comment 9 Tohka 2024-05-16 14:37:12 UTC
It seems the issue was CONFIG_KVM_HYPERV needs to be enabled now for this to work and not cause any problems.
Comment 10 Michal Prívozník 2024-05-17 06:33:58 UTC
I wonder whether we should put CONFIG_KVM_HYPERV onto the list of kernel config checks. A check failing is not fatal but can warn users upfront.