Dom0 ubuntu12.04 AMD64
xen 4.1.2
Domu ubuntu12.04
安装配置文件ubuntu1204.cfg:
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 512
vcpus = 4
shadow_memory = 8
builder = 'hvm'
device_model="/usr/lib/xen/bin/qemu-dm"
disk = [ "file:/root/xen/image/ubuntu1204.img,ioemu:hda,w"]
#"file:/media/849921f0-52b7-4ea4-af93-87954cf0f34f/xuriwuyun/kvm/ubuntu/ubuntu-12.04-server-amd64.iso,ioemu:hdc:cdrom,r" ]
name = "ubuntu1204"
vif = [ "mac=00:16:3e:40:00:11, bridge=br0" ]
boot='cd'
vnc=1
vncviewer=1
sdl=0
acpi = 1
apic = 1
stdvga = 0
serial = 'pty'
usbdevice = 'tablet'
用dd制作ubuntu1204.img镜像:
#dd if=/dev/zero of=/root/xen/image/ubuntu1204.img
bs=1k seek=10000k count=1
官方下载ubuntu ISO文件
#xm create ubuntu1204.cfg
$vncviewer localhost:5900&
#可以用netstat -lpnt 查看虚拟机的vnc端口
一步一步安装即可
troubleshooting:
当ubuntu启动后,无法联网:
在虚拟机内部,运行:
$ifconfig eth0 up
SIOCSIFFLAGS:
Cannot assign requested address
$ip link
eth0的mac地址全为0
解决方法:
在ubuntu1204.cfg文件中
vif = [ "type=ioemu,
mac=00:16:3e:40:00:11, bridge=br0" ] 配置有问题,应当改为:
vif = [ "
mac=00:16:3e:40:00:11, bridge=br0" ]
重启虚拟机即可。