Fedora 26: 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 dnf install -y qemu-kvm virt-manager virt-install

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.

The vnc-server.xml allows only 4 ports. If you need more, please change 5903 to bigger value.

$ sudo cat /usr/lib/firewalld/services/vnc-server.xml<?xml version=”1.0″ encoding=”utf-8″?><service> <short>Virtual Network Computing Server (VNC)</short> <description>A VNC server provides an external accessible Xsession. Enable this option if you plan to provide a VNC server withdirect access. The access will be possible for displays :0 to :3. Ifyou plan to provide access with SSH, do not open this option and usethe via option of the VNC viewer.</description> <port protocol=”tcp” port=”5900-5903″/></service>

Allow VNC port.

$ sudo firewall-cmd –add-service=vnc-server –permanent$ sudo firewall-cmd –reload

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 /etc/modprobe.d/qemu-system-x86.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

Android | Linux | SDL - Narrow Escape