Proper way to convert an existing xp machine to kvm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've been googling for the 'proper' way to migrate an existing windows
box to kvm, but so far, no joy, so I've taken a stab at it.  The old
box doesn't do a whole lot, so I'm looking to virtualize it, and then
shrink it to about 10G (from 250).

I use LVM on the vmserver.  So, first things first, I created a plenty
big space (300G) for the old server using system-config-lvm and called
it vmwindows.

Then, I copied the drive from the old server to the new server.  I
booted the ubuntu hardy live CD on the old machine, and then, from
that machine

cat /dev/sda | ssh -C vmserver "cat > /dev/vg/vmwindows"

Now, on the vmserver, I verify that the image is ok:

root@vmserver:/mnt# fdisk /dev/vg/vmwindows

The number of cylinders for this disk is set to 41610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/vg/vmwindows: 322.1 GB, 322122547200 bytes
240 heads, 63 sectors/track, 41610 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0xcab10bee

            Device Boot      Start         End      Blocks   Id  System
/dev/vg/vmwindows1   *           1       31129   235335208+   7  HPFS/NTFS
/dev/vg/vmwindows2           31131       32301     8852760    c  W95 FAT32 (LBA)

This is what I expected, in terms of the partitions.  The first
partition has the windows install.  The second is, I believe, a
recovery partition.

Also, I can mount this image:
 mount -o loop,offset=$((63*512)),rw /dev/vg/vmwindows  /mnt

root@vmserver:/mnt# ls -al WINDOWS/system32/hal.dll
-rwxrwxrwx 1 root root 131968 2004-08-03 22:59 WINDOWS/system32/hal.dll

After unmounting, I try to boot the image:
kvm -drive if=ide,boot=on,file=/dev/vg/vmwindows -name foo

Result (in a new window):

QEMU BIOS - build: 07/09/08
$Revision: 1.182
Options: apmbios pcibios eltorito rombios32

ata0 master: QEMU HARDDISK ATA-7 Hard-Disk ( 300 GBytes)
ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom

Booting from Hard Disk...

A disk read error occurred
Press Ctrl+Alt+Del to restart

Hmm, not good.  What am I doing wrong?

Thank you.

Regards,
Rich
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux