Skip to main content

Setting up KVM

  1. Install libvirt Packages
    sudo pacman -S qemu libvirt ovmf ebtables bridge-utils openbsd-netcat virt-manager
    
  2. Add user to libvirt groups
    sudo usermod -aG libvirt $USER
    sudo usermod -aG kvm $USER
    sudo usermod -aG input $USER
    
  3. Start libvirtd daemon
    sudo systemctl enable --now libvirtd
    
  4. Create network bridge with nmcli
    nmcli connection add type bridge ifname br0 con-name "Netzwerkbrücke" stp no
    nmcli connection add type bridge-slave ifname enp39s0 con-name "Ethernet" master br0
    nmcli connection down "Kabelgebundene Verbindung 1"
    nmcli connection up "Netzwerkbrücke"
    
  5. Define bridge network XML file, e.g. as br0.xml
    <network>
      <name>br0</name>
      <forward mode='bridge'/>
      <bridge name='br0'/>
    </network>
    
  6. Add bridge network to virt-manager
    virsh -c qemu:///system net-define br0.xml
    virsh -c qemu:///system net-autostart br0