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
'
NOTE
These packages will allow you to runx86_64
/amd64
VMs on ax86_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, usingarm64
, orRISC-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.