You are not logged in.

#1 2023-07-09 03:03:13

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Virtualisation Issues, Cannot Start VM using libvirt

Virtualisation Issues, Cannot Start VM using libvirt
1219Sun09Jly23 → 1251Sun09Jly23
jazztache@jazztarche-revengance
══════════──────────══════════
I have had this issue for a while, and I thought I had solved it when I uninstalled and re-installed qemu, virt and virt-manager. I thought it reset my configs back to default and it was working for a little bit, but now it has broken itself again.

- WHEN TRYING TO START A VIRTUAL MACHINE -

I have three existing Windows 10 Amelorated Edition Virtual Machines. Initially everything seems alright. I use `virt-manager` to start up the UI.

However, Trying to start any one of them displays the following error:

Error starting domain: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No such file or directory

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/asyncjob.py", line 108, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup
    self._backend.create()
  File "/usr/lib/python3.11/site-packages/libvirt.py", line 1373, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No such file or directory

Using `sudo virt-manager` also has the exact same problem, but now the UI is in light mode (ew smile ).

- WHEN TRYING TO CREATE A VIRTUAL MACHINE -

Initially, everything seems OK. I am able to get past multiple screens up until the networking screen, with the 'Finish' button. Under the Network Selection, there is an error '[!] Failed to find a suitable default network.'

Usually a best-fit network is selected, but the box is left blank in this case.

- STARTING LIBVIRTD -

This removes any dialogs onscreen in virt-manager, and boots me back to the main screen. There are now no VMs displayed, and the program only shows 'QEMU/KVM Not Connected' in feint text. There is nothing else that can be done.

Restarting libvirtd in this state using `sudo systemctl restart libvirtd` does nothing.

- SYSTEMCTL OUTPUTS -

A lot of other help requests online are showing the output of `sudo systemctl status libvirtd`, here is mine. These outputs are from after I have done the steps above.

● libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: active (running) since Sun 2023-07-09 12:32:43 AEST; 1min 2s ago
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd-ro.socket
             ● libvirtd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 19241 (libvirtd)
      Tasks: 22 (limit: 32768)
     Memory: 23.6M
        CPU: 522ms
     CGroup: /system.slice/libvirtd.service
             ├─14138 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
             ├─14139 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
             └─19241 /usr/bin/libvirtd --timeout 120

Jul 09 12:32:43 jazztarche-revengance systemd[1]: Starting Virtualization daemon...
Jul 09 12:32:43 jazztarche-revengance systemd[1]: Started Virtualization daemon.
Jul 09 12:32:43 jazztarche-revengance dnsmasq[14138]: read /etc/hosts - 0 names
Jul 09 12:32:43 jazztarche-revengance dnsmasq[14138]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Jul 09 12:32:43 jazztarche-revengance dnsmasq-dhcp[14138]: read /var/lib/libvirt/dnsmasq/default.hostsfile

- RESTARTING VIRT-MANAGER -

When I close and re-open virt-manager, the VMs come back, but I get the same error as before, and libvirtd deactivates.

○ libvirtd.service - Virtualization daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: inactive (dead) since Sun 2023-07-09 12:34:43 AEST; 5min ago
   Duration: 2min 53ms
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd-ro.socket
             ● libvirtd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
    Process: 19241 ExecStart=/usr/bin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS)
   Main PID: 19241 (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 32768)
     Memory: 7.5M
        CPU: 535ms
     CGroup: /system.slice/libvirtd.service
             ├─14138 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
             └─14139 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper

Jul 09 12:32:43 jazztarche-revengance systemd[1]: Starting Virtualization daemon...
Jul 09 12:32:43 jazztarche-revengance systemd[1]: Started Virtualization daemon.
Jul 09 12:32:43 jazztarche-revengance dnsmasq[14138]: read /etc/hosts - 0 names
Jul 09 12:32:43 jazztarche-revengance dnsmasq[14138]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Jul 09 12:32:43 jazztarche-revengance dnsmasq-dhcp[14138]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Jul 09 12:34:43 jazztarche-revengance systemd[1]: libvirtd.service: Deactivated successfully.
Jul 09 12:34:43 jazztarche-revengance systemd[1]: libvirtd.service: Unit process 14138 (dnsmasq) remains running after unit stopped.
Jul 09 12:34:43 jazztarche-revengance systemd[1]: libvirtd.service: Unit process 14139 (dnsmasq) remains running after unit stopped.

...effectively back in the same spot as before, going in circles. Not fun.

- PACKAGES -

Just in case there is a packaging issue, here are the virt,qemu, and kvm related packages I have.

`pacman -Q | grep "virt"`

libvirt 1:9.5.0-1
libvirt-glib 4.0.0-2
libvirt-python 1:9.5.0-1
qemu-hw-display-virtio-gpu 8.0.2-1
qemu-hw-display-virtio-gpu-gl 8.0.2-1
qemu-hw-display-virtio-gpu-pci 8.0.2-1
qemu-hw-display-virtio-gpu-pci-gl 8.0.2-1
qemu-hw-display-virtio-vga 8.0.2-1
qemu-hw-display-virtio-vga-gl 8.0.2-1
qemu-hw-s390x-virtio-gpu-ccw 8.0.2-1
qt-virt-manager 0.72.99-4
virt-install 4.1.0-2
virt-manager 4.1.0-2
virtiofsd 1.6.1-1

`pacman -Q | grep "qemu"`

qemu-audio-alsa 8.0.2-1
qemu-audio-dbus 8.0.2-1
qemu-audio-jack 8.0.2-1
qemu-audio-oss 8.0.2-1
qemu-audio-pa 8.0.2-1
qemu-audio-sdl 8.0.2-1
qemu-audio-spice 8.0.2-1
qemu-block-curl 8.0.2-1
qemu-block-dmg 8.0.2-1
qemu-block-nfs 8.0.2-1
qemu-block-ssh 8.0.2-1
qemu-chardev-spice 8.0.2-1
qemu-common 8.0.2-1
qemu-desktop 8.0.2-1
qemu-hw-display-qxl 8.0.2-1
qemu-hw-display-virtio-gpu 8.0.2-1
qemu-hw-display-virtio-gpu-gl 8.0.2-1
qemu-hw-display-virtio-gpu-pci 8.0.2-1
qemu-hw-display-virtio-gpu-pci-gl 8.0.2-1
qemu-hw-display-virtio-vga 8.0.2-1
qemu-hw-display-virtio-vga-gl 8.0.2-1
qemu-hw-s390x-virtio-gpu-ccw 8.0.2-1
qemu-hw-usb-host 8.0.2-1
qemu-hw-usb-redirect 8.0.2-1
qemu-hw-usb-smartcard 8.0.2-1
qemu-img 8.0.2-1
qemu-pr-helper 8.0.2-1
qemu-system-x86 8.0.2-1
qemu-system-x86-firmware 8.0.2-1
qemu-tools 8.0.2-1
qemu-ui-curses 8.0.2-1
qemu-ui-dbus 8.0.2-1
qemu-ui-egl-headless 8.0.2-1
qemu-ui-gtk 8.0.2-1
qemu-ui-opengl 8.0.2-1
qemu-ui-sdl 8.0.2-1
qemu-ui-spice-app 8.0.2-1
qemu-ui-spice-core 8.0.2-1
qemu-vhost-user-gpu 8.0.2-1

`pacman -Q | grep "kvm"`

(ERRORS with [0|1] in fish shell)

If there are any other logs or outputs that are needed to debug this issue, please notify me. Ready and willing to get my hands dirty with journalctl if need be.

- ls /var/run/libvirt/ -

Here are the perms of the files.

Before enabling libvirtd

