How to Install KVM on your Dedicated Physical Server - Linux

This document describes the installation of RHEL 7 & 8 KVM(Guest OS).

 

Installation Notes:

  1. This MOP is valid only after installation of correct RHEL version.

 

Prerequisites:

  1. 8 64-bit DVD or ISO to be accessible on locally.

 

Part 1

Installation

Step 1: Install kvm

Areas to Consider

Step

Detailed Description

 

 

 

1.     

yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install

 

 

 

2.     

Start the libvirtd service

# systemctl enable libvirtd
# systemctl start libvirtd

 

 

 

 

3.     

Make sure KVM module loaded using lsmod command and grep command:
# lsmod | grep -i kvm

 

 

 

 

4.     

Configure bridged networking

 

By default dhcpd based network bridge configured by libvirtd. You can verify that with the following commands:
# brctl show
# virsh net-list

 

 

 

 

 

5.     

All VMs (guest machine) only have network access to other VMs on the same server. A private network 192.168.122.0/24 created for you. Verify it:

# virsh net-dumpxml default

 

 

 

 

6.     

If you want your VMs avilable to other servers on your LAN, setup a a network bridge on the server that connected to the your LAN. Update your nic config file such as ifcfg-enp3s0 or em1:

# vi /etc/sysconfig/network-scripts/enp3s0
Add line:
BRIDGE=br0

 

Save And Close the file

 

 

 

7.     

In vi. Edit /etc/sysconfig/network-scripts/ifcfg-br0 and add:

 

DEVICE="br0"

# I am getting ip from DHCP server #

BOOTPROTO="dhcp"

IPV6INIT="yes"

IPV6_AUTOCONF="yes"

ONBOOT="yes"

TYPE="Bridge"

DELAY="0”

Save & Close the file

 

 

 

8.     

Restart the networking service (warning ssh command will disconnect, it is better to reboot the box):


# systemctl restart NetworkManager

 

 

 

 

 

9.     

Verify it with brctl command:


# brctl show

 

 

 

 

 

10.  

Procedure for KVM Qcow2 Copy

  1. Login to base Server
  2. Open KVM Console
  3. Shut down the KVM Machine which need to be Copied
  4. Go to the Storage path of Qcow File (Eg :- /var/lib/image/Mediaserver.qcow2)
  5. In SSH console  Type cp /var/lib/image/Mediaserver.qcow2  /yourBackuppath   (eg:- your backup path need to be defined as per your storage)
  6. After Complete copy go to KVM Console and start the KVM machine

 

 

 

11.  

Procedure for KVM Qcow2 Copy Back to Main Location

 

  1. Login to base Server
  2. Open KVM Console
  3. Shut down the KVM Machine which need to be Copied Back
  4. Go to the Storage path of Qcow File (Eg :- /var/lib/image/Mediaserver.qcow2)
  5. Remove the Old Qcow file (Copy the Qcow file to another location if needed)
  6. In SSH console  Type cp /yourbackuppath  /var/lib/image/Mediaserver.qcow2     (eg:- your backup path need to be defined as per your storage)
  7. After Complete copy  , Change the File permissions for Qcow2 if needed
  8. go to KVM Console and start the KVM machine

 

 

 

 

 

  • KVM, Linux server, Dedicated server, Dedicated Hosting Provider, SOLOIDC Dedicated Server
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

RHEL Linux Installation Procedure - RHEL 7 & 8

Here are the step by step screenshots for the installation of Red Hat Enterprise Linux 7.2(64...

Powered by WHMCompleteSolution