Libvirt qemu hooks not working

Hi garuda community

I'm encountering a problem with libvirt hooks. When I run my VM, the qemu hooks I config are not called at start and stop of VM.

About the VM :

  • It runs on w10
  • Use GPU, NVME and TPM passthrough
  • Pass sound to host via pipewire
  • Pass mouse and keyboard via Evdev

What I do :

  • create /etc/libvirt/hooks folder
  • download a common script that let you split config in different folder : Qemu Script - Pastebin.com
  • correctly put my programs in folder that follow this structure :
/etc/libvirt/hooks/
β”‚   qemu
└───qemu.d/win10/
    └───release/end/
    β”‚   β””   monitor.sh
    └───started/begin/
        β”‚   carla.sh
        β””   monitor.sh
  • restart deamon and pc
  • try without this script
  • put all scripts the execute permission to all users

Output of Garuda Inxi : garuda-inxi - Pastebin.com
Log of my libvirt VM : win10

System:

Kernel: 6.1.5-zen2-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0

parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen

root=UUID=586673e3-ddbc-449a-a85d-3e384596dd60 rw [email protected]

vfio-pci.ids=10de:2216,10de:1eaf,1bb1:5016 module_blacklist=nouveau quiet

quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3

ibt=off

Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock

wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux

Machine:

Type: Desktop Mobo: ASUSTeK model: ROG STRIX X570-F GAMING v: Rev X.0x

serial: <superuser required> UEFI: American Megatrends v: 4002

date: 06/15/2021

CPU:

Info: model: AMD Ryzen 5 3600X bits: 64 type: MT MCP arch: Zen 2 gen: 3

level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)

family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701021

Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:

L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB

L3: 32 MiB desc: 2x16 MiB

Speed (MHz): avg: 4200 high: 4206 min/max: 2200/4200 boost: enabled

scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 4202 2: 4199

3: 4206 4: 4205 5: 4200 6: 4200 7: 4200 8: 4200 9: 4197 10: 4200 11: 4200

12: 4200 bogomips: 100806

Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm

Vulnerabilities: <filter>

Graphics:

Device-1: AMD Hawaii PRO [Radeon R9 290/390] driver: radeon v: kernel

alternate: amdgpu arch: GCN-2 code: Sea Islands process: GF/TSMC 16-28nm

built: 2013-17 pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max: lanes: 16

ports: active: DP-1,HDMI-A-1 empty: DVI-D-1,DVI-D-2 bus-ID: 08:00.0

chip-ID: 1002:67b1 class-ID: 0300 temp: 65.0 C

Device-2: NVIDIA GA102 [GeForce RTX 3080 Lite Hash Rate] vendor: ASUSTeK

driver: vfio-pci v: N/A alternate: nouveau non-free: 525.xx+

status: current (as of 2022-12) arch: Ampere code: GAxxx

process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 8

link-max: lanes: 16 bus-ID: 09:00.0 chip-ID: 10de:2216 class-ID: 0300

Display: x11 server: X.Org v: 21.1.6 with: Xwayland v: 22.1.7

compositor: kwin_x11 driver: X: loaded: radeon unloaded: modesetting

alternate: fbdev,vesa dri: radeonsi gpu: radeon display-ID: :0 screens: 1

Screen-1: 0 s-res: 4480x1440 s-dpi: 96 s-size: 1185x381mm (46.65x15.00")

s-diag: 1245mm (49.01")

Monitor-1: DP-1 mapped: DisplayPort-0 pos: primary,left model: Acer XF240H

serial: <filter> built: 2017 res: 1920x1080 dpi: 92 gamma: 1.2

size: 531x299mm (20.91x11.77") diag: 609mm (24") ratio: 16:9 modes:

max: 1920x1080 min: 720x400

Monitor-2: HDMI-A-1 mapped: HDMI-0 pos: right model: Acer XB271HU A

serial: <filter> built: 2018 res: 2560x1440 hz: 60 dpi: 109 gamma: 1.2

size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:

max: 2560x1440 min: 640x480

API: OpenGL v: 4.5 Mesa 22.3.3 renderer: HAWAII ( LLVM 14.0.6 DRM 2.50

6.1.5-zen2-1-zen) direct render: Yes

Audio:

Device-1: AMD Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X]

driver: snd_hda_intel v: kernel pcie: bus-ID: 5-3.1:5 chip-ID: 0a12:123d

gen: 3 speed: 8 GT/s class-ID: 0300 serial: <filter> lanes: 8 link-max:

lanes: 16 bus-ID: 08:00.1 chip-ID: 1002:aac8 class-ID: 0403

Device-2: NVIDIA GA102 High Definition Audio vendor: ASUSTeK

driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 8

link-max: lanes: 16 bus-ID: 09:00.1 chip-ID: 10de:1aef class-ID: 0403

Device-3: AMD Starship/Matisse HD Audio vendor: ASUSTeK

driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16

bus-ID: 0b:00.4 chip-ID: 1022:1487 class-ID: 0403

Device-4: Cambridge Silicon Radio eppfun AK3040 type: USB

driver: hid-generic,snd-usb-audio,usbhid

Sound API: ALSA v: k6.1.5-zen2-1-zen running: yes

Sound Server-1: PulseAudio v: 16.1 running: no

Sound Server-2: PipeWire v: 0.3.64 running: yes

Network:

Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel

pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 04:00.0

chip-ID: 8086:1539 class-ID: 0200

IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>

IF-ID-1: br0 state: down mac: <filter>

IF-ID-2: virbr0 state: down mac: <filter>

Drives:

Local Storage: total: 2.5 TiB used: 72.29 GiB (2.8%)

SMART Message: Unable to run smartctl. Root privileges required.

ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 250GB

size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s

type: SSD serial: <filter> rev: 3B6Q scheme: GPT

ID-2: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 500GB

size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s

type: SSD serial: <filter> rev: 4B6Q scheme: GPT

ID-3: /dev/sdc maj-min: 8:32 vendor: Toshiba model: HDWD120 size: 1.82 TiB

block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD

rpm: 7200 serial: <filter> rev: ACF0 scheme: MBR

Partition:

ID-1: / raw-size: 232.59 GiB size: 232.59 GiB (100.00%)

used: 72.23 GiB (31.1%) fs: btrfs dev: /dev/sda2 maj-min: 8:2

ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)

used: 608 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1

ID-3: /home raw-size: 232.59 GiB size: 232.59 GiB (100.00%)

used: 72.23 GiB (31.1%) fs: btrfs dev: /dev/sda2 maj-min: 8:2

ID-4: /var/log raw-size: 232.59 GiB size: 232.59 GiB (100.00%)

used: 72.23 GiB (31.1%) fs: btrfs dev: /dev/sda2 maj-min: 8:2

ID-5: /var/tmp raw-size: 232.59 GiB size: 232.59 GiB (100.00%)

used: 72.23 GiB (31.1%) fs: btrfs dev: /dev/sda2 maj-min: 8:2

Swap:

Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)

ID-1: swap-1 type: zram size: 15.53 GiB used: 2.44 GiB (15.7%)

priority: 100 dev: /dev/zram0

Sensors:

System Temperatures: cpu: 39.0 C mobo: 38.0 C gpu: radeon temp: 65.0 C

Fan Speeds (RPM): N/A

Info:

Processes: 405 Uptime: 6h 31m wakeups: 0 Memory: 15.53 GiB

used: 4.2 GiB (27.0%) Init: systemd v: 252 default: graphical

tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: pm: pacman

pkgs: 1842 libs: 527 tools: octopi,paru Shell: fish v: 3.5.1 default: Bash

v: 5.1.16 running-in: konsole inxi: 3.3.24

Garuda (2.6.14-1):

System install date: 2022-10-22

Last full system update: 2023-01-14 ↻

Is partially upgraded: No

Relevant software: snapper NetworkManager mkinitcpio

Windows dual boot: Probably (Run as root to verify)

Failed units: NetworkManager-wait-online.service

BTW, its not Garuda-PasteBin :slight_smile: you can post it just here in forum, I edit it for you.

2 Likes