jazztache@jazztarche-revengance /v/r/libvirt> /bin/ls -al
total 0
drwxr-xr-x 13 root root 500 Jul  9 11:36 .
drwxr-xr-x 32 root root 860 Jul  9 12:38 ..
drwx------  2 root root  60 Jul  8 23:40 common
drwxr-xr-x  2 root root  40 Jul  8 23:40 hostdevmgr
drwx------  2 root root  40 Jul  9 12:34 interface
srw-------  1 root root   0 Jul  8 23:40 libvirt-admin-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 libvirt-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 libvirt-sock-ro
drwxr-xr-x  2 root root  60 Jul  9 12:34 lxc
drwxr-xr-x  2 root root 120 Jul  9 12:34 network
drwx------  2 root root  40 Jul  9 12:34 nodedev
drwx------  2 root root  40 Jul  9 12:34 nwfilter
drwx------  2 root root  40 Jul  9 11:36 nwfilter-binding
drwxr-xr-x  5 root root 140 Jul  9 12:38 qemu
drwx------  2 root root  40 Jul  9 12:34 secrets
drwxr-xr-x  2 root root 100 Jul  9 12:38 storage
srw-------  1 root root   0 Jul  8 23:40 virtlockd-sock
srw-------  1 root root   0 Jul  9 11:31 virtlogd-admin-sock
srw-------  1 root root   0 Jul  8 23:40 virtlogd-sock
srw-------  1 root root   0 Jul  8 23:40 virtqemud-admin-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 virtqemud-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 virtqemud-sock-ro
srw-------  1 root root   0 Jul  9 11:26 virtstoraged-admin-sock
srw-rw-rw-  1 root root   0 Jul  9 11:26 virtstoraged-sock
srw-rw-rw-  1 root root   0 Jul  9 11:26 virtstoraged-sock-ro

After enabling libvirtd

jazztache@jazztarche-revengance /v/r/libvirt> /bin/ls -al
total 0
drwxr-xr-x 13 root root 500 Jul  9 11:36 .
drwxr-xr-x 32 root root 860 Jul  9 12:38 ..
drwx------  2 root root  60 Jul  8 23:40 common
drwxr-xr-x  2 root root  40 Jul  8 23:40 hostdevmgr
drwx------  2 root root  40 Jul  9 12:34 interface
srw-------  1 root root   0 Jul  8 23:40 libvirt-admin-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 libvirt-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 libvirt-sock-ro
drwxr-xr-x  2 root root  60 Jul  9 12:34 lxc
drwxr-xr-x  2 root root 120 Jul  9 12:34 network
drwx------  2 root root  40 Jul  9 12:34 nodedev
drwx------  2 root root  40 Jul  9 12:34 nwfilter
drwx------  2 root root  40 Jul  9 11:36 nwfilter-binding
drwxr-xr-x  5 root root 140 Jul  9 12:38 qemu
drwx------  2 root root  40 Jul  9 12:34 secrets
drwxr-xr-x  2 root root 100 Jul  9 12:38 storage
srw-------  1 root root   0 Jul  8 23:40 virtlockd-sock
srw-------  1 root root   0 Jul  9 11:31 virtlogd-admin-sock
srw-------  1 root root   0 Jul  8 23:40 virtlogd-sock
srw-------  1 root root   0 Jul  8 23:40 virtqemud-admin-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 virtqemud-sock
srw-rw-rw-  1 root root   0 Jul  8 23:40 virtqemud-sock-ro
srw-------  1 root root   0 Jul  9 11:26 virtstoraged-admin-sock
srw-rw-rw-  1 root root   0 Jul  9 11:26 virtstoraged-sock
srw-rw-rw-  1 root root   0 Jul  9 11:26 virtstoraged-sock-ro

Starting libvirtd after this then closes dialogs and disconnects QEMU/KVM, with no change in files.

- OTHER -

I think this is a networking issue judging by the name. In both cases they are two separate errors that occur based on not being able to find a network.
I also don't see the usual symlink text when I enable it... strange. Maybe it's a configuration error, seems my configs persisted the re-install.

Any help will be appreciated
-Jazz

Offline

#2 2023-07-09 16:04:09

Keyemail
Member
Registered: 2023-07-05
Posts: 8

Re: Virtualisation Issues, Cannot Start VM using libvirt

Looking at the top error, it seems like i see the line 'Error starting domain: Failed to connect socket to '/var/run/libvirt/virtnetworkd-sock': No such file or directory' which could indicate a network error.. are you sure you have your virtual network enabled?

Offline

#3 2023-07-09 23:47:12

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Re: Virtualisation Issues, Cannot Start VM using libvirt

Ahh.... gotcha. I think I encountered this some while ago. I'm using MullvadVPN.

Since I usually like to have my VPN on for OpSec purposes, is there any way I can configure QEMU/KVM/Virt (whichever is failing here) to instead pass through the VPN and use the VPN network properly?

Offline

#4 2023-07-10 00:29:23

