Proposed HowTo: Use virtual machines on Atomic Desktops with virt-manager

If you want to run virtual machines on Atomic Desktops, there are multiple options.

GNOME Boxes

This uses libvirt and always the “qemu user session”, which may be preferred for security reasons.

GNOME Boxes can run as a Flatpak which makes it very easy to install.

It is easy to setup machines for a lot of distributions and also Windows, but the available settings might not be enough for you.

virt-manager layered

“Virtual Machine Manager” is a userfriendly and powerful application for creating and using virtual machines. It allows a wide range of options, while having good defaults that dont require to use them.

To layer all components necessary, you can use this command

rpm-ostree install \
libvirt-daemon-driver-network \
libvirt-daemon-driver-nodedev \
libvirt-daemon-driver-qemu \
libvirt-daemon-driver-storage-core \
qemu-audio-spice \
qemu-char-spice \
qemu-device-display-qxl \
qemu-device-display-virtio-gpu \
qemu-device-display-virtio-vga \
qemu-device-usb-redirect \
qemu-system-x86-core

Then reboot, and after rebooting enable these 2 services:

pkexec sh -c '
systemctl --now enable virtnetworkd.service
systemctl --now enable virtqemud.service
'

Credit to @vgaetera

NOTE
These packages will allow you to run x86_64 / amd64 VMs on a x86_64 machine, which is most PCs and Laptops out there.
If you want to emulate other architectures, or run VMs on other architectures, you may need different packages.
This means on Apple M-series Laptops, Snapdragon Laptops, Pinebooks, some Chromebooks, most Phones and Tablets, PC mainboards, RaspberryPi and other SBCs, using arm64, or RISC-V.

QEMU guest session

The guest session is more secure as it avoids running the hypervisor as root. It is also easy to setup, as you don’t need to do any changes from now on.

Open virt-manager, you are prompted for a password. You need to enter it once, to be able to remove the system session.

In virt-manager you see a “Qemu system connection”, delete that with right-click.

Now in the top left corner menu, create a new QEMU session and choose “user session”.

This will never require a password, install the VM images in your home directory.

QEMU system session

If you are certain that you need features not possible with the user session, you can use this.

You can either always enter your sudo password on startup, or add your user to the libvirt group.

sudo groupadd libvirt
sudo usermod -aG libvirt $USER

On Atomic Desktops, another step is needed, Source by @walters:

sudo grep -E '^libvirt:' /usr/lib/group >> /etc/group

This will fix the missing entry in /etc/group and make this work.

Now you can use virt-manager in it’s normal configuration (with the qemu system session) or, if you had deleted it, add a new system session following the steps above under “QEMU user session”.

virt-manager without layering

You can use virt-manager, qemu and libvirt without layering. But these methods are more complicated.

rootful distrobox

Distrobox has a guide on how to use 2 containers, a rootful one for libvirt, and a normal one for the virt-manager client. They connect over local ssh.

This is tested and works, but has the disadvantage of requiring a rootful container, which needs to be kept updated.

systemd sysextensions

These are methods of adding packages to your system without layering.

It is still pretty experimental, a few configurations can be found here, made by @siosm


More Docs

Docs on virtualization which only target dnf.

Use libvirt as a non-root user

1 Like

Added atomic-desktops, kinoite, rpm-ostree, silverblue

Have you testd the Flatpack of virt-manager. You not will get everithing when you install it this way?

8 posts were split to a new topic: Virt-Manager as Flatpack | errors

Didnt know this! As I dont use Fedora Flatpaks.

There are quite some Fedora Flatpaks that are not there on Flathub.

This could be really cool, for Flathub-only users it will add an unnecessary runtime poorly. But I will try it.

I do not understand why making computing more complicated as it is. The fedora Flatpacks are active when you activate Flatpacks.

Fedora uses toolbox. If you want propose a wiki, please use the fedora tools!

Fedora Flatpaks are preinstalled on Atomic Desktops. Simply I have replaced them with Flathub Flatpaks, runtimes and repo, as they dont have codec issues, more apps and official apps.

This is not relevant for this howto so I will try this.

Distrobox is in the Fedora repos. Layering it us just as relevant as layering virt-manager. Many people gave up on improving toolbx it seems, distrobox is the more user-friendly tool. I can’t change that though.

If you know a method to run a rootful toolbx or almalinux+libvirt podman container easily, feel free to share it.

Please focus on Fedora Tools … we are the fedora Community. Alma has a own discourse instance, this belongs there and not here. You can link it, but please use their resources!

That was just the distrobox guide. The idea is to reduce updated of the additional rootful podman container / distrobox.

You could of course also use fedora in there.

And this has nothing to do with my question / request.

distrobox is packaged in the Fedora repos so it is a Fedora tool.

Added gnome-boxes

Yes and Yes.

I did not need to do this on f41 silverblue, I did reboot after doing the group steps. Not sure if that makes a difference.

1 Like

The PR in the original post (back when only Fedora devs used this platform, lol) was closed.

Might well be that this issue is fixed and the workaround does nothing.

Could do a cat x | grep y || run the sed thing to only the command when needed