Xen

無法在 Ubuntu natty 上的 Xen 管理程序 4.1.1 中創建 Windows 7 DomU

  • March 12, 2012

我正在嘗試在全新的 AMD Phenom II X6 1090T 上設置 Xen。我已經安裝了 ubuntu natty。

我已經設法讓 Xen Dom0 現在使用核心 2.6.39.3 執行

但是在執行時:

xm 創建 xenwin7.cfg -c

我在 /var/log/xen/qemu-dm-xenwin7.log 中收到以下錯誤:

Using config file "./xenwin7.cfg".
Error: Domain 'xenwin7' does not exist.

在 /var/log/xen/xend.log 中:

[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:103) XendDomainInfo.create(['vm', ['name', 'xenwin7'], ['memory', 1024], ['shadow_memory', 8], ['on_xend_
start', 'ignore'], ['on_xend_stop', 'ignore'], ['vcpus', 1], ['oos', 1], ['image', ['hvm', ['kernel', '/usr/lib/xen/boot/hvmloader'], ['videoram', 4], ['s
erial', 'pty'], ['args', 'console=hvc0'], ['acpi', 1], ['apic', 1], ['boot', 'dc'], ['cpuid', []], ['cpuid_check', []], ['device_model', '/usr/lib64/xen/b
in/qemu-dm'], ['fda', ''], ['fdb', ''], ['guest_os_type', 'default'], ['hap', 1], ['hpet', 0], ['isa', 0], ['keymap', ''], ['localtime', 0], ['nographic',
0], ['oos', 1], ['pae', 1], ['pci', []], ['pci_msitranslate', 1], ['pci_power_mgmt', 0], ['rtc_timeoffset', 0], ['sdl', 1], ['soundhw', ''], ['stdvga', 0
], ['timer_mode', 1], ['usb', 0], ['usbdevice', 'tablet'], ['vcpus', 1], ['vnc', 0], ['vncconsole', 0], ['vncunused', 1], ['viridian', 0], ['vpt_align', 1
], ['xauthority', '/home/xen/.Xauthority'], ['xen_platform_pci', 1], ['memory_sharing', 0], ['vncpasswd', 'XXXXXXXX'], ['tsc_mode', 0], ['nomigrate', 0]]
], ['s3_integrity', 1], ['device', ['vbd', ['uname', 'file:/home/xen/xenwin7.img'], ['dev', 'hda'], ['mode', 'w']]], ['device', ['vbd', ['uname', 'file:/
home/xen/windows7.iso'], ['dev', 'hdc:cdrom'], ['mode', 'r']]], ['device', ['vif', ['bridge', 'xenbr0'], ['type', 'ioemu']]]])
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:2498) XendDomainInfo.constructDomain
[2011-08-02 16:09:48 3940] DEBUG (balloon:187) Balloon: 2226248 KiB free; need 16384; done.
[2011-08-02 16:09:48 3940] DEBUG (XendDomain:476) Adding Domain: 26
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:2836) XendDomainInfo.initDomain: 26 256
[2011-08-02 16:09:48 3940] DEBUG (image:852) cmdline        = console=hvc0
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: boot, val: dc
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: fda, val: None
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: fdb, val: None
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: soundhw, val: None
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: localtime, val: 0
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: serial, val: ['pty']
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: std-vga, val: 0
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: isa, val: 0
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: acpi, val: 1
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: usb, val: 0
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: usbdevice, val: tablet
[2011-08-02 16:09:48 3940] DEBUG (image:891) args: gfx_passthru, val: None
[2011-08-02 16:09:48 3940] INFO (image:822) Need to create platform device.[domid:26]
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:2863) _initDomain:shadow_memory=0x8, memory_static_max=0x40000000, memory_static_min=0x0.
[2011-08-02 16:09:48 3940] INFO (image:182) buildDomain os=hvm dom=26 vcpus=1
[2011-08-02 16:09:48 3940] DEBUG (image:949) domid          = 26
[2011-08-02 16:09:48 3940] DEBUG (image:950) image          = /usr/lib/xen/boot/hvmloader
[2011-08-02 16:09:48 3940] DEBUG (image:951) store_evtchn   = 2
[2011-08-02 16:09:48 3940] DEBUG (image:952) memsize        = 1024
[2011-08-02 16:09:48 3940] DEBUG (image:953) target         = 1024
[2011-08-02 16:09:48 3940] DEBUG (image:954) vcpus          = 1
[2011-08-02 16:09:48 3940] DEBUG (image:955) vcpu_avail     = 1
[2011-08-02 16:09:48 3940] DEBUG (image:956) acpi           = 1
[2011-08-02 16:09:48 3940] DEBUG (image:957) apic           = 1
[2011-08-02 16:09:48 3940] INFO (XendDomainInfo:2357) createDevice: vbd : {'uuid': '7e487eec-1ce3-bee9-089a-218be90c5476', 'bootable': 1, 'driver': 'parav
irtualised', 'dev': 'hda', 'uname': 'file:/home/xen/xenwin7.img', 'mode': 'w'}
[2011-08-02 16:09:48 3940] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '768', 'device-type': 'disk', 'state': '1
', 'backend': '/local/domain/0/backend/vbd/26/768'} to /local/domain/26/device/vbd/768.
[2011-08-02 16:09:48 3940] DEBUG (DevController:97) DevController: writing {'domain': 'xenwin7', 'frontend': '/local/domain/26/device/vbd/768', 'uuid': '7
e487eec-1ce3-bee9-089a-218be90c5476', 'bootable': '1', 'dev': 'hda', 'state': '1', 'params': '/home/xen/xenwin7.img', 'mode': 'w', 'online': '1', 'fronte
nd-id': '26', 'type': 'file'} to /local/domain/0/backend/vbd/26/768.
[2011-08-02 16:09:48 3940] INFO (XendDomainInfo:2357) createDevice: vbd : {'uuid': 'b04587f2-8e66-9661-074e-4eab538f4c69', 'bootable': 0, 'driver': 'parav
irtualised', 'dev': 'hdc:cdrom', 'uname': 'file:/home/xen/windows7.iso', 'mode': 'r'}
[2011-08-02 16:09:48 3940] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '5632', 'device-type': 'cdrom', 'state': 
'1', 'backend': '/local/domain/0/backend/vbd/26/5632'} to /local/domain/26/device/vbd/5632.
[2011-08-02 16:09:48 3940] DEBUG (DevController:97) DevController: writing {'domain': 'xenwin7', 'frontend': '/local/domain/26/device/vbd/5632', 'uuid': '
b04587f2-8e66-9661-074e-4eab538f4c69', 'bootable': '0', 'dev': 'hdc', 'state': '1', 'params': '/home/xen/windows7.iso', 'mode': 'r', 'online': '1', 'fron
tend-id': '26', 'type': 'file'} to /local/domain/0/backend/vbd/26/5632.
[2011-08-02 16:09:48 3940] INFO (XendDomainInfo:2357) createDevice: vif : {'bridge': 'xenbr0', 'mac': '00:16:3e:42:8a:69', 'type': 'ioemu', 'uuid': 'b69e3
0c8-f984-5e63-872d-fbb895f4a127'}
[2011-08-02 16:09:48 3940] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vif/26/0'
} to /local/domain/26/device/vif/0.
[2011-08-02 16:09:48 3940] DEBUG (DevController:97) DevController: writing {'bridge': 'xenbr0', 'domain': 'xenwin7', 'handle': '0', 'uuid': 'b69e30c8-f984
-5e63-872d-fbb895f4a127', 'script': '/etc/xen/scripts/vif-bridge', 'mac': '00:16:3e:42:8a:69', 'frontend-id': '26', 'state': '1', 'online': '1', 'frontend
': '/local/domain/26/device/vif/0', 'type': 'ioemu'} to /local/domain/0/backend/vif/26/0.
[2011-08-02 16:09:48 3940] INFO (image:418) spawning device models: /usr/lib64/xen/bin/qemu-dm ['/usr/lib64/xen/bin/qemu-dm', '-d', '26', '-domain-name', 
'xenwin7', '-videoram', '4', '-sdl', '-vcpus', '1', '-vcpu_avail', '0x1', '-append', 'console=hvc0', '-boot', 'dc', '-serial', 'pty', '-acpi', '-usbdevice
', 'tablet', '-net', 'nic,vlan=1,macaddr=00:16:3e:42:8a:69,model=rtl8139', '-net', 'tap,vlan=1,ifname=tap26.0,bridge=xenbr0', '-M', 'xenfv']
[2011-08-02 16:09:48 3940] INFO (image:467) device model pid: 16361
[2011-08-02 16:09:48 3940] INFO (image:590) waiting for sentinel_fifo
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:3420) Storing VM details: {'on_xend_stop': 'ignore', 'pool_name': 'Pool-0', 'shadow_memory': '9', 'uuid':
'131255fa-f125-7fa9-29a4-6ab7db8d6f68', 'on_reboot': 'restart', 'start_time': '1312258188.76', 'on_poweroff': 'destroy', 'bootloader_args': '', 'on_xend_
s    tart': 'ignore', 'on_crash': 'restart', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'bootloader': '', 'image': "(hvm (kernel '') (args 'c
onsole=hvc0') (superpages 0) (videoram 4) (hpet 0) (stdvga 0) (loader /usr/lib/xen/boot/hvmloader) (xen_platform_pci 1) (rtc_timeoffset 0) (pci ()) (hap 1
) (localtime 0) (timer_mode 1) (pci_msitranslate 1) (oos 1) (apic 1) (sdl 1) (usbdevice tablet) (vpt_align 1) (vncconsole 0) (serial pty) (vncunused 1) (b
oot dc) (pae 1) (viridian 0) (acpi 1) (vnc 0) (nographic 0) (nomigrate 0) (usb 0) (tsc_mode 0) (guest_os_type default) (device_model /usr/lib64/xen/bin/qe
mu-dm) (pci_power_mgmt 0) (xauthority /home/xen/.Xauthority) (isa 0) (notes (SUSPEND_CANCEL 1)))", 'name': 'xenwin7'}
[2011-08-02 16:09:48 3940] WARNING (image:552) domain xenwin7: device model failure: pid 16361: malfunctioning (closed sentinel), killed; see /var/log/xen
/qemu-dm-xenwin7.log 
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:1794) Storing domain details: {'console/port': '3', 'description': '', 'console/limit': '1048576', 'store
/port': '2', 'vm': '/vm/131255fa-f125-7fa9-29a4-6ab7db8d6f68', 'domid': '26', 'image/suspend-cancel': '1', 'cpu/0/availability': 'online', 'memory/target'
: '1048576', 'control/platform-feature-multiprocessor-suspend': '1', 'store/ring-ref': '1044476', 'console/type': 'ioemu', 'name': 'xenwin7'}
[2011-08-02 16:09:48 3940] WARNING (XendDomainInfo:2061) Domain has crashed: name=xenwin7 id=26.
[2011-08-02 16:09:48 3940] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/console/2
6/0'} to /local/domain/26/device/console/0.
[2011-08-02 16:09:48 3940] DEBUG (DevController:97) DevController: writing {'domain': 'xenwin7', 'frontend': '/local/domain/26/device/console/0', 'uuid': 
'c41c5605-484a-ebb8-4cb4-220a2431845f', 'frontend-id': '26', 'state': '1', 'location': '3', 'online': '1', 'protocol': 'vt100'} to /local/domain/0/backend
/console/26/0.
[2011-08-02 16:09:48 3940] ERROR (XendDomainInfo:2195) VM xenwin7 restarting too fast (Elapsed time: 0.059331 seconds). Refusing to restart to avoid loops
.
[2011-08-02 16:09:48 3940] DEBUG (XendDomainInfo:3071) XendDomainInfo.destroy: domid=26
[2011-08-02 16:09:48 3940] WARNING (XendDomainInfo:2061) Domain has crashed: name=xenwin7 id=26.
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2401) Destroying device model
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2408) Releasing devices
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2414) Removing vif/0
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:1276) XendDomainInfo.destroyDevice: deviceClass = vif, device = vif/0
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2414) Removing console/0
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:1276) XendDomainInfo.destroyDevice: deviceClass = console, device = console/0
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2414) Removing vbd/768
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:1276) XendDomainInfo.destroyDevice: deviceClass = vbd, device = vbd/768
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:2414) Removing vbd/5632
[2011-08-02 16:09:49 3940] DEBUG (XendDomainInfo:1276) XendDomainInfo.destroyDevice: deviceClass = vbd, device = vbd/5632
[2011-08-02 16:11:50 3940] DEBUG (SrvServer:77) SrvServer.cleanup()
[2011-08-02 16:11:50 3940] DEBUG (XMLRPCServer:251) XMLRPCServer.cleanup()
[2011-08-02 16:11:50 3940] DEBUG (XMLRPCServer:251) XMLRPCServer.cleanup()
[2011-08-02 16:11:50 3940] DEBUG (XendDomain:644) cleanup_domains
[2011-08-02 16:11:50 3939] INFO (SrvDaemon:220) Xend exited with status 0.

