I am currently trying out the Windows Subsystem for Linux v2, on a Windows 10 Fast Ring build (Build 20161). More specifically, I am trying to run a qemu-kvm virtual machine using nested virtualization, but each attempt at creating a new VM using virt-manager ends up in failure.
I use Ubuntu 18.04 in my WSL2 instance, with a custom built kernel (that includes everything related to virtualization - please see this guide: https://boxofcables.dev/accelerated-kvm-guests-on-wsl-2/) and "nestedVirtualization" is set to "true" in my WSL config file. Even more so, "sudo kvm-ok" returns positive results when ran inside the Ubuntu instance.
I do have DBUS installed in Ubuntu WSL, and the service is running, so I believe this is not the source of the problem. I'm using VcXsrv for displaying X11 windows.
Here are the errors I get with each attempt:
Libvirtd.log
2020-07-07 03:33:24.507+0000: 1273: info : libvirt version: 4.0.0, package: 1ubuntu8.17 (Marc Deslauriers <[email protected]> Wed, 06 May 2020 14:18:23 -0400)
2020-07-07 03:33:24.507+0000: 1273: info : hostname: LAPTOP-DRAGOS
2020-07-07 03:33:24.507+0000: 1273: error : udevGetDMIData:1818 : internal error: Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' or '/sys/class/dmi/id'
2020-07-07 03:39:16.636+0000: 1261: error : virNetSocketNewConnectUNIX:715 : Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory
2020-07-07 03:39:29.617+0000: 1258: error : virNetSocketNewConnectUNIX:715 : Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory
2020-07-07 03:39:29.617+0000: 1258: error : virNetSocketNewConnectUNIX:715 : Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory
2020-07-07 04:01:14.141+0000: 1257: error : virKeepAliveTimerInternal:143 : internal error: connection closed due to keepalive timeout
Virt-manager GUI (when I click "Begin Installation" once all options have been set):
Unable to complete install: 'Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 2553, in _do_async_install
guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 498, in start_install
doboot, transient)
File "/usr/share/virt-manager/virtinst/guest.py", line 434, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3603, in createXML
if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory
What am I doing wrong? Any input is highly appreciated! Thanks in advance!
UPDATE: As @FreeSoftwareServers suggested, I tried starting the virtlogd service. Since Ubuntu 18.04 does not use initd, I went for sudo service virtlogd start
. And that got me over the initial error, but now I seem to encounter some permission issues, because I get the following:
Unable to complete install: 'internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied
2020-07-08T03:32:26.585442Z qemu-system-x86_64: failed to initialize KVM: Permission denied'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 2553, in _do_async_install
guest.start_install(meter=meter)
File "/usr/share/virt-manager/virtinst/guest.py", line 498, in start_install
doboot, transient)
File "/usr/share/virt-manager/virtinst/guest.py", line 434, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3603, in createXML
if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied
2020-07-08T03:32:26.585442Z qemu-system-x86_64: failed to initialize KVM: Permission denied
virt-manager GUI is run with sudo, so this permission denial message seems a bit puzzling.
Best regards, Dragoș
systemctl enable virtlogd.socket
&systemctl start virtlogd.socket
– Tomtomsystemctl status virtlogd.socket
– TomtomSystem has not been booted with systemd as init system (PID 1). Can't operate.
. However, I did usesudo service virtlogd start
and that got rid of the socket error. Now I am stuck in a different place:Unable to complete install: 'internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied 2020-07-08T03:22:55.259796Z qemu-system-x86_64: failed to initialize KVM: Permission denied'
– Bowsevirt-manager
is started from the CLI, with sudo. – Bowse