KVM – 在Debian Lenny 64位主机上安装Windows 2003 guest的问题

我有一个Debian Lenny 64位主机,并安装了kvm与Windows 2003工作正常,但我注意到在标准软件包kvm版本是多less年,所以我决定更新使用debian backports得到更多的最新的软件包。 所以我更新使用

apt-get -t lenny-backports安装kvm libvirt-bin virtinst

所以现在我有

debian:~# virsh version Compiled against library: libvir 0.8.3 Using library: libvir 0.8.3 Using API: QEMU 0.8.3 Running hypervisor: QEMU 0.9.1 

所以现在我试图设置一个新的客人:

 debian:/tmp# virt-install --connect qemu:///system -n win2k3 -r 2048 -c /home/win2k3.iso -f /home/win2k3.img -s 20 --nonetworks --noautoconsole --vnc --os-type=windows --os-variant=win2k3 --hvm --accelerate --debug Sat, 04 Dec 2010 17:20:24 DEBUG Launched with command line: /usr/bin/virt-install --connect qemu:///system -n win2k3 -r 2048 -c /home/win2k3.iso -f /home/win2k3.img -s 20 --nonetworks --noautoconsole --vnc --os-type=windows --os-variant=win2k3 --hvm --accelerate --debug Sat, 04 Dec 2010 17:20:24 DEBUG Requesting libvirt URI qemu:///system Sat, 04 Dec 2010 17:20:24 DEBUG Received libvirt URI qemu:///system Sat, 04 Dec 2010 17:20:24 DEBUG Requesting virt method 'hvm', hv type 'default'. Sat, 04 Dec 2010 17:20:24 DEBUG Received virt method 'hvm' Sat, 04 Dec 2010 17:20:24 DEBUG Hypervisor name is 'kvm' Sat, 04 Dec 2010 17:20:24 DEBUG Could not open "/etc/sysconfig/keyboard" [Errno 2] No such file or directory: '/etc/sysconfig/keyboard' Sat, 04 Dec 2010 17:20:24 DEBUG Could not open "/etc/X11/xorg.conf": [Errno 2] No such file or directory: '/etc/X11/xorg.conf' Sat, 04 Dec 2010 17:20:24 DEBUG Could not open "/etc/default/keyboard": [Errno 2] No such file or directory: '/etc/default/keyboard' Sat, 04 Dec 2010 17:20:24 DEBUG Did not parse any usable keymapping. Sat, 04 Dec 2010 17:20:24 DEBUG DistroInstaller location is a local file/path: /home/win2k3.iso Starting install... Creating storage file win 100% |=========================| 20 GB 00:00 Sat, 04 Dec 2010 17:20:24 DEBUG Generated install XML: <domain type='kvm'> <name>win2k3</name> <currentMemory>2097152</currentMemory> <memory>2097152</memory> <uuid>d0bd8a0f-af7f-1647-4662-f4e3f86ef524</uuid> <os> <type arch='x86_64'>hvm</type> <boot dev='cdrom'/> </os> <features> <acpi/><apic/><pae/> </features> <clock offset="localtime"/> <on_poweroff>destroy</on_poweroff> <on_reboot>destroy</on_reboot> <on_crash>destroy</on_crash> <vcpu>1</vcpu> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/home/win2k3.img'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu'/> <source file='/home/win2k3.iso'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <input type='tablet' bus='usb'/> <graphics type='vnc' port='-1' keymap='en-us'/> <console type='pty'/> <video> <model type='vga'/> </video> </devices> </domain> Creating domain... 0 B 00:00 Sat, 04 Dec 2010 17:20:24 DEBUG Started guest, looking to see if it is running Sat, 04 Dec 2010 17:20:24 DEBUG Generated boot XML: <domain type='kvm'> <name>win2k3</name> <currentMemory>2097152</currentMemory> <memory>2097152</memory> <uuid>d0bd8a0f-af7f-1647-4662-f4e3f86ef524</uuid> <os> <type arch='x86_64'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/><apic/><pae/> </features> <clock offset="localtime"/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <vcpu>1</vcpu> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/home/win2k3.img'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu'/> <source file='/home/win2k3.iso'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <input type='tablet' bus='usb'/> <graphics type='vnc' port='-1' keymap='en-us'/> <console type='pty'/> <video> <model type='vga'/> </video> </devices> </domain> Domain installation does not appear to have been successful. If it was, you can restart your domain by running 'virsh start win2k3'; otherwise, please restart your installation. 

