[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:emulators:libvirt_config_methods [2022/02/19 01:00 (UTC)] – [Libvirt config, settings and method for Slackware] zeebrahowtos:emulators:libvirt_config_methods [2023/12/01 12:04 (UTC)] (current) – [Libvirt config, settings and method for Slackware] zeebra
Line 44: Line 44:
   *run qemu:session   *run qemu:session
   *start libvirt daemons as root   *start libvirt daemons as root
-  *start libvirt daemons and user +  *start libvirt daemons as user 
   *to use qemu/kvm through virt-manager in all the above ways   *to use qemu/kvm through virt-manager in all the above ways
 Personally I only really care about running qemu:session through virt-manager and that's it. But that might not work for others due to networking needs (ex.qemu-vm-server). And if it's a multi user machine it's not a good idea to grant admin rights to everyone in the libvirt group. Some also might not want to give RW rights to kvm. There are many things to consider. Below are some. Personally I only really care about running qemu:session through virt-manager and that's it. But that might not work for others due to networking needs (ex.qemu-vm-server). And if it's a multi user machine it's not a good idea to grant admin rights to everyone in the libvirt group. Some also might not want to give RW rights to kvm. There are many things to consider. Below are some.
  
-=== libvirt.conf === +=== libvirtd.conf === 
-go to the libvirt config file and uncomment the relevant options and set them correctly.+go to the libvirt config file and uncomment the relevant options and set them as you prefer.
 <code> <code>
 nano /usr/local/etc/libvirt/libvirtd.conf nano /usr/local/etc/libvirt/libvirtd.conf
Line 101: Line 101:
  
 The most common way to run the daemons with kvm/qemu and virt-manager is to run the daemons (on boot) as root and connect to them as user (through libvirt group) and set up a qemu:session. To do that you also need the abovementioned kvm group and settings. The most common way to run the daemons with kvm/qemu and virt-manager is to run the daemons (on boot) as root and connect to them as user (through libvirt group) and set up a qemu:session. To do that you also need the abovementioned kvm group and settings.
 +
 +=== /dev/dri ===
 +
 +The same that applies to kvm also applies to video cards. To solve this, you ONLY need to add the "video" group to your user, if that's the solution you want and think it is a good idea.
 +<code>usermod -aG video username</code>
 +You need to log out of X/wayland and tty, and back in, with your user for this change to take effect.
  
 === /etc/rc.d === === /etc/rc.d ===
  
-Content will be added here+To start libvirtd and virtlogd on boot (as root), you can add them to /etc/rc.d/rc.local: 
 +<code> 
 +/usr/local/sbin/libvirtd -d 
 +/usr/local/sbin/virtlogd -d 
 +</code>
  
 === udev === === udev ===
  
-Content will be added here+To change /dev/kvm group and permissions on boot, add a file /etc/udev/rules.d/90-kvm-override.rules and add the following content:\\ 
 +<code> 
 +# /etc/udev/rules.d/90-kvm-override.rules 
 +
 +# Udev rule to override kvm group and permissions: 
 +# To allow kvm group read/write access to /dev/kvm 
 +#
  
 +# Set kvm device writable by kvm group
 +KERNEL=="kvm", GROUP:="kvm", MODE:="0660"
 +</code>
 +
 +Once you reboot you can verify the changes:
 +<code>
 +ls -la /dev/kvm
 +crw-rw---- root kvm
 +</code>
 === Appendage === === Appendage ===
  
Line 120: Line 145:
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtos template}}+{{tag>howtos, emulators, qemu, libvirt, kvm, virt-manager}}
 howtos:emulators:libvirt_config_methods ()