Package Configuration

Necessary changes to config files to use Virt-Manager via User.

Adding yourself to the libvirt group allows for password-less root both from the host and guest. If you are uncomfortable with that and want to avoid this, consider using Polkit instead which will prompt you for your password. While this is safe for our use case, be aware of what you’re doing when following guides online.

Modifying Files

There are two files we must edit. Please make the changes accordingly. Not too much to say, follow this step-by-step and you’ll be fine along with getting logs printed.

libvirtd.conf

Use your favorite text editor to make the following changes to:

/etc/libvirt/libvirtd.conf

Read/Write permissions and Group - Uncomment the following lines.

unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"

Logging - Add to the very bottom.

log_filters="3:qemu 1:libvirt"
log_outputs="2:file:/var/log/libvirt/libvirtd.log"

If your distribution uses AppArmor, or SELinux do not forget to change the following line to disable them for Libvirt. Mostly an issue on Debian based systems. Skip if you don’t know.

Security Driver - As a last resort it is possible to disable security protection libvirt wide.

# security_driver = [ "selinux", "apparmor" ]
security_driver = "none"

qemu.conf

Use your favorite text editor to make the following changes:

/etc/libvirt/qemu.conf

Read/Write permissions and Group - Uncomment and Edit the following lines to your username.

user = "root"
group = "root"

Example properly modified snippet:

user = "royalgraphx"
group = "royalgraphx"

Libvirtd Services

You now need to add your user to the kvm and libvirt groups, to allow libvirt to write files properly:

sudo usermod -a -G kvm,libvirt $(whoami)

Now enable and start the libvirtd Service to fully apply changes:

sudo systemctl enable --now libvirtd

You can now continue to the next page.


DarwinKVM Docs Version 2.0.0~prerelease
Copyright © 2024 RoyalGraphX. Distributed by a BSD 3-Clause License.
Last Modified: Sat, 7 Sep 2024 18:00:00 CDT