Skip to content

Instantly share code, notes, and snippets.

@mirkobrombin
Last active December 16, 2025 14:34
Show Gist options
  • Select an option

  • Save mirkobrombin/5c2745b54dd16b603d54dc72c341aa4b to your computer and use it in GitHub Desktop.

Select an option

Save mirkobrombin/5c2745b54dd16b603d54dc72c341aa4b to your computer and use it in GitHub Desktop.
Running virt-manager on Vanilla OS via Distrobox
DBX_SUDO_PROGRAM=pkexec /usr/share/apx/distrobox/distrobox create \
--pull \
--root \
--init \
--unshare-all \
--image ghcr.io/vanilla-os/pico:main \
--name libvirtd \
--additional-flags "-p 2222:22" \
--init-hooks "apt update && apt install -y openssh-server libvirt-daemon-system libvirt-clients qemu-system qemu-utils virt-manager && systemctl enable ssh.service && systemctl enable libvirtd && usermod -aG libvirt $USER"
DBX_SUDO_PROGRAM=pkexec /usr/share/apx/distrobox/distrobox-enter --root libvirtd -- distrobox-export --app virt-manager
@mirkobrombin
Copy link
Author

@Techwizz-somboo
Copy link

Techwizz-somboo commented Apr 13, 2025

This works great for those on OpenSUSE Aeon/Kalpa too (formerly MicroOS Desktop)

Modify the paths to distrobox then you're golden

DBX_SUDO_PROGRAM=pkexec /usr/bin/distrobox create \
	--pull \
	--root \
	--init \
	--unshare-all \
	--image ghcr.io/vanilla-os/pico:main \
	--name libvirtd \
	--additional-flags "-p 2222:22" \
  	--init-hooks "apt update && apt install -y openssh-server libvirt-daemon-system libvirt-clients qemu-system qemu-utils virt-manager && systemctl enable ssh.service && systemctl enable libvirtd && usermod -aG libvirt $USER"

DBX_SUDO_PROGRAM=pkexec /usr/bin/distrobox-enter --root libvirtd -- distrobox-export --app virt-manager

I'd suggest using the vanilla-os image used here if you want usb redirection to work. I was unable to get that part working in a root tumbleweed distrobox, although I'm sure it's possible. But just follow the instructions @mirkobrombin listed in the above post.

@mirkobrombin
Copy link
Author

I think for openSUSE pkexec is not necessary 🤔

@Techwizz-somboo
Copy link

I think for openSUSE pkexec is not necessary 🤔

You're right but distrobox will still prompt for root password via sudo anyway (since it's a root distrobox), so either works really.

@mirkobrombin
Copy link
Author

Makes sense.

@lux70
Copy link

lux70 commented Dec 14, 2025

@mirkobrombin

Ciao Marco

I have a question. I'm on Kalpa Desktop. To have USB passthrough, does Libvirtd need to be running on the host system as well as in the distrobox container? And with the appropriate udev rules?

and... What if I want to use spice with virt-manager?

Ciao e grazie

@mirkobrombin
Copy link
Author

@mirkobrombin

Ciao Marco

I have a question. I'm on Kalpa Desktop. To have USB passthrough, does Libvirtd need to be running on the host system as well as in the distrobox container? And with the appropriate udev rules?

and... What if I want to use spice with virt-manager?

Ciao e grazie

Ciao, no, libvirtd runs in the container, you just need the trick I linked here https://gist.github.com/mirkobrombin/5c2745b54dd16b603d54dc72c341aa4b?permalink_comment_id=5091641#gistcomment-5091641

@lux70
Copy link

lux70 commented Dec 15, 2025

@mirkobrombin
Ciao Marco
I have a question. I'm on Kalpa Desktop. To have USB passthrough, does Libvirtd need to be running on the host system as well as in the distrobox container? And with the appropriate udev rules?
and... What if I want to use spice with virt-manager?
Ciao e grazie

Ciao, no, libvirtd runs in the container, you just need the trick I linked here https://gist.github.com/mirkobrombin/5c2745b54dd16b603d54dc72c341aa4b?permalink_comment_id=5091641#gistcomment-5091641

Ciao Marco
I tried to follow the guide and the recommended trick, but there are some problems. I am attaching some photos.
Although some USB devices are recognised ( foto1 ), others are not. For example, USB sticks (foto2). There are permission errors (foto3). I also tried adding the user to plugdev kvm libvirt users, without success.
Do you have any suggestions?

Ciao

foto1 foto2 foto3

@mirkobrombin
Copy link
Author

Sadly I have no idea. @89luca89 any idea?

@lux70
Copy link

lux70 commented Dec 16, 2025

Sadly I have no idea. @89luca89 any idea?

Could it be a SELinux issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment