Error while attempting to create a virtual machine with virt-manager

Hello.

$ garuda-inxi
System:
Kernel: 5.17.1-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=63b28f5b-c1b1-46b5-abd9-132176ab64c0 rw rootflags=subvol=@
quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
systemd.unified_cgroup_hierarchy=1 loglevel=3
Desktop: KDE Plasma v: 5.24.4 tk: Qt v: 5.15.3 info: latte-dock
wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Server System: HP product: ProLiant DL380 G7 v: N/A
serial: <superuser required> Chassis: type: 23 serial: <superuser required>
Mobo: N/A model: N/A serial: N/A BIOS: HP v: P67 date: 08/16/2015
CPU:
Info: model: Intel Xeon E5640 bits: 64 type: MT MCP SMP arch: Nehalem
family: 6 model-id: 0x2C (44) stepping: 2 microcode: 0x1F
Topology: cpus: 2x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 2x 256 KiB (512 KiB) desc: d-4x32 KiB; i-4x32 KiB
L2: 2x 1024 KiB (2 MiB) desc: 4x256 KiB L3: 2x 12 MiB (24 MiB)
desc: 1x12 MiB
Speed (MHz): avg: 1581 high: 2602 min/max: 1600/2666 scaling:
driver: pcc-cpufreq governor: performance cores: 1: 0 2: 1870 3: 2384
4: 2019 5: 1644 6: 1600 7: 1615 8: 1880 9: 1615 10: 2602 11: 1668
12: 1600 13: 0 14: 1600 15: 1608 16: 1600 bogomips: 85311
Flags: ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf
mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode;
SMT vulnerable
Type: meltdown mitigation: PTI
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: Retpolines, IBPB: conditional, IBRS_FW,
STIBP: conditional, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: NVIDIA GK208B [GeForce GT 730] vendor: PNY driver: nvidia
v: 470.103.01 alternate: nouveau,nvidia_drm pcie: gen: 2 speed: 5 GT/s
lanes: 8 bus-ID: 11:00.0 chip-ID: 10de:1287 class-ID: 0300
Display: x11 server: X.Org v: 1.21.1.3 compositor: kwin_x11 driver: X:
loaded: nvidia gpu: nvidia display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 101 s-size: 483x272mm (19.02x10.71")
s-diag: 554mm (21.82")
Monitor-1: DVI-D-0 pos: primary res: 1920x1080 hz: 60 dpi: 102
size: 477x268mm (18.78x10.55") diag: 547mm (21.54") modes: N/A
Monitor-2: HDMI-0 pos: primary res: 1920x1080 size: N/A modes: N/A
OpenGL: renderer: NVIDIA GeForce GT 730/PCIe/SSE2
v: 4.6.0 NVIDIA 470.103.01 direct render: Yes
Audio:
Device-1: NVIDIA GK208 HDMI/DP Audio vendor: PNY driver: snd_hda_intel
v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 8 bus-ID: 11:00.1
chip-ID: 10de:0e0f class-ID: 0403
Device-2: C-Media USB Audio Device type: USB
driver: hid-generic,snd-usb-audio,usbhid bus-ID: 4-1:2 chip-ID: 0d8c:0008
class-ID: 0300
Sound Server-1: ALSA v: k5.17.1-zen1-1-zen running: yes
Sound Server-2: PulseAudio v: 15.0 running: no
Sound Server-3: PipeWire v: 0.3.49 running: yes
Network:
Device-1: Broadcom NetXtreme II BCM5709 Gigabit Ethernet
vendor: Hewlett-Packard NC382i Multi-port Server driver: bnx2 v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 2 link-max: lanes: 4 port: N/A
bus-ID: 03:00.0 chip-ID: 14e4:1639 class-ID: 0200
IF: enp3s0f0 state: down mac: <filter>
Device-2: Broadcom NetXtreme II BCM5709 Gigabit Ethernet
vendor: Hewlett-Packard NC382i Multi-port Server driver: bnx2 v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 2 link-max: lanes: 4 port: N/A
bus-ID: 03:00.1 chip-ID: 14e4:1639 class-ID: 0200
IF: enp3s0f1 state: down mac: <filter>
Device-3: Broadcom NetXtreme II BCM5709 Gigabit Ethernet
vendor: Hewlett-Packard NC382i Multi-port Server driver: bnx2 v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 2 link-max: lanes: 4 port: N/A
bus-ID: 04:00.0 chip-ID: 14e4:1639 class-ID: 0200
IF: enp4s0f0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-4: Broadcom NetXtreme II BCM5709 Gigabit Ethernet
vendor: Hewlett-Packard NC382i Multi-port Server driver: bnx2 v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 2 link-max: lanes: 4 port: N/A
bus-ID: 04:00.1 chip-ID: 14e4:1639 class-ID: 0200
IF: enp4s0f1 state: down mac: <filter>
IF-ID-1: br-5780daa07fe3 state: down mac: <filter>
IF-ID-2: docker0 state: down mac: <filter>
IF-ID-3: virbr0 state: down mac: <filter>
RAID:
Hardware-1: Hewlett-Packard Smart Array G6 controllers driver: hpsa
v: 3.4.20-200 port: 4000 bus-ID: 05:00.0 chip-ID: 103c:323a rev: N/A
class-ID: 0104
Drives:
Local Storage: total: 484.34 GiB used: 209.14 GiB (43.2%)
ID-1: /dev/sda maj-min: 8:0 model: LOGICAL VOLUME size: 37.24 GiB
block-size: physical: 512 B logical: 512 B type: N/A serial: N/A rev: 3.66
scheme: MBR
SMART Message: Unknown smartctl error. Unable to generate data.
ID-2: /dev/sdb maj-min: 8:16 model: LOGICAL VOLUME size: 447.1 GiB
block-size: physical: 512 B logical: 512 B type: N/A serial: N/A rev: 3.66
scheme: MBR
SMART Message: Unknown smartctl error. Unable to generate data.
Partition:
ID-1: / raw-size: 447.1 GiB size: 447.1 GiB (100.00%)
used: 209.14 GiB (46.8%) fs: btrfs dev: /dev/sdb1 maj-min: 8:17
ID-2: /home raw-size: 447.1 GiB size: 447.1 GiB (100.00%)
used: 209.14 GiB (46.8%) fs: btrfs dev: /dev/sdb1 maj-min: 8:17
ID-3: /var/log raw-size: 447.1 GiB size: 447.1 GiB (100.00%)
used: 209.14 GiB (46.8%) fs: btrfs dev: /dev/sdb1 maj-min: 8:17
ID-4: /var/tmp raw-size: 447.1 GiB size: 447.1 GiB (100.00%)
used: 209.14 GiB (46.8%) fs: btrfs dev: /dev/sdb1 maj-min: 8:17
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 23.51 GiB used: 5.5 MiB (0.0%)
priority: 100 dev: /dev/zram0
Sensors:
System Temperatures: cpu: 8.3 C mobo: N/A gpu: nvidia temp: 48 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 30%
Info:
Processes: 359 Uptime: 2h 20m wakeups: 0 Memory: 23.51 GiB
used: 4.99 GiB (21.2%) Init: systemd v: 250 tool: systemctl Compilers:
gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1577 lib: 393 Shell: nu
running-in: yakuake inxi: 3.3.14
Garuda (2.5.6-2):
System install date:     2021-11-09
Last full system update: 2022-03-31
Is partially upgraded:   No
Relevant software:       NetworkManager
Windows dual boot:       no
Snapshots:               Timeshift (maybe)
Failed units:            bluetooth-autoconnect.service grafana.service nebula.service zfs-auto-mount.service

Trying to build a virtual machine. Following the arch wiki, I:

$ sudo pacman -Syu libvirt  qemu bridge-utils virt-viewer virt-manager --needed  
$ sudo usermod -aG libvirt (id -u)
$ sudo systemctl enable libvirtd
$ sudo reboot

rebooted


$ sudo systemctl enable --now virtstoraged
$ sudo pacman -Syu iptables-nft dnsmasq dmidecode --needed
$ virsh net-list --all
$ virsh net-start default
$ sudo systemctl enable --now virtnetworkd
$ sudo virsh net-start default
$ sudo virsh net-autostart default

This is condensing running into a few errors and resolving them. Why did I need to manually enable virstoraged and virtnetworkd, when that’s not mentioned in the Arch wiki? Shouldn’t that get enabled with libvirtd? Is this something specific to Garuda?

Regardless, after running these commands, then starting virt-manager, walking through a typical install (resulting in this configuration), I click finish, and receive this error:

Unable to complete install: ‘Unable to read from ‘/sys/fs/cgroup/machine.slice/machine-qemu\x2d2\x2dnixos\x2dunstable.scope/libvirt/cgroup.controllers’: No such file or directory’
:arrow_forward: details

    Unable to complete install: 'Unable to read from '/sys/fs/cgroup/machine.slice/machine-qemu\x2d2\x2dnixos\x2dunstable.scope/libvirt/cgroup.controllers': 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/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.10/site-packages/libvirt.py", line 4400, in createXML
        raise libvirtError('virDomainCreateXML() failed')
    libvirt.libvirtError: Unable to read from '/sys/fs/cgroup/machine.slice/machine-qemu\x2d2\x2dnixos\x2dunstable.scope/libvirt/cgroup.controllers': No such file or directory

Damn, I got blind in PrivateBin :wink:

2 Likes

Tried under Linux LTS, same error. For replicability, I tried it this time with virt-install. I tried pasting the command and results but i'm getting a cloudflare 403 forbidden error when I try to do that

Trying again to paste the command ok, that worked

sudo virt-install --name nixos-test \
    --memory 4096 \
    --vcpus=4,maxvcpus=4 \
    --cpu host \
    --cdrom ./Downloads/nixos-minimal-21.11.336755.efea022d6fe-x86_64-linux.iso \
    --disk /var/lib/libvirt/images/nixos-unstable.qcow2 \
    --network default \
    --virt-type kvm

Trying again to post the output ok, that worked


Starting install...
ERROR    Unable to read from '/sys/fs/cgroup/machine.slice/machine-qemu\x2d1\x2dnixos\x2dtest.scope/libvirt/cgroup.controllers': No such file or directory

apparently using the u n a m e command triggers cloudflare somehow

...and same results under the default kernel (5.17.1-arch1-1)

...what's the deal?

Possibly related:

https://old.reddit.com/r/archlinux/comments/ovcqmm/libvirtd_virtmanager_cannot_create_new_virtual/

3 Likes

I'm not on my desktop, but I believe when I had the cgroup error I passed a kernel option for systemd.unified_cgroup_hierarchy=0 or something. I dont believe I had to add this to all my installations so I dont know if it's truly necessary or was just a workaround for a symptom instead of a complete solution.

EDIT: Looks like that's in the link that scott posted, too.

1 Like

That did it. Sorry, I no read good :woozy_face:.

for others who might not read good either

$ if grep -q systemd.unified_cgroup_hierarchy=1 /etc/default/grub; then
...   sudo sed -i 's/systemd.unified_cgroup_hierarchy=1/systemd.unified_cgroup_hierarchy=0/' /etc/default/grub
...   sudo update grub
...   sudo reboot
... else
...   echo "this won't help you"
... fi

Is it something garuda-specific which requires these extra steps, or should arch wiki be updated?

  1. enable virtstoraged
  2. enable virtnetworkd
  3. set systemd.unified_cgroup_hierarchy=0 in /etc/default/grub
1 Like

My Manjaro and EndeavourOS boot parameters dont include that kernel option, just my Garuda installation. They all have virt manager working, only Garuda I had to make that change. I assumed it was because of a configuration on using a new cgroup feature that isn't supported by virt-manager yet.

I believe numerous distros are using version 2 of cgroups now. I identified this in October of last year as a fix for this issue.

You really shouldn’t need to run a script to correct this, as it is a simple matter of changing a “1” to “0” in the grub configuration file.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.