Keyemail
Member
Registered: 2023-07-05
Posts: 8

Re: Virtualisation Issues, Cannot Start VM using libvirt

Uh, there probably is a way.. and I'd have to research or ask GPT- however why not just download your VPN for windows since there is technically a windows option.. I think that'd be the easiest way as far im concerned

Offline

#5 2023-07-10 00:34:46

Keyemail
Member
Registered: 2023-07-05
Posts: 8

Re: Virtualisation Issues, Cannot Start VM using libvirt

Sorry, i assumed your using windows but its available for almost every other type of OS except for windows

Offline

#6 2023-07-10 07:01:58

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Re: Virtualisation Issues, Cannot Start VM using libvirt

I am using Windows 10 ame on some, but I want to try out Linux distros, and whilst it's possible that to install Mullvad on anything and everything, it's going to be a bit of a hassle, especially since I don't know powershell or winget to automate the Windows VMs Mullvad installation.

I want to leave that as the fallback option.

Is there a more elegant solution I can do on the host system?

Last edited by Jazztache (2023-07-10 07:06:41)

Offline

#7 2023-07-11 03:02:01

Keyemail
Member
Registered: 2023-07-05
Posts: 8

Re: Virtualisation Issues, Cannot Start VM using libvirt

Well, that does make sense.. The more elegant solution it seems is to enable IPv4 Port forwarding and then creating a bridged network OR using NAT networking. Which then you can edit your VM configuration to follow.

Offline

#8 2023-07-11 10:45:42

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Re: Virtualisation Issues, Cannot Start VM using libvirt

Sounds good, are there any resources or documentation (especially Virt and Linux specific ones) that I can use to go and read up on?

You have piqued my interest. Just so you know, I cannot access the router, as the sysadmin for our network is not me smile

Offline

#9 2023-07-12 22:20:45

Keyemail
Member
Registered: 2023-07-05
Posts: 8

Re: Virtualisation Issues, Cannot Start VM using libvirt

Sure, i believe the way you can enable Port Forwarding on your system is via this link, its on section 2.2 https://wiki.archlinux.org/title/Internet_sharing

for bridged networking your probably going to want to have bridge-utils installed using pacman, and i believe following this guide shall help to: https://wiki.archlinux.org/title/Bridge_with_netctl
and then just enable and start the service bridge..

if your going NAT networking just make sure virtio-net-pci is loaded and you should be good to go

if your going NAT you probably want this in your XML file of your virtual machine:

<interface type='network'>
  <mac address='52:54:00:XX:XX:XX'/>  <!-- Replace XX:XX:XX with a unique MAC address -->
  <source network='default'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

or if your going bridged you want this:

<interface type='bridge'>
  <mac address='52:54:00:XX:XX:XX'/>  <!-- Replace XX:XX:XX with a unique MAC address -->
  <source bridge='br0'/>  <!-- Replace "br0" with the bridge interface name configured in step 3c -->
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

honestly the rest is up to you dude! im sorry if there isn't an "exact" guide on how to do this and i tried researching about it, people talk about it but unfortunately i see no guide as of today but hey that might just be me who knows.. these are stuff i found while researching/using chat GPT so it may not be 100% correct but if you have any issues though I can try to the best of my abilities to help you but im too advanced of these virtual machine stuff myself so sorry if you didn't find this helpful!

Offline

#10 2023-07-14 10:28:51

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Re: Virtualisation Issues, Cannot Start VM using libvirt

Sorry for the late response, thanks for the help! I'll be sure to set it up when I have time.

Offline

#11 2023-07-26 08:10:04

Jazztache
Member
Registered: 2022-10-07
Posts: 63

Re: Virtualisation Issues, Cannot Start VM using libvirt

Update on the situation:

I have the same VPN (Mullvad), with everything configured the same way (OOTB configs), configured on a different Linux PC. This one is running KDE Neon.

For some reason, this one works out of the box, *even with the VPN on*. This is really weird, so I guess this is Arch-specific.
The kicker is, after turning off my VPN and

sudo systemctl restart libvirtd

, Arch still doesn't work.

Are there any logs I can send from the KDE Neon machine so I can compare what I need to configure and update accordingly? This might be an easier and more permanent solution.

Offline

Board footer

Powered by FluxBB