Ensure your host's CPU can support virtualization (the result should be > 0):
# egrep -c '(vmx|svm)' /proc/cpuinfoInstall the KVM hypervisor and its necessary packages (this is competitive with vmware):
# yum install kvm libvirt virt-install qemu-kvmMake sure the host's kernel is ready to perform NAT with the hypervisor for the VM guests. First we'll enable IP forwarding on the host:
# echo "net.ipv4.ip_forward = 1" | sudo tee /etc/sysctl.d/99-ipforward.confThen, we'll modify the network adapter's configuration to use a bridge adapter (in my case, I'm using eth1). Open the config file for editing, comment out everything IP-related (IP, gateway, DNS, etc.), and add a link to the bridge configuration file that we'll add next:
# sysctl -p /etc/sysctl.d/99-ipforward.conf
# vim /etc/sysconfig/network-scripts/ifcfg-eth1
BRIDGE=virbr0Next, we need to create a bridge adapter configuration file and add the following lines (your info will probably be same as what you commented out above):
# vim /etc/sysconfig/network-scripts/ifcfg-virbr0
DEVICE="virbr0"If possible, reboot the machine to ensure kernel modules and network settings load and initialize.
TYPE=BRIDGE
ONBOOT=yes
BOOTPROTO=static
IPADDR="[YOURS]"
NETMASK="[YOURS]"
GATEWAY="[YOURS]"
DNS1="[YOURS]"
Finally, just verify your installation and configuration:
# lsmod | grep kvm
# ip a show virbr0
# virsh -c qemu:///system list
No comments:
Post a Comment