Running KVM hypervisor on VPS server

Published on Author admin

Running KVM (Kernel-based Virtual Machine) hypervisor on VPS servers.
Some of current VPS servers are OpenStack KVM virtual machines with nested virtualization enable, so you are able to run a nested KVM virtual machine.

Check whether VPS CPU supports Intel virtualization instruction set.
You should see 'vmx' string in returned value.

grep vmx /proc/cpuinfo

Install required for KVM packages:

yum install virt-manager kvm libvirt qemu-kvm
yum install xorg-*

Reload KVM kernel modules:

rmmod kvm_intel
rmmod kvm
modprobe kvm
modprobe kvm_intel

Start libvirt system daemon:

systemctl start libvirtd

Download ISO test image:

wget http://tinycorelinux.net/8.x/x86/release/TinyCore-current.iso
wget http://archlinux.mirrors.ovh.net/archlinux/iso/2017.07.01/archlinux-2017.07.01-x86_64.iso

Run Virt Manager (requires X forwarding enabled):

virt-manager

To check whether VM is working:

virsh list --all

Scan for running VM:

arp-scan --localnet -I virbr0

Inside ArchLinux live CD VM enable SSH access:

passwd
systemctl restart sshd

Connect via SSH to live CD VM:

ssh root@IP_ADDR