Skip to content

Latest commit

 

History

History
110 lines (73 loc) · 2.2 KB

kvm.md

File metadata and controls

110 lines (73 loc) · 2.2 KB

kvm

documents

installation

verify the cpu and bios kvm support

$ sudo egrep -c '(vmx|svm)' /proc/cpuinfo

note:output should be “1” or greater.

install packages

$ sudo yum install -y qemu-kvm libvirt libvirt-python libguestfs-tools virt-install

enable and start libvirt

$ sudo systemctl enable libvirtd && systemctl start libvirtd

verify kernel modules

$ sudo lsmod | grep kvm

note: should see results for kvm and kvm_intel (on intel hardware).

network bridge

host-only bridge

todo

bridge to lan

bridge ethernet interface

note: assumes wired interface's identifier is em1. verify the identifier for the interface being bridged via ip addr show.

add bridge=br0 to the end of /etc/sysconfig/network-scripts/ifcfg-em1.

add bridge to network scripts

add the following to /etc/sysconfig/network-scripts/ifcfg-br0:

device="br0"
bootproto="dhcp"
ipv6init="yes"
ipv6_autoconf="yes"
onboot="yes"
type="bridge"
delay="0"

enable network forwarding

add net.ipv4.ip_forward = 1 to /etc/sysctl.conf, then read the configuration:

$ sudo sysctl -p /etc/sysctl.conf

restart network manager

$ sudo systemctl restart networkmanager

note: for the bridge to be usable by guests, a reboot may be required.

storage pools

create pool directories

$ mkdir /home/deployment-user/kvm_storage
$ sudo virsh pool-build isos # bootable os iso images go here.
$ sudo virsh pool-build images # guest disk images, including "golden" images go here.

note: any files moved into the kvm_storage/images or kvm_storage/isos directories will be automagically chwon'd by root.

define storage pools

$ sudo virsh pool-define-as isos dir - - - - "/home/deployment-user/kvm_storage/isos"
$ sudo virsh pool-define-as images dir - - - - "/home/deployment-user/kvm_storage/images"

autostart storage pools

$ sudo virsh pool-autostart isos
$ sudo virsh pool-autostart images

start storage pools

$ sudo virsh pool-start isos
$ sudo virsh pool-start images