Setting up KVM on my dev system

Have a AMD Desktop with 1950X processor (16 core / 32 threads) with 64 GB RAM, with 9 1G interfaces and 2 x 1 TB HDD for storage apart from 250GB SSD for OS and host installation.  Wanted to have VMs with dedicated NICs and dedicated physical partitions on the disk allocated to the VMs.

Installed Debian 9.8.x using netinst – intentional – wanted to have only the bare minimum required files to be installed.  Did not want NetworkManager like services to be installed.

Post installation first thing I do always is to update the upgrade the packages :

apt update
apt dist-upgrade

Wanted xserver to be available

apt install xorg

Had installed additional cards requiring realtek drivers.  Updated /etc/apt/sources.list by adding ‘contrib non-free’ as required for firmware packages.

apt install firmware-realtek
apt install nvidia-driver

Checked if nvidia driver is used

hwinfo --gfxcard

It was not, but got suggestion to have it activated with modprobe – did the same.

modprobe nvidia_current

Verified that nvidia driver is active

hwinfo --gfxcard

Installed minimal required packages for KVM

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

Rebooted the system.

Edited and updated the contents of /etc/network/interfaces (For one physical interface bridged to br0 interface)

auto enp5s0
iface enp5s0 inet manual

auto br0
iface br0 inet static
        bridge_ports enp5s0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

Rebooted the system.

Added ‘root’ (user account that would be accessing the virt-manager) to libvirt group.

gpasswd libvirt -a root

Copied the downloaded Debian (required guest OS) iso image to /var/lib/libvirt/images folder

Changed the ownership information for iso images

chown libvirt-qemu:libvirt /var/lib/libvirt/images/*

Started the virt-manager, selected File->New Virtual Machine and performed the following actions

Clicked on Browse and selected the image and continue with “Choose Volume”

Note : Wanted dedicated physcial partition. Did not select Manage and directly typed the partition information.

Note : As had decided to allocate dedicated NIC, selected appropriate macvtap option.

Completed all installation steps.

Once the installation was over and VM started – Manually shut down the same to update the boot options in virt-manager.

After shutting down, Selected View->Details from Menu.

Updated the boot options as follows

After applying the changes.

That’s it now after starting the host, the VMs are started and are ready for accessing them.

About sandeep

Passionate about sharing information on "how to".
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.