Install KVM in Debian 9

  1. Installing the KVM packages

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

  1. Reboot system

sudo reboot

  1. Add user to libvirt group so user can run commands

sudo gpasswd libvirt -a najibul

  1. Create ISO Directory
$ sudo mkdir /var/lib/libvirt/iso
$ sudo mv debian-9.0.0-amd64-netinst.iso /var/lib/libvirt/iso/
$ sudo chown libvirt-qemu:libvirt \

Note: Download Local SG/MY mirrors for different distro:

  1. Load kvm_intel module if not loaded already

modprobe kvm_intel

  1. Enable and start libvirtd deomon

systemctl enable --now libvirtd

Create Virtual Machine from CLI

Create a virtual machine named "centos-temp"

virt-install --name=centos-temp \
--vcpus=4 \
--memory=8192 \
--cdrom=/var/lib/libvirt/iso/CentOS-7-x86_64-Minimal-1708.iso \
--disk size=50 \

Connect to virt-manager Remotely

You can connect to virt-manager to create, delete, install etc. your VM using the GUI. The assumtion is that the KVM server is a remote machine.

  1. Make sure X11 forwarding is turned on in SSH config of the KVM node

    $ sudo grep X11Forwarding /etc/ssh/sshd_config
    X11Forwarding yes
  2. Connect to the KVM node via SSH

ssh -X username@kvm-node-ip

OR configure the KVM node IP/Host in your PC in ~/.ssh/config with the following parameter:

ForwardX11 yes

  1. Once logged use following command


The GUI window will appear.

Note: The above assumes you already have an X11 client like XQuartz installed on your Mac