Вы находитесь на странице: 1из 3

Virtualization with KVM on CentOS 6.

7 Server
1 Preliminary Setup
vim /etc/selinux/config
Set SELINUX=disabled...
And reboot
2 Installing KVM
First check if youre CPU supports hardware virtualization - if this is the case, the command
egrep '(vmx|svm)' --color=always /proc/cpuinfo
To install KVM and virtinst (a tool to create virtual machines), we have to run
yum install kvm libvirt python-virtinst qemu-kvm
service libvirtd start
We need to set up a network bridge on our server so that our virtual machines can be accessed
from other hosts as if they were physical systems in the network.
yum install bridge-utils
Create the file /etc/sysconfig/network-scripts/ifcfg-br0
(please
use
the IPADDR, PREFIX, GATEWAY,
the /etc/sysconfig/network-scripts/ifcfg-eth0 file)
make sure you use TYPE=Bridge, notTYPE=Ethernet:

DNS1 and DNS2 values

from

vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.30.xx
PREFIX=24
GATEWAY=192.168.30.1
DNS1=192.168.30.1
DNS2=192.168.30.5
DEFROUTE=yes
IPV6INIT=no
NAME="System br0"
Then Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows (comment
out BOOTPROTO, IPADDR, PREFIX, GATEWAY, DNS1, andDNS2 and add BRIDGE=br0):
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
#BOOTPROTO=none
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE="Ethernet"
HWADDR=XXXXXXXXXXXX
#IPADDR=192.168.30.xx
#PREFIX=24
#GATEWAY=192.168.20.1
DNS1=192.168.30.1
DNS2=192.168.30.5
DEFROUTE=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0
then enter
service network restart
and run
ifconfig

3 Installing virt-viewer or virt-manager on CentOS Desktop

yum install virt-manager libvirt qemu-system-x86 openssh-askpass


Go to Applications > System Tools > Virtual Machine Manager to start virt-manager
Then type your root password
When you start virt-manager for the first time, you will most likely see the message Unable to
open a connection to the libvirt management daemon. You can ignore this because we don't want
to connect to the local libvirt daemon, but to the one on our CentOS 6.7 KVM host. Click
on Close and go to File > Add Connection... to connect to our CentOS 6.7 KVM host.

Вам также может понравиться