OpenSUSE Leap 42: Install KVM for virtualization

This article will describe installing KVM.

1 Install KVM

Install packages for KVM.

> sudo zypper -n in patterns-openSUSE-kvm_server
> sudo systemctl enable libvirtd
> sudo systemctl restart libvirtd

The user in libvirt group can run virt-manager without sudo.

> sudo gpasswd -a "${USER}" libvirt

2 VNC port

Allow VNC port with using vnc-server.xml so that other machine can access virtual machine.

> for t in FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_DMZ FW_CONFIGURATIONS_INT; do
  sudo sed -e "s/^${t}=\"\(.*\)\"/${t}=\"\1 vnc-server\"/g" \
       -i /etc/sysconfig/SuSEfirewall2
done
> sudo systemctl restart SuSEfirewall2

3 Enable kvm_intel nested

If Enable kvm_intel nested, you can create nested virtual machine on virtual machine.

> echo "options kvm_intel nested=1" | \
  sudo tee -a /etc/modprobe.d/99-local.conf
> sudo reboot

4 Run virt-manager

You can manage virtual machines via GUI with virt-manager. For managing virtual machines via CUI, use virsh and virt-install.

> virt-manager

0001_virt-manager.png