Using an immutable distribution

If you are on an immutable distribution (Silverblue/Kionite, MicroOS) chances are that installing lots and lots of packages on the base system is not advisable.

One way is to use a distrobox for them.

Prepare the container

To run libvirt/qemu/kvm we need a systemd container and we need a rootful container to be able to use it, see this tip to have a list of compatible images. We will use in this example OpenSUSE’s dedicated distrobox image:

Assembly file:

# Basic utilities for terminal use
init_hooks="zypper in -y --no-recommends openssh-server patterns-server-kvm_server patterns-server-kvm_tools qemu-arm qemu-ppc qemu-s390x qemu-extra qemu-linux-user"
init_hooks="systemctl enable sshd.service"
init_hooks="systemctl enable virtqemud.socket virtnetworkd.socket virtstoraged.socket virtnodedevd.socket"
# Add the default user to the libvirt group
init_hooks="usermod -aG libvirt ${USER}"
# Expose container ssh on host
additional_flags="-p 2222:22"
# Export virt-manager

Alternatively, command line:

distrobox create --pull --root --init --unshare-all --image --name libvirtd --additional-flags "-p 2222:22" \
  --init-hooks "zypper in -y --no-recommends openssh-server patterns-server-kvm_server patterns-server-kvm_tools qemu-arm qemu-ppc qemu-s390x qemu-extra qemu-linux-user && systemctl enable sshd.service && systemctl enable virtqemud.socket virtnetworkd.socket virtstoraged.socket virtnodedevd.socket && usermod -aG libvirt $USER"

distrobox-enter --root libvirtd -- distrobox-export --app virt-manager

Launch from the container

Simply select the Virt Manager (on libvirt) entry in your menu, entry your root password and you’re done!

image image image

Connect via SSH

You can alternatively connect from an existing VirtManager

Now you will need to Add a connection:


Then set it like this:

Screenshot from 2024-02-19 19-50-04

Optionally you can set it to autoconnect.

Now you can simply double click the connection to activate it, you’ll be prompted with your password, insert the same password as the host:


And you should be good to go!