Error Accessing VM's in Virtual Machine Manager

Unable to connect to libvirt qemu:///system.

Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory

Libvirt URI is: qemu:///system

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 923, in _do_open
    self._backend.open(cb, data)
  File "/usr/share/virt-manager/virtinst/connection.py", line 171, in open
    conn = libvirt.openAuth(self._open_uri,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/libvirt.py", line 147, in openAuth
    raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory

A forum suggested following methods

So i ran

 sudo pacman -S --needed virt-manager qemu-desktop libvirt edk2-ovmf dnsmasq iptables-nft
[sudo] password for parasetu: 
warning: virt-manager-4.1.0-3 is up to date -- skipping
warning: qemu-desktop-9.0.2-1 is up to date -- skipping
warning: libvirt-1:10.6.0-1 is up to date -- skipping
warning: edk2-ovmf-202311-1 is up to date -- skipping
warning: dnsmasq-2.90-1 is up to date -- skipping
resolving dependencies...
looking for conflicting packages...
:: iptables-nft-1:1.8.10-2 and iptables-1:1.8.10-2 are in conflict. Remove iptables? [y/N] 

Should i remove it or keep it ? (y/n)

they are in conflict - you need one of them
and need to decide which one.
If you say N (default)
iptables will stay - otherwise iptables-nft will replace it

Why not go with the default … if you don’t know?

But apparently, virt-manager requires iptables-nft
So: do replace it (y)

But!
you used --needed and a whole self constructed command line
so I’m not sure at all that iptables-nft is actually needed - it’s just what you told pacman to install

and of course there will be a conflict between what you wanted and what is already present.

This may help with your decision on which one to choose:

To summarize, the iptables-nft variant utilizes the newer nftables kernel infrastructure. This gives the variant some benefits over iptables-legacy while allowing it to remain a 100% compatible drop-in replacement for the legacy command. Note, however, that iptables-nft and nftables are not equivalent. They merely share infrastructure.

It is also important to note that while iptables-nft can supplant iptables-legacy, you should never use them simultaneously.

As you know , I hadn’t updated the system from long so on reading the virt-manager topic , it discusses , what is virtualisation and if your bios and cpu supports it and then it runs this command to install virt-manager , qemu and all dependencies , as last time it was pointed out that my services weren’t running , so i thought of installing it again as this way the services will be enabled, is it the right step?

ah so should i do it or not?

One question is:

Where did you get that whole command line from?

You already have iptables.
If virt-manager really needs iptables-nft, then yes, replace it.

I didn’t know.

If the system is not up to date, all kinds of issues can emerge.

Update your system first, then tend to installing new stuff.

In essence:
you commanded it to do it, to replace it
and now you are asking whether to actually do it …

seems a strange question to me

Already updated

here :arrow_down:

you see this post(i have the same problem) in it they have mentioned a link , which i opened and then i don’t see my issue listed , so i thought i had to run the commands listed there

It didn’t look like it to me from what you said.

The command line includes: iptables-nft
It instructs pacman to install it.

But this is in conflict with what you already have: iptables

So:
if you want the command to go through - say yes to replace the new one with what is there already.

It’s a wiki, so one could assume it is accurate - but: I don’t know.

The two pieces of software are functionally equivalent.
And your wiki command tells you to use iptables-nft
so:
use it. :man_shrugging:



What command produced the output in your very first post?

sudo pacman -Syyu
:: Synchronizing package databases...
 core                  140.5 KiB  19.6 KiB/s 00:07 [######################] 100%
 extra                   7.9 MiB   318 KiB/s 00:25 [######################] 100%
 community              29.0   B  17.0   B/s 00:02 [######################] 100%
 multilib              142.0 KiB  21.8 KiB/s 00:07 [######################] 100%
:: Starting full system upgrade...
warning: chromium: local (128.0.6613.137-1) is newer than extra (128.0.6613.119-1)
warning: vivaldi: local (6.9.3447.44-1) is newer than extra (6.9.3447.41-1)
 there is nothing to do

yeah i was not sure about it that’s why inquired here

the one which says unable to connect?
well no command but on trying to connect VMM , it displayed that error

If I recall correct - iptables-nft is required for default NAT networking.

See libvirt optional dependencies

pamac info libvirt

So the correct answer to the question is - yes - remove iptables.

If your system requires a firewall - I recommend removing ufw/gufw and use firewalld instead.

Sorry for late reply , and i installed the iptables-nft and removed iptables

pamac info libvirt
Name                  : libvirt
Version               : 1:10.6.0-1
Description           : API for controlling virtualization engines
                        (openvz,kvm,qemu,virtualbox,xen,etc)
URL                   : https://libvirt.org/
Licenses              : LGPL-2.1-or-later GPL-3.0-or-later
Repository            : extra
Installed Size        : 50.6 MB
Groups                : --
Depends On            : libpciaccess yajl fuse3 gnutls parted libssh libxml2
                        numactl polkit libnbd libnl
Optional Dependencies : libvirt-storage-gluster: Gluster storage backend
                        libvirt-storage-iscsi-direct: iSCSI-direct storage backend
                        gettext: required for libvirt-guests.service [Installed]
                        openbsd-netcat: for remote management over ssh
                        dmidecode: DMI system info support [Installed]
                        dnsmasq: required for default NAT/DHCP for guests [Installed]
                        radvd: IPv6 RAD support
                        iptables-nft: required for default NAT networking [Installed]
                        qemu-base: QEMU/KVM support [Installed]
                        qemu-desktop: QEMU/KVM desktop support [Installed]
                        qemu-emulators-full: Support of additional QEMU architectures [Installed]
                        lvm2: Logical Volume Manager support [Installed]
                        open-iscsi: iSCSI support via iscsiadm
                        swtpm: TPM emulator support
Required By           : libvirt-glib libvirt-python
Optional For          : --
Provides              : libvirt=10.6.0 libvirt.so=0-64 libvirt-admin.so=0-64
                        libvirt-lxc.so=0-64 libvirt-qemu.so=0-64

yeah its mentioned in optional dependencies
now what’s the next step? is it
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service

When you replace the package with iptables-nft, just make sure you have in:

/etc/libvirt/network.conf

firewall_backend = "nftables"

There is actually more network configuration missing from the Manjaro wiki. But that shouldn’t stop you connecting to the libvirtd socket, and launching VMs.

Not much info to go on, but you are in all 3 groups right? (Which you need to restart all shells and desktop environment after the change.)

Is the service running? systemctl status libvirtd

Is the socket you are trying to connect to listening?

sudo ss -lnp | grep libvirtd

u_dgr UNCONN 0      0                                               * 2168959                * 0    users:(("libvirtd",pid=241052,fd=6))                                     
u_str LISTEN 0      1000                    /run/libvirt/libvirt-sock 6573                   * 0    users:(("libvirtd",pid=241052,fd=4),("systemd",pid=1,fd=81))             
u_str LISTEN 0      20                /run/libvirt/libvirt-admin-sock 6574                   * 0    users:(("libvirtd",pid=241052,fd=5),("systemd",pid=1,fd=454))            
u_str LISTEN 0      1000                 /run/libvirt/libvirt-sock-ro 6575                   * 0    users:(("libvirtd",pid=241052,fd=3),("systemd",pid=1,fd=439))            

Everything I have points to /run for me, not /var/run, but the latter is a symlink, so that shouldn’t matter. You see the socket listening for me, which you can’t connect to, in the second line of the output there.

A full inxi -v8z and relavent journalctl entries may help too.

e.g., Anything useful in: journalctl -u libvirtd -b0

Or all logs with -p4/--priority=4 (Severity of warning and up.)

Although not necessarily related to the virtual machine issue, this does mean you haven’t been managing your .pacnew files and this is likely to cause issues. The community repo was dropped around a year ago.

yeah , this was a comment , i removed the hash to make it work

○ libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; preset>
     Active: inactive (dead)
TriggeredBy: ○ libvirtd-ro.socket
             ○ libvirtd-admin.socket
             ○ libvirtd.socket
       Docs: man:libvirtd(8)
             https://libvirt.org/

I didn’t get any output for this.

inxi -v8z
System:
  Kernel: 6.10.6-10-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.10-x86_64
    root=UUID=411dc37c-e651-4220-b380-d3306c59e042 ro quiet intel_iommu=on
    apparmor=1 security=apparmor
    resume=UUID=f3261ca0-9a81-409a-a3d1-503b64ef5e0b udev.log_priority=3
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.43 wm: xfwm4 v: 4.18.0
    with: xfce4-panel tools: light-locker vt: 7 dm: LightDM v: 1.32.0
    Distro: Manjaro base: Arch Linux
Machine:
  Type: Desktop System: Dell product: OptiPlex 5080 v: N/A
    serial: <superuser required> Chassis: type: 3 serial: <superuser required>
  Mobo: Dell model: 032W55 v: A00 serial: <superuser required> part-nu: 09A6
    uuid: <superuser required> UEFI: Dell v: 1.17.1 date: 12/18/2022
Battery:
  Message: No system battery data found. Is one present?
Memory:
  System RAM: total: 16 GiB available: 15.34 GiB used: 1.8 GiB (11.7%)
  Message: For most reliable report, use superuser + dmidecode.
  Array-1: capacity: 128 GiB slots: 4 modules: 1 EC: None
    max-module-size: 32 GiB note: est.
  Device-1: DIMM1 type: no module installed
  Device-2: DIMM2 type: no module installed
  Device-3: DIMM3 type: DDR4 detail: synchronous size: 16 GiB speed:
    spec: 3200 MT/s actual: 2933 MT/s volts: curr: 1 width (bits): data: 64
    total: 64 manufacturer: 802C0000802C part-no: 16ATF2G64AZ-3G2J1
    serial: <filter>
  Device-4: DIMM4 type: no module installed
PCI Slots:
  Permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i7-10700 bits: 64 type: MT MCP arch: Comet Lake
    gen: core 10 level: v3 note: check built: 2020 process: Intel 14nm family: 6
    model-id: 0xA5 (165) stepping: 5 microcode: 0xFC
  Topology: cpus: 1x dies: 1 clusters: 8 cores: 8 threads: 16 tpc: 2
    smt: enabled cache: L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 2 MiB
    desc: 8x256 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 800 min/max: 800/4800 scaling: driver: intel_pstate
    governor: powersave cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800
    8: 800 9: 800 10: 800 11: 800 12: 800 13: 800 14: 800 15: 800 16: 800
    bogomips: 92838
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs
    ibrs_enhanced ida intel_pt invpcid lahf_lm lm mca mce md_clear mmx
    monitor movbe mpx msr mtrr nonstop_tsc nopl nx ospke pae pat pbe pcid
    pclmulqdq pdcm pdpe1gb pebs pge pku pln pni popcnt pse pse36 pts rdrand
    rdseed rdtscp rep_good sdbg sep smap smep smx ss ssbd sse sse2 sse4_1
    sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust
    tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt
    xsaves xtopology xtpr
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS; IBPB:
    conditional; RSB filling; PBRSB-eIBRS: SW sequence; BHI: SW loop, KVM: SW
    loop
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CometLake-S GT2 [UHD Graphics 630] vendor: Dell driver: i915
    v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports:
    active: none empty: DP-1, DP-2, DP-3, HDMI-A-1, HDMI-A-2, HDMI-A-3
    bus-ID: 00:02.0 chip-ID: 8086:9bc5 class-ID: 0380
  Device-2: NVIDIA TU116 [GeForce GTX 1660 SUPER] vendor: Dell driver: N/A
    alternate: nouveau non-free: 550.xx+ status: current (as of 2024-09;
    EOL~2026-12-xx) arch: Turing code: TUxxx process: TSMC 12nm FF
    built: 2018-2022 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:21c4 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
    compositor: xfwm4 v: 4.18.0 driver: X: loaded: modesetting,nouveau
    alternate: fbdev,nv,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: Unknown-1 mapped: None-1 res: 1920x1080 hz: 60 size: N/A
    modes: 1920x1080
  API: OpenGL Message: Unable to show GL data. glxinfo is missing.
Audio:
  Device-1: Intel Comet Lake PCH cAVS vendor: Dell driver: snd_hda_intel
    v: kernel alternate: snd_soc_skl, snd_soc_avs, snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:06c8 class-ID: 0403
  Device-2: NVIDIA TU116 High Definition Audio vendor: Dell
    driver: snd_hda_intel v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.1 chip-ID: 10de:1aeb
    class-ID: 0403
  API: ALSA v: k6.10.6-10-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.2.3 status: off with: pipewire-media-session
    status: active tools: pw-cli
  Server-3: PulseAudio v: 17.0 status: active with: 1: pulseaudio-alsa
    type: plugin 2: pulseaudio-jack type: module tools: pacat,pactl,pavucontrol
journalctl -u libvirtd -b0
-- No entries --

You have to start it.

sudo systemctl enable libvirtd --now

There is something else with your system.

I have virtual machine manager installed - I do not use it often - but I started it for the sake of testing your issue - and it loads without issues.

It is ultra simple to get it working

 $ systemctl list-unit-files | grep libvirt
libvirt-guests.service                                                    disabled        disabled
libvirtd.service                                                          enabled         disabled
libvirtd-admin.socket                                                     enabled         disabled
libvirtd-ro.socket                                                        enabled         disabled
libvirtd-tcp.socket                                                       disabled        disabled
libvirtd-tls.socket                                                       disabled        disabled
libvirtd.socket                                                           enabled         disabled

After enabling libvirt

sudo systemctl enable --now libvirtd

Open the virtual machine manager - doubleclick the QEMU/KVM line → Virtual Networks → start the default network → check the Autostart entry and click apply.

Of course there is a lot of advanced options - but basically the above is all that is needed.

Don’t know what was wrong , but now its connecting and working well , thanks :))