显示错误,但我没有看到任何理由,所以我尝试

 debian:/tmp# virsh start win2k3 Domain win2k3 started 

然后没有开始和日志显示

 LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 2048 -smp 1,sockets=1,cores=1,threads=1 -name win2k3 -uuid faaa37da-7eb3-d5ab-e36a-c7f782c5a657 -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/win2k3.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot c -drive file=/home/win2k3.img,if=none,id=drive-ide0-0-0,boot=on,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/home/win2k3.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -k en-us -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 char device redirected to /dev/pts/6 exception 13 (0) rax 0000000000000010 rbx 000000000000c000 rcx 0000000000006e36 rdx 00000000c0000000 rsi 0000000000000003 rdi 0000000000000000 rsp 0000000000006e2c rbp 0000000000000008 r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000 r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000 rip 00000000000fec3c rflags 00033002 cs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0) tr 0000 (feffd000/00002088 p 1 dpl 0 db 0 s 0 type bl 0 g 0 avl 0) ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0) gdt f7a30/37 idt f8ab0/0 cr0 10 cr2 0 cr3 0 cr4 0 cr8 0 efer 0 code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 --> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

我只是不知道该去哪里。 任何帮助将是伟大的。

谢谢

所以在阅读http://www.linux-kvm.org/page/Code#Debian后,他们会说:“使用更新的内核很重&#x8981; – 2.6.26与kvm不兼容”

所以我跑下面,因为我有64位(32位的linux-image-2.6-686)

apt-get -t lenny-backports安装linux-image-2.6-amd64

然后重新启动,并试图再次创build我的VM,它的工作!

 debian:~# virt-install --connect qemu:///system -n win2k3 -r 2048 -c /home/win2k3.iso -f /home/win2k3.img -s 20 --nonetworks --noautoconsole --vnc --os-type=windows --os-variant=win2k3 --hvm --accelerate Starting install... Creating storage file win 100% |=========================| 20 GB 00:00 Creating domain... 0 B 00:00 Domain installation still in progress. Waiting for installation to complete. 

我希望这可以帮助任何可能在这里绊倒的人。

关于@Brandon回答:Windows Server 2003(适用于小型企业),在安装的最后阶段停留,如果您以--nonetworks (2016年:– --network none--network none ,显示错误消息,您需要安装支持TCP / IP的networking适配器。

使用用户模式(本地局域网)networking来安装,然后通过iptables禁用本机的互联网访问是更好的策略。

我通常这样开始: sudo virt-install \ --connect qemu:///system \ --name=win2k3-br1 \ --ram=1024 \ --vcpus=2 \ --os-type=windows --os-variant=win2k3 \ --virt-type=kvm \ --hvm \ --graphics vnc,port=5951 \ --cdrom=/var/lib/libvirt/boot/w2003cd1.iso \ --disk path=/var/lib/libvirt/images/win2k3-br1.img,size=10 \ --disk path=/var/lib/libvirt/boot/virtio-win_x86.vfd,device=floppy \ --network=network:default,model=virtio

要将“监视器”附加到您的机器上,我使用带有ssh端口转发的vnc:

ssh user@[IP of KVM master] -L 5951:127.0.0.1:5951 then start a vnc client (I use vinagre) locally and connect to 127.0.0.1:5951

不要忘记下载Windows 2003 SCSI驱动程序( virtio-win_x86.vfd ),然后在安装开始前按F6 ,然后手动添加(真正的挑战是启动一台vnc客户端并按F6),否则安装将停留在还剩33分钟。

如果我使用qcow2磁盘映像格式( --disk path=/var/lib/libvirt/images/win2k3.qcow2,size=40,bus=virtio,format=qcow2 )安装也卡住了。