文件 /var/log/xen/qemu-dm-xenwin7.log 顯示

domid: 16
-append only allowed with -kernel option

win7如何啟動?

這是 sudo xm info 的輸出:

host                   : xen
release                : 2.6.39.3
version                : #1 SMP Tue Aug 2 12:47:33 NZST 2011
machine                : x86_64
nr_cpus                : 6
nr_nodes               : 1
cores_per_socket       : 6
threads_per_core       : 1
cpu_mhz                : 3210
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000
virt_caps              : hvm hvm_directio
total_memory           : 8190
free_memory            : 2174
free_cpus              : 0
xen_major              : 4
xen_minor              : 1
xen_extra              : .1
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_scheduler          : credit
xen_pagesize           : 4096
p    latform_params        : virt_start=0xffff800000000000
xen_changeset          : unavailable
xen_commandline        : placeholder
cc_compiler            : gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 
cc_compile_by          : root
cc_compile_domain      : 
cc_compile_date        : Mon Aug  1 15:34:58 NZST 2011
xend_config_format     : 4

按照這個連結: http: //www.virtuatopia.com/index.php/Installing_and_Running_Windows_7_as_a_Xen_HVM_domainU_Guest

我的 xenwin7.cfg 文件:

import os, re
arch = os.uname()[4]
if re.search('64', arch):
   arch_libdir = 'lib64'
else:
   arch_libdir = 'lib'

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 1024 

# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
shadow_memory = 8
name = "xenwin7"
vif = [ 'type=ioemu, bridge=xenbr0' ]
acpi = 1
apic = 1
disk = [ 'file:/home/xen/xenwin7.img,hda,w', 'file:/home/xeb/windows7.iso,hdc:cdrom,r' ]

device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c) or CD-ROM (d) 
# default: hard disk, cd-rom, floppy
boot="dc"
sdl=0
vnc=1
vncconsole=1
vncpasswd=''

serial='pty'
usbdevice='tablet'
extra='xencons=tty'
extra="console=hvc0"

我懷疑這兩行是有罪的:

extra='xencons=tty'
extra="console=hvc0"

是不是可以放

xencons=tty
console=hvc0

改為xenwin7.cfg

我不認為你可以將選項傳遞給 Windows 核心,就像你可以傳遞給 Linux 核心一樣。這些“額外”選項正是如此。我認為你應該刪除它們。

“xm create”的“-c”選項也沒有任何意義……或者Windows有串列控制台嗎?我認為不是,但不確定。

首先嘗試修復上述問題,然後嘗試查看您的 Windows 作業系統是否在此之後啟動。如果是這樣,您可以使用VNCvirt-viewer而不是串列控制台連接到它。

您的日誌中出現以下消息:

[2011-08-02 16:09:48 3940] ERROR (XendDomainInfo:2195) VM xenwin7 restarting too fast (Elapsed time: 0.059331 seconds). Refusing to restart to avoid loops.

…表示您的虛擬機在啟動後很快崩潰或關閉。可能是因為上面提到的問題,或者你可能有一些額外的問題,但目前還不能說。此消息通常表示引導載入程序的早期問題。

引用自:https://serverfault.com/questions/296531