KVM installation

Hi,
The installation and configuration of the KVM was done well and it did not take long time.
I tested the installation of virtual machines in text mode and via virt-manager (GUI).
I had no problems during the process.

can you share the steps used so other forum members would have the chance to test this too?

Thank you for the feedback

Dear beszan,

Steps to follow

  1. How to Set Up a Network Bridge
  2. How to Install KVM
  3. How to Start KVM
  4. How to Create a VM
  5. How to Start Virt-Manager (GUI) through MobaXterm

Install KVM on Rocky Linux 8.

Software Requirements and Conventions Used

System Rocky Linux 8

Software KVM

How to Set Up a Network Bridge

Begin by creating a file at /etc/sysconfig/network-scripts/ifcfg-br0.

Next, edit the file and modify it as you need to fit your network.

#vi /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0

TYPE=Bridge

IPADDR=192.168.1.100

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

DNS=8.8.8.8

ONBOOT=yes

BOOTPROTO=static

DELAY=0

Next, you need to create a configuration for the interface that you want to bridge.

If you have just one network interface you have to remove it (or rename it) and you have to recreate a new file with the same name at /etc/sysconfig/network-scripts/.

For example:

#vi /etc/sysconfig/network-scripts/ifcfg- eth0

Change eth0 to the name of your actual interface.

DEVICE=eth0

TYPE=Ethernet

HWADDR=AA:BB:CC:DD:EE:FF

BOOTPROTO=none

ONBOOT=yes

BRIDGE=br0

and Save it

When you’re ready, you can restart the system for the bridge to take effect.

How to Install KVM

We are ready to install KVM now.

dnf install qemu-kvm qemu-img libvirt virt-install libvirt-client

Make sure that the KVM module is loaded now.

lsmod | grep kvm

How to Start KVM

You’ll need to start the libvirtd service in order actually create any virtual machines. Start and enable the service.

systemctl start libvirtd

systemctl enable libvirtd

How to Create a VM

Now, you can start creating virtual machines. You should probably have a Linux install ISO somewhere to work with.

You can install virt-manager, and use the graphical tools to get set up easily.

dnf install virt-manager

Text mode installation.

virt-install \

–virt-type=kvm \

–name Fedora29 \

–ram 4096 \

–vcpus=4 \

–os-variant=fedora29 \

–cdrom=/path/to/install.iso \

–network=bridge=br0,model=virtio \

–graphics none \

–disk path=/var/lib/libvirt/images/fedora29.qcow2,size=20,bus=virtio,format=qcow2

Starting install…

installation starts

How to Start virt-manager (GUI) through MobaXterm

We have to install additional packages:

#dnf -y install libXdmcp libXmu libxkbfile xorg-x11-xauth xorg-x11-xkb-utils

You can do this by opening MobaXterm, connecting to your KVM server as root and running the following command.

virt-manager

Virt-Manager GUI will be startred.

Best regards

Ben

1 Like