LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Converting Xen RAW image to KVM qcow2 makes Win2k8 guest BSOD (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/converting-xen-raw-image-to-kvm-qcow2-makes-win2k8-guest-bsod-841719/)

Savaan 11-01-2010 12:46 PM

Converting Xen RAW image to KVM qcow2 makes Win2k8 guest BSOD
 
I recently got a Xen server running on CentOS 5.5 with GPLPV drivers but now I would like to migrate to KVM and would rather not have to rebuild the guest OS. My image works great when using the Xen. I used a similar procedure to move a CentOS guest and that guest came up with no problems at all. It's just the Windows guest that is causing me grief.

I removed the GPLPV drivers and disabled Windows Test Mode then shutdown the guest. After I convert the image to qcow2 and create the QEMU guest windows boots to the Boot Menu but I cant get much further. Safe Mode and other selections dont seem to help. No mater what I select it boots Windows Server 2008 to System Recovery Options GUI. It then will give a DRIVER_IRQ_NOT_LESS_OR_EQUAL blue screen at some random point in the recovery gui.

Host info is:
CentOS 5.5 Linux 2.6.18-194.17.4.el5 #1 SMP x86_64
kvm-tools-83-164.el5_5.21
kvm-83-164.el5_5.21
kvm-qemu-img-83-164.el5_5.21
libvirt-0.6.3-33.el5_5.3
libvirt-0.6.3-33.el5_5.3
libvirt-python-0.6.3-33.el5_5.3
virt-manager-0.6.1-12.el5
virt-viewer-0.0.2-3.el5

The guest is Windows Server Enterprise 2008 x64 with all current windows updates applied.


Command used to convert the raw image to qcow2.
# qemu-img convert /var/lib/xen/images/ws4.img -O qcow2 /var/lib/libvirt/images/ws4.img

Command used to create the guest.
# virt-install qemu:///system -n ws4 -r 1024 --vcpus=2 --os-type=windows --os-variant=win2k8 --disk path=/var/lib/libvirt/imag
es/ws4.img --import

My /etc/libvirt/qemu/ws4.xml to after adding a display.
Code:

<domain type='qemu'>
  <name>ws4</name>
  <uuid>b01bde5c-969d-95ad-4383-321c17abcc33</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='x86_64' machine='rhel5.4.0'>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>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/var/lib/libvirt/images/ws4.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <mac address='54:52:00:67:b2:84'/>
      <source network='default'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/5'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/5'>
      <source path='/dev/pts/5'/>
      <target port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='sdl' display=':1.0' xauth='/root/.Xauthority'/>
  </devices>
</domain>



Any suggestions would be greatly appreciated. Thanks

KenJackson 12-20-2011 04:57 PM

Did you get this to work?

Savaan 12-21-2011 10:10 AM

I don't believe I did. It was over a year ago and I don't recall exactly. I believe I had to reload the Windows OS from scratch on KVM to resolve this.

dyasny 12-24-2011 06:20 AM

Why didn't you use virt-v2v for this?

The BSOD is there because your windows VM is expecting the same disk controller as Xen was presenting, while KVM uses another controller. virt-v2v solves this issue by editing the image and replacing the controller driver before the VM is started under KVM.

You could do that manually, but it will require some registry hacking

KenJackson 12-24-2011 08:03 AM

Quote:

Originally Posted by dyasny (Post 4557525)
virt-v2v solves this issue by editing the image and replacing the controller driver before the VM is started under KVM.

Ah! I'm hoping this may solve my problem too.

But oh, good grief. I'm just now installing virt-v2v, and yum is pulling in 26 other packages, including libvirt itself.

I didn't plan to use libvirt. I'm not a fan of automation when the automation makes my decisions for me. I like to start, control and stop my virtual machines and most everything else with custom scripts that I write to do the limited subset of things that I need to do in the way I want to do it.

I hope I can convince virt-v2v to just do the conversion and leave me alone. Do you know if that's an option?

dyasny 12-24-2011 09:44 AM

it definitely is, though I do not share your dislike for management frameworks

KenJackson 12-28-2011 05:35 PM

Quote:

Originally Posted by KenJackson (Post 4557563)
I hope I can convince virt-v2v to just do the conversion and leave me alone. Do you know if that's an option?

Quote:

Originally Posted by dyasny (Post 4557589)
it definitely is, ...

I don't think virt-v2v is goint to work.

I want to specify a disk image and let it modify it. But it wants either a libvirt or libvirtxml input method. I don't have any method. I just have a disk image.

It also allows specifiying -ic URI for an input connection. But my disk image is just a file.

Am I missing something?
How can I just modify my VirtualBox disk image to boot under KVM?

Savaan 12-29-2011 02:04 PM

virt-v2v isnt used with VirtualBox from what I have read. It's the wrong tool for you.

Is your virtualbox disk already converted to a raw image file format? If not here is a example,
$ VBoxManage clonehd --format RAW TestVM.vdi TestVM.raw
Then just create a new VM (since you dont have any previous config for your drive image) using VirtManager or 'virsh create' command and attach your new TestVM.raw as your hard drive.

If you get a BSOD because of the controller at this point then I dont have an answer. I personally would reload the OS on a fresh VM guest with a fresh disk. Then attach the old VirtualBox image as a secondary drive such as D: and copy the necessary data from it. I found that even when images import correctly you have to reactivate Windows Server anyway. I assume this is because the CPU type changes but that's just a guess.

In regards to the -ic URL question. It's the Xen source URL. Since you dont have Xen up and running you cant enter anything in here. Like I said above you probably just need to create a new VM guest.

KenJackson 12-31-2011 10:51 AM

Quote:

Originally Posted by Savaan (Post 4561148)
Like I said above you probably just need to create a new VM guest.

Just

I fear you are right, but the whole point of this exercise is to avoid that.

A new VM means a fresh install of Windows. That's hassle enough, but worse, it means reactivation. That means begging Microsoft for permission to continue using the same instance of Windows I've been using right along without paying for a new license.

I sure hope ReactOS gets good enough to handle the few things I need Windows for. I've actually donated money toward that end.

dyasny 12-31-2011 12:59 PM

right. virt-v2v does not support working with an image, it is designed to move VMs from ESXi and Xen, enterprise level virtualization, not a small desktop kind of thing. I did mention it though, because it is the only product that knows how to do this and is open. Since it is open, there's nothing to stop you from reviewing the code and extending the tool to be able to deal with vbox or standalone images, the major part of the work is already done after all


All times are GMT -5. The time now is 08:48 PM.