User Tools

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
gentoo:kvm-qemu [2026/03/24 08:36] willygentoo:kvm-qemu [2026/03/24 10:43] (current) – [Kernel and required packages] willy
Line 15: Line 15:
 Now, as for packages, you will want the VirtManager GUI and the QEMU package, so install the following: Now, as for packages, you will want the VirtManager GUI and the QEMU package, so install the following:
 <code bash> <code bash>
-emerge app-emulation/libvirt app-emulation/virt-manager qemu -vp+emerge net-misc/bridge-utils app-emulation/libvirt app-emulation/virt-manager qemu -vp
 </code> </code>
  
-===== ... =====+And make sure your libvirtd has proper access configuration for the sockets: 
 +**/etc/libvirt/libvirtd.conf**: 
 +<code> 
 +unix_sock_group "libvirt" 
 +unix_sock_rw_perms "0770" 
 +</code>
  
-add your users to groups **kvm**, **qemu** and **libvirt**.+===== Networking configuration =====
  
-<code bash> +If you want to use **bridged** networking, which means assign local LAN IP to your virtual machines, you need to convert your LAN interfaces to bridged. 
-gpasswd -a <tuo_utente> libvirt + 
-gpasswd -a <tuo_utentekvm +This means, given the following example (in /etc/conf.d/net): 
-rc-update add libvirt-guests +<code
-rc-update add libvirtd+config_eno1="10.0.0.50/24" 
 +route_eno1="default via 10.0.0.1"
 </code> </code>
  
-**/etc/libvirt/libvirtd.conf**:+To this:
 <code> <code>
-unix_sock_group = "libvirt+bridge_br0="eno1
-unix_sock_rw_perms = "0770"+config_br0="10.0.0.50/24" 
 +route_br0="default via 10.0.0.1" 
 + 
 +config_eno1="null"
 </code> </code>
  
-===== Networking =====+And add the required init links: 
 +<code bash> 
 +cd /etc/init.d 
 +ln -s net.lo net.br0 
 +rc-update add net.br0 default 
 +rc-update del net.eno1 default 
 +./net.eno1 stop 
 +./net.br0 start 
 +</code>
  
-bridge_br0="eno2" 
-config_br0="10.0.0.50/25" 
  
-bridge_br1="enp1s0" +===== Users configuration =====
-config_br1="10.10.0.50/24"+
  
-  547  ln -s net.lo net.br0 +add your users to groups **kvm**, **qemu** and **libvirt**
-  548  ln -s net.lo net.br1 + 
-  549  ./net.br0 restart +<code bash> 
-  550  ./net.br1 restart +gpasswd -a user libvirt 
-  551  rc-update add net.br0 default +gpasswd -a user kvm 
-  552  rc-update add net.br1 default+gpasswd -a user qemu 
 +rc-update add libvirt-guests 
 +rc-update add libvirtd 
 +/etc/init.d/libvirtd start 
 +/etc/init.d/libvirt-guests start 
 +</code>