Xen下安裝虛擬win2003的問題

火星人 @ 2014-03-04 , reply:0
←手機掃碼閱讀

Xen下安裝虛擬win2003的問題

環境是rhel5.1 server x86_64,手工建立配置文件win2003:

name = "win2003"
uuid = "cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac"
maxmem = 500
memory = 500
vcpus = 1
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
#cdrom="/xen/win2003.iso"
pae = 0
acpi = 0
apic = 0
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
sdl = 1
vnc = 0
vncunused = 0
keymap = "en-us"
disk = [ "file:/xen/win2003.img,hda,w", "file:/xen/win2003.iso,hdc:cdrom,r" ]
boot = "dc"
vif = [ "mac=00:16:3e:23:38:ed,bridge=virbr0,type=ioemu" ]
nographic=0


使用命令xm create win2003以後,使用xm list命令可以看到這個虛擬機已經佔用500M內存,但是cpu利用率是0,virt-manager里看不到win2003的安裝畫面,從/var/log/xen/xend.log的輸出里也看不出有什麼出錯的地方:

DEBUG (XendDomainInfo:200) XendDomainInfo.create(['vm', ['name', 'win2003'], ['memory', 500], ['maxmem', 500], ['on_poweroff', 'destroy'], ['on_reboot', 'restart'], ['on_crash', 'restart'], ['vcpus', 1], ['uuid', 'cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac'], ['image', ['hvm', ['kernel', '/usr/lib/xen/boot/hvmloader'], ['device_model', '/usr/lib64/xen/bin/qemu-dm'], ['vcpus', 1], ['boot', 'dc'], ['sdl', 1], ['display', ':0.0'], ['xauthority', '/tmp/.gdmZ6JR4T'], ['keymap', 'en-us']]], ['device', ['vbd', ['uname', 'file:/xen/win2003.img'], ['dev', 'hda'], ['mode', 'w']]], ['device', ['vbd', ['uname', 'file:/xen/win2003.iso'], ['dev', 'hdc:cdrom'], ['mode', 'r']]], ['device', ['vif', ['bridge', 'virbr0'], ['mac', '00:16:3e:23:38:ed'], ['type', 'ioemu']]]])
DEBUG (XendDomainInfo:306) parseConfig: config is ['vm', ['name', 'win2003'], ['memory', 500], ['maxmem', 500], ['on_poweroff', 'destroy'], ['on_reboot', 'restart'], ['on_crash', 'restart'], ['vcpus', 1], ['uuid', 'cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac'], ['image', ['hvm', ['kernel', '/usr/lib/xen/boot/hvmloader'], ['device_model', '/usr/lib64/xen/bin/qemu-dm'], ['vcpus', 1], ['boot', 'dc'], ['sdl', 1], ['display', ':0.0'], ['xauthority', '/tmp/.gdmZ6JR4T'], ['keymap', 'en-us']]], ['device', ['vbd', ['uname', 'file:/xen/win2003.img'], ['dev', 'hda'], ['mode', 'w']]], ['device', ['vbd', ['uname', 'file:/xen/win2003.iso'], ['dev', 'hdc:cdrom'], ['mode', 'r']]], ['device', ['vif', ['bridge', 'virbr0'], ['mac', '00:16:3e:23:38:ed'], ['type', 'ioemu']]]]
DEBUG (XendDomainInfo:411) parseConfig: result is {'shadow_memory': None, 'start_time': None, 'uuid': 'cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac', 'on_crash': 'restart', 'on_reboot': 'restart', 'localtime': None, 'image': ['hvm', ['kernel', '/usr/lib/xen/boot/hvmloader'], ['device_model', '/usr/lib64/xen/bin/qemu-dm'], ['vcpus', 1], ['boot', 'dc'], ['sdl', 1], ['display', ':0.0'], ['xauthority', '/tmp/.gdmZ6JR4T'], ['keymap', 'en-us']], 'on_poweroff': 'destroy', 'bootloader_args': None, 'cpus': None, 'name': 'win2003', 'backend': [], 'vcpus': 1, 'cpu_weight': None, 'features': None, 'vcpu_avail': None, 'memory': 500, 'device': [('vbd', ['vbd', ['uname', 'file:/xen/win2003.img'], ['dev', 'hda'], ['mode', 'w']]), ('vbd', ['vbd', ['uname', 'file:/xen/win2003.iso'], ['dev', 'hdc:cdrom'], ['mode', 'r']]), ('vif', ['vif', ['bridge', 'virbr0'], ['mac', '00:16:3e:23:38:ed'], ['type', 'ioemu']])], 'bootloader': None, 'cpu': None, 'maxmem': 500}
DEBUG (XendDomainInfo:1349) XendDomainInfo.construct: None
DEBUG (balloon:127) Balloon: 529284 KiB free; need 2048; done.
DEBUG (XendDomainInfo:1397) XendDomainInfo.initDomain: 5 1.0
DEBUG (image:315) args: boot, val: dc
DEBUG (image:315) args: fda, val: None
DEBUG (image:315) args: fdb, val: None
DEBUG (image:315) args: soundhw, val: None
DEBUG (image:315) args: localtime, val: None
DEBUG (image:315) args: serial, val: None
DEBUG (image:315) args: std-vga, val: None
DEBUG (image:315) args: isa, val: None
DEBUG (image:315) args: vcpus, val: 1
DEBUG (image:315) args: acpi, val: None
DEBUG (image:315) args: usb, val: None
DEBUG (image:315) args: usbdevice, val: None
DEBUG (image:315) args: k, val: en-us
DEBUG (XendDomainInfo:1436) _initDomain:shadow_memory=0x0, maxmem=0x1f4, memory=0x1f4.
DEBUG (balloon:127) Balloon: 528248 KiB free; need 525312; done.
INFO (image:136) buildDomain os=None dom=5 vcpus=1
DEBUG (image:268) domid          = 5
DEBUG (image:269) image          = /usr/lib/xen/boot/hvmloader
DEBUG (image:270) store_evtchn   = 2
DEBUG (image:271) memsize        = 500
DEBUG (image:272) vcpus          = 1
DEBUG (image:273) pae            = 0
DEBUG (image:274) acpi           = 0
DEBUG (image:275) apic           = 0
DEBUG (DevController:110) DevController: writing {'backend-id': '0', 'virtual-device': '768', 'device-type': 'disk', 'state': '1', 'backend': '/local/domain/0/backend/vbd/5/768'} to /local/domain/5/device/vbd/768.
DEBUG (DevController:112) DevController: writing {'domain': 'win2003', 'frontend': '/local/domain/5/device/vbd/768', 'dev': 'hda', 'state': '1', 'params': '/xen/win2003.img', 'mode': 'w', 'online': '1', 'frontend-id': '5', 'type': 'file'} to /local/domain/0/backend/vbd/5/768.
DEBUG (blkif:24) exception looking up device number for hdc: No such file or directory: '/dev/hdc'
DEBUG (DevController:110) DevController: writing {'backend-id': '0', 'virtual-device': '5632', 'device-type': 'cdrom', 'state': '1', 'backend': '/local/domain/0/backend/vbd/5/5632'} to /local/domain/5/device/vbd/5632.
DEBUG (DevController:112) DevController: writing {'domain': 'win2003', 'frontend': '/local/domain/5/device/vbd/5632', 'dev': 'hdc', 'state': '1', 'params': '/xen/win2003.iso', 'mode': 'r', 'online': '1', 'frontend-id': '5', 'type': 'file'} to /local/domain/0/backend/vbd/5/5632.
DEBUG (DevController:110) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vif/5/0'} to /local/domain/5/device/vif/0.
DEBUG (DevController:112) DevController: writing {'bridge': 'virbr0', 'domain': 'win2003', 'handle': '0', 'script': '/etc/xen/scripts/vif-bridge', 'state': '1', 'frontend': '/local/domain/5/device/vif/0', 'mac': '00:16:3e:23:38:ed', 'online': '1', 'frontend-id': '5', 'type': 'ioemu'} to /local/domain/0/backend/vif/5/0.
INFO (image:407) spawning device models: /usr/lib64/xen/bin/qemu-dm ['/usr/lib64/xen/bin/qemu-dm', '-d', '5', '-m', '500', '-boot', 'dc', '-vcpus', '1', '-k', 'en-us', '-domain-name', 'win2003', '-net', 'nic,vlan=1,macaddr=00:16:3e:23:38:ed,model=rtl8139', '-net', 'tap,vlan=1,bridge=virbr0']
INFO (image:409) device model pid: 23841
DEBUG (XendDomainInfo:756) Storing VM details: {'shadow_memory': '5', 'uuid': 'cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac', 'on_reboot': 'restart', 'start_time': '1199793529.18', 'on_poweroff': 'destroy', 'name': 'win2003', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'memory': '500', 'on_crash': 'restart', 'image': '(hvm (kernel /usr/lib/xen/boot/hvmloader) (device_model /usr/lib64/xen/bin/qemu-dm) (vcpus 1) (boot dc) (sdl 1) (display :0.0) (xauthority /tmp/.gdmZ6JR4T) (keymap en-us))', 'maxmem': '500'}
DEBUG (XendDomainInfo:791) Storing domain details: {'console/port': '3', 'name': 'win2003', 'console/limit': '1048576', 'vm': '/vm/cc53ebaa-fa56-109c-8b0e-7c7d2414e9ac', 'domid': '5', 'cpu/0/availability': 'online', 'memory/target': '512000', 'store/ring-ref': '127998', 'store/port': '2'}
DEBUG (DevController:143) Waiting for devices vif.
DEBUG (DevController:149) Waiting for 0.
DEBUG (XendDomainInfo:988) XendDomainInfo.handleShutdownWatch
DEBUG (DevController:476) hotplugStatusCallback /local/domain/0/backend/vif/5/0/hotplug-status.
DEBUG (DevController:476) hotplugStatusCallback /local/domain/0/backend/vif/5/0/hotplug-status.
DEBUG (DevController:490) hotplugStatusCallback 1.
DEBUG (DevController:143) Waiting for devices usb.
DEBUG (DevController:143) Waiting for devices vbd.
DEBUG (DevController:149) Waiting for 768.
DEBUG (DevController:476) hotplugStatusCallback /local/domain/0/backend/vbd/5/768/hotplug-status.
DEBUG (DevController:490) hotplugStatusCallback 1.
DEBUG (DevController:149) Waiting for 5632.
DEBUG (DevController:476) hotplugStatusCallback /local/domain/0/backend/vbd/5/5632/hotplug-status.
DEBUG (DevController:476) hotplugStatusCallback /local/domain/0/backend/vbd/5/5632/hotplug-status.
DEBUG (DevController:490) hotplugStatusCallback 1.
DEBUG (DevController:143) Waiting for devices irq.
DEBUG (DevController:143) Waiting for devices vkbd.
DEBUG (DevController:143) Waiting for devices vfb.
DEBUG (DevController:143) Waiting for devices pci.
DEBUG (DevController:143) Waiting for devices ioports.
DEBUG (DevController:143) Waiting for devices tap.
DEBUG (DevController:143) Waiting for devices vtpm.
INFO (XendDomain:370) Domain win2003 (5) unpaused.
《解決方案》

你可以嘗試下virt-install,通過提示來安裝~   我是通過這個來安裝的沒什麼問題,就是系統時間會出現飆到一千年以後,呵呵,可看我那個帖子
http://linux.chinaunix.net/bbs/thread-918156-1-1.html
我的配置文件,你可以參考下
=============================================
# Automatically generated xen config file
name = "win"
builder = "hvm"
memory = "512"
disk = [ 'phy:/dev/vg0/win,hda,w' ]
vif = [ 'type=ioemu, mac=00:16:3e:78:db:8e, bridge=xenbr0', ]
uuid = "ce31cc5e-7be3-7846-92d7-763fff2f7054"
device_model = "/usr/lib64/xen/bin/qemu-dm"
kernel = "/usr/lib/xen/boot/hvmloader"
vnc=1
vncunused=1
apic=1
acpi=0
pae=1

vcpus=1
serial = "pty" # enable serial console
on_reboot   = 'restart'
on_crash    = 'restart'
================================================

[ 本帖最後由 Flankeraptor 於 2008-1-9 12:39 編輯 ]
《解決方案》

Thanks for help.

以下是我運行virt-install的結果:

Would you like a fully virtualized guest (yes or no)?  This will allow you to run unmodified operating systems. yes
What is the name of your virtual machine? win2003
How much RAM should be allocated (in megabytes)? 500
What would you like to use as the disk (path)? /xen/win2003.img
How large would you like the disk (/xen/win2003.img) to be (in gigabytes)? 6
Would you like to enable graphics support? (yes or no) yes
What is the virtual CD image, CD device or install location? /xen/win2003.iso


Starting install...
Creating storage file...  100% |=========================| 6.0 GB    00:00     
Creating domain...                                                 0 B 00:02
Unable to connect to graphical console; vnc port number not found.
Domain installation still in progress.  You can reconnect
to the console to complete the installation process.


程序提示vnc port number not found不知道是為什麼?

[ 本帖最後由 sailer_sh 於 2008-1-9 13:22 編輯 ]
《解決方案》

disk = [ 'file:/vm/vm1/hda,ioemu:hda,w' ]
memory = 512
vcpus = 1
builder = 'hvm'
device_model = '/usr/lib/xen/bin/qemu-dm'
kernel = '/usr/lib/xen/boot/hvmloader'
name = 'vm1'
vif = [ 'type=ioemu,mac=00:16:3e:93:bc:07,bridge=xenbr0' ]
stdvga = 0
sdl = 1
vnc = 0
vncviewer = 0
ne2000 = 0
localtime = 0
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
boot = 'c'
cdrom = '/media/COLLECTIONS/downloads/win2003'


這是我的配置,你看看

[ 本帖最後由 ljhb 於 2008-1-9 14:04 編輯 ]
《解決方案》

原帖由 ljhb 於 2008-1-9 14:00 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
disk = [ 'file:/vm/vm1/hda,ioemu:hda,w' ]
memory = 512
vcpus = 1
builder = 'hvm'
device_model = '/usr/lib/xen/bin/qemu-dm'
kernel = '/usr/lib/xen/boot/hvmloader'
name = 'vm1'
vif =  ...

謝謝!
你這裡boot='c',新裝系統的時候c盤上還沒有東西,沒法從硬碟啟動啊。
《解決方案》

那就boot='d'吧,這個是我裝好系統后的配置
《解決方案》

剛發現系統上正在運行的半虛擬機竟然也不能在virtual machine console里顯示,是不是系統的什麼地方設置不對?是不是和$DISPLAY變數的設置有關?
《解決方案》

LZ應該在主機裡面配置過vnc嗎?我安裝2k3的時候是直接在xp下面用vncview來管理的。
另外看是不是selinux開在那邊,也會引起一些問題。
《解決方案》

查看一下/var/log/xen下qemu-dm的log信息,也許會有幫助




[火星人 via ] Xen下安裝虛擬win2003的問題已經有298次圍觀

http://www.coctec.com/docs/service/show-post-7733.html