Ubuntu 17.10: Install KVM for virtualization


Table of Contents

1 Install qemu-kvm and libvirt

Install qemu-kvm package and some packages for virtual machine operation.

$ sudo apt install -y qemu-kvm libvirt0 libvirt-bin virt-manager bridge-utils

Register libvirt-bin to systemd.

$ sudo systemctl enable libvirt-bin

2 Bridge interface

The bridge interface is needed for accessing virtual machine via network from other machine.

$ sudo apt install -y bridge-utils$ cat <<EOF | sudo tee /etc/network/interfacesauto loiface lo inet loopbackauto br0iface br0 inet dhcp bridge_ports ens3 bridge_stp off bridge_maxwait 0EOF$ sudo reboot

3 libvirt group

The user in libvirt group can run libvirt command without sudo.

$ sudo gpasswd libvirt -a <username>$ sudo reboot

Android | Linux | SDL - Narrow Escape