xen:ubuntu下xen的安装

-.ubuntu下安装配置xen


实验环境:

操作系统:Ubuntu 12.04.4 LTS x86_64

内核版本:3.2.0-23-generic



安装bridge-utils:

apt-get  install bridge-utils

配置bridge network(use static ip address,其中的真实IP用X.X.X.X替换):

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
        address X.X.X.X
        netmask 255.255.255.128
        gateway X.X.X.X
auto eth0:0
iface eth0:0 inet static
        address X.X.X.X
        netmask 255.255.255.128
auto eth1
iface eth1 inet manual
auto xenbr1
iface xenbr1 inet static
    address 10.20.20.20
netmask 255.255.255.0
bridge_ports eth1
bridge_stp off



使用apt-get下载安装:

 
apt-get install xen-hypervisor-4.1-amd64 xen-utils-4.1 xenwatch xen-tools xen-utils-common xenstore-utils

安装后修改启动项:

sed -i 's/GRUB_DEFAULT=.*\+/GRUB_DEFAULT="Xen 4.1-amd64"/' /etc/default/grub
update-grub2

修改xend配置(/etc/xen/xend-config.sxp)

根据我的network配置,使用桥接方式,修改其中:

(network-script 'network-bridge netdev=eth1')

为了保证网络畅通,还需要一下配置:

添加nat:

/sbin/iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE

开启IP转发:

vim/etc/sysctl.conf
net.ipv4.ip_forward= 1
sysctl -p

到这里,xen的基本配置已经ok了

你可能感兴趣的:(安装,xen)