Comment 19 for bug 586175

Revision history for this message
Andy Lee Robinson (andy-haveland) wrote :

Great solution Andreas, it worked for a Win2k image which I could only boot previously using an iso from http://www.resoo.org/docs/ntldr/files/

However, I have a w7 image that I have never managed to boot, apart from its installation cd image using virt-install

20Gb w7 image:

# losetup /dev/loop0 /vm/w7.img; kpartx -a /dev/loop0
# fdisk -l /dev/loop0

Disk /dev/loop0: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xaf12c11f

      Device Boot Start End Blocks Id System
/dev/loop0p1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/loop0p2 13 2611 20867072 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.

# hexedit /dev/mapper/loop0p1
00000000 EB 52 90 4E 54 46 53 20 20 20 20 00 02 08 00 00 00 00 00 00 00 F8 00 00 3F 00 10 00 00 08 00 00 .R.NTFS .............?.......
00000020 00 00 00 00 80 00 80 00 FF 1F 03 00 00 00 00 00 55 21 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................U!..............

# hexedit /dev/mapper/loop0p2
00000000 EB 52 90 4E 54 46 53 20 20 20 20 00 02 08 00 00 00 00 00 00 00 F8 00 00 3F 00 10 00 00 28 03 00 .R.NTFS .............?....(..
00000020 00 00 00 00 80 00 80 00 FF CF 7C 02 00 00 00 00 00 00 0C 00 00 00 00 00 02 00 00 00 00 00 00 00 ..........|.....................

# kpartx -d /dev/loop0; losetup -d /dev/loop0

I changed location 0x1a to 0xFF on one or other or both partitions and it still will not boot in virt-manager.

Cheers,
Andy.