Once you have KVM installed, you should make sure that you have libvirt installed as well. If not, install it now.
# yum install libvirt
Next, restart the libvirt service to get KVM running.
# service libvirtd restart
Now verify that the kvm module is loaded:
$ lsmod | grep kvm
The output will look something like this:
kvm_intel 41253 0
kvm 231774 1 kvm_intel
To give a local user the ability to run a virtual machine, you will need to add the user to the kvm group. For example, to add the user “dss”:
# usermod -a -G kvm dss
If you are logged in as this user, log out to allow the new settings to take effect. When you log back in, you can verify the group inclusion with:
You will then need to repeat this step for the libvirt group.
Next, verify that your user “dss” can access qemu:
$ virsh -c qemu:///system sysinfo
Finally, change the permissions of the default images directories:
$ sudo chown root:libvirt /var/lib/libvirt/images
$ sudo chmod g+rw /var/lib/libvirt/images
In part 4 of this series, you learn how to setup a virtual machine and use it in your server environment.
- How to Setup and Use KVM: Part 1
- How to Setup and Use KVM: Part 2
- How to Setup an SSH Key
- How to Setup a CS (Counter Strike) Server
- WHM Scripts for Easy Server Setup