Skip to content

Instantly share code, notes, and snippets.

@RLovelett
Last active March 8, 2023 01:53
Show Gist options
  • Save RLovelett/4a2fcaff2384826358f81ad16add49e3 to your computer and use it in GitHub Desktop.
Save RLovelett/4a2fcaff2384826358f81ad16add49e3 to your computer and use it in GitHub Desktop.
Setup libvirtd on Fedora Server 28

libvirtd Fedora 28

System Packages

$ dnf install -y \
    libvirt \
    libvirt-python \
    libguestfs-tools \
    qemu-kvm \
    virt-install

Enable libvirt

$ systemctl enable libvirtd
$ systemctl start libvirtd

PolicyKit

$ cat > /etc/polkit-1/rules.d/80-libvirt-manage.rules <<EOF
polkit.addRule(function(action, subject) {
  if (action.id == "org.libvirt.unix.manage" && subject.local && subject.active && subject.isInGroup("wheel")) {
      return polkit.Result.YES;
  }
});
EOF

Firewall

$ firewall-cmd --zone=trusted --change-interface=br0 --permanent
$ firewall-cmd --add-port=5900/tcp --permanent
$ firewall-cmd --reload
$ firewall-cmd --zone=FedoraServer --list-ports

User

$ usermod --append --groups libvirt `whoami`

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment