Skip to content

Instantly share code, notes, and snippets.

@j-griffith
Created February 4, 2020 16:19
Show Gist options
  • Save j-griffith/63bbbaee5b3f814eb7efca1631913f16 to your computer and use it in GitHub Desktop.
Save j-griffith/63bbbaee5b3f814eb7efca1631913f16 to your computer and use it in GitHub Desktop.
#!/bin/bash
DNF=$(which dnf)
APT=$(which apt)
if [[ ! -z $APT ]]; then
sudo apt update -y
sudo apt install -y \
qemu-kvm \
libvirt-clients \
libvirt-daemon-system \
libguestfs-tools \
elif [[ ! -z $DNF ]]; then
sudo dnf update -y
sudo dnf group install -y virtualization
else
echo "unsupported package manager"
exit 1;
fi
sudo gpasswd -a "${USER}" libvirt
sudo modprobe -r kvm_intel
sudo modprobe kvm_intel nested=1
# Don't need both of these on all systems, but meh... doesn't hurt either
echo "options kvm_intel nested=1" | \
sudo tee /etc/modprobe.d/kvm.conf
echo "options kvm_intel nested=1" | \
sudo tee /etc/modprobe.d/qemu-system-x86.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment