配置:
1. Dom0里修改/etc/xen/xend-conf.sxp文件,把原有bridge相关设置注释掉,使用nat设置:

vi /etc/xen/xend-config.sxp
(network-script network-nat)
#(network-script network-bridge)
#(network-script network-route)
(vif-script vif-nat)
#(vif-script vif-bridge)
#(vif-script vif-route)


重启xen
/etc/init.d/xend restart

2、停止虚拟机
#xm shutdown appdata_vm

修改虚拟机配置文件/etc/xen/appdata_vm

name = "appdata_vm"
uuid = "5f82d3e7-8962-bd78-2652-3804c30cafb7"
maxmem = 6114
memory = 6114
vcpus = 8
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
disk = [ "tap:aio:/data/appdata_vm,xvda,w","tap:aio:/data/appdata_vm.img,xvdb,w" ]
#vif = [ "mac=00:16:36:60:56:30,bridge=peth1,script=vif-bridge" ]
vif = [ "mac=00:16:36:60:56:30,ip=192.168.0.6" ]
dhcp = "off"
启动虚拟机
#xm create appdata_vm
3、查看
#ifconfig

vif13.0   Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF 
          inet addr:192.168.0.144  Bcast:0.0.0.0  Mask:255.255.255.255
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8993 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:599420 (585.3 KiB)  TX bytes:29334974 (27.9 MiB)
 

 

爱慕尔商城欢迎您的光临!
穿衣打扮  
城市物语