Hi, I am trying to convert a VM Ware Fusion/Player working Virtual Machine with Windows XP to XEN. I recieved some car service manuals in that format and refuse to buy VMWare fusion or make VMWare player work on Ubuntu 12.04, this is a nightmare, and I have a server for my VM''s running XEN, this is just perfect, so why not as well for this WinXP VMs with the service manuals on? I converted the VMDK disk to a physical device using qemu-img convert smart.vmdk -O raw /dev/mapper/vol0-domU-smart. my cfg file for the domU-smart: ------------------ builder=''hvm'' name="domU-smart" memory=512 vcpus=2 #disk=[''phy:/dev/vol0/domU-smart,hda,w'',''file:/root/odin2/multimedia/prg/trinity-rescue-kit.3.4-build-367.iso,hdc:cdrom,r''] #disk=[''phy:/dev/vol0/domU-smart,hda,w'',''file:/root/odin2/multimedia/prg/win/xp_pro_sp2.iso,hdc:cdrom,r''] #disk=[''phy:/dev/vol0/domU-smart,hda,w''] disk=[''file:/home/sp/Mercedes_2012_WSM/VM/Mercedes_2012_WSM.img,hda,w''] vif=['' ''] boot="c" vfb=[''type=vnc''] ----------------- then I ran "xm create domU-smart" Trying to boot showed me a: "Booting from Hard Disk..." "Error loading operating system_" Next I tried to repair the MBR and boot sectors: - win XP bootcd as img and boot from CD works fine, but the XP install was protected with a admin password => couldn''t start the rescue mode - then I used trinity rescue to remove the admin password, worked fine, could start rescue mode from XP disk :-) - fixmbr and fixboot got called Still same boot result: "Booting from Hard Disk..." "Error loading operating system_" Then I checked manually the first sector of the harddisk with hexedit and it seems ok regarding the partitioning and the position of the boot sector. The only strange thing seems that the disk has following fdisk parameters with 56 sectors/track instead of 63 like in the other examples I found on the net for Win XP: Disk /dev/mapper/vol0-domU--smart: 26.8 GB, 26843545600 bytes 255 heads, 56 sectors/track, 3671 cylinders, total 52428800 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x130b130a Device Boot Start End Blocks Id System /dev/mapper/vol0-domU--smart1 * 56 52407599 26203772 7 HPFS/NTFS/exFAT could this be some trick to make the VM not working with other than VMWares VM platforms? Well I am stuck, somebody can help me?
On Thu, 2013-05-30 at 22:57 +0200, Stefan Pielmeier wrote:> Hi, > > I am trying to convert a VM Ware Fusion/Player working Virtual Machine with Windows XP to XEN. > I recieved some car service manuals in that formatWhat a strange way to distribute documentation!> and refuse to buy VMWare fusion or make VMWare player work on Ubuntu > 12.04, this is a nightmare, and I have a server for my VM''s running > XEN, this is just perfect, so why not as well for this WinXP VMs with > the service manuals on? > > I converted the VMDK disk to a physical device using qemu-img convert smart.vmdk -O raw /dev/mapper/vol0-domU-smart. > > my cfg file for the domU-smart: > ------------------ > builder=''hvm'' > name="domU-smart" > memory=512 > vcpus=2 > #disk=[''phy:/dev/vol0/domU-smart,hda,w'',''file:/root/odin2/multimedia/prg/trinity-rescue-kit.3.4-build-367.iso,hdc:cdrom,r''] > #disk=[''phy:/dev/vol0/domU-smart,hda,w'',''file:/root/odin2/multimedia/prg/win/xp_pro_sp2.iso,hdc:cdrom,r''] > #disk=[''phy:/dev/vol0/domU-smart,hda,w''] > disk=[''file:/home/sp/Mercedes_2012_WSM/VM/Mercedes_2012_WSM.img,hda,w''] > vif=['' ''] > boot="c" > vfb=[''type=vnc''] > ----------------- > then I ran "xm create domU-smart" > > Trying to boot showed me a: "Booting from Hard Disk..." "Error loading operating system_" > > Next I tried to repair the MBR and boot sectors: > - win XP bootcd as img and boot from CD works fine, but the XP install was protected with a admin password => couldn''t start the rescue mode > - then I used trinity rescue to remove the admin password, worked fine, could start rescue mode from XP disk :-) > - fixmbr and fixboot got called > > Still same boot result: "Booting from Hard Disk..." "Error loading operating system_" > > Then I checked manually the first sector of the harddisk with hexedit and it seems ok regarding the partitioning and the position of the boot sector. The only strange thing seems that the disk has following fdisk parameters with 56 sectors/track instead of 63 like in the other examples I found on the net for Win XP: > > Disk /dev/mapper/vol0-domU--smart: 26.8 GB, 26843545600 bytes > 255 heads, 56 sectors/track, 3671 cylinders, total 52428800 sectors > Units = sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disk identifier: 0x130b130a > > Device Boot Start End Blocks Id System > /dev/mapper/vol0-domU--smart1 * 56 52407599 26203772 7 HPFS/NTFS/exFAT > > could this be some trick to make the VM not working with other than > VMWares VM platforms?More likely to just be unfortunate rather than deliberate. I think (although I''m by no means sure) that the sectors/track thing is a property of the block device (i.e. the LVM volume) and not part of the partition table or held as data on the disk itself etc. I have no idea if/how you can control this and since its a logical volume it is likely to be completely fictional anyway (so I''m a little surprised to see they aren''t just 63 too). How did you create this LVM volume? In a recent kernel source tree I can see a DM_DEV_SET_GEOMETRY_CMD ioctl, which appears to have a bearing on the result of asking the device for its geometry. Google isn''t finding any references for what tool uses it though, but it might be worth following up a bit more.> Well I am stuck, somebody can help me?You could try enabling guest logging (guest_loglvl=all on your hypervisor command line) and see if the HVM BIOS debugging which gets dumped to the Xen dmesg contains any hints. Ian.
On Fri, May 31, 2013 at 3:57 AM, Stefan Pielmeier <stefan@symlinux.com> wrote:> Hi, > > I am trying to convert a VM Ware Fusion/Player working Virtual Machine with Windows XP to XEN. > I recieved some car service manuals in that format and refuse to buy VMWare fusion or make VMWare player work on Ubuntu 12.04, this is a nightmare, and I have a server for my VM''s running XEN, this is just perfect, so why not as well for this WinXP VMs with the service manuals on? > > I converted the VMDK disk to a physical device using qemu-img convert smart.vmdk -O raw /dev/mapper/vol0-domU-smart.Yeah, that is known not to work.> Then I checked manually the first sector of the harddisk with hexedit and it seems ok regarding the partitioning and the position of the boot sector. The only strange thing seems that the disk has following fdisk parameters with 56 sectors/track instead of 63 like in the other examples I found on the net for Win XP: > > Disk /dev/mapper/vol0-domU--smart: 26.8 GB, 26843545600 bytes > 255 heads, 56 sectors/track, 3671 cylinders, total 52428800 sectors > Units = sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disk identifier: 0x130b130a > > Device Boot Start End Blocks Id System > /dev/mapper/vol0-domU--smart1 * 56 52407599 26203772 7 HPFS/NTFS/exFAT > > could this be some trick to make the VM not working with other than VMWares VM platforms? > > Well I am stuck, somebody can help me?What I usually do: - make sure the XP image has IDE drivers installed - create a new virtual harddisk, partition it for windows and set the boot flag active - copy data with ntfsclone - run ntfsreloc (bundled on sysrescuecd, or you can compile your own) to adjust filesystem geometry for a NTFS partition on the new partition You should then be able to use it on Xen if you use the same ACPI and APIC settings as whatever you had on vmware. -- Fajar
On Tue, 2013-06-04 at 16:33 +0700, Fajar A. Nugraha wrote:> What I usually do: > - make sure the XP image has IDE drivers installed > - create a new virtual harddisk, partition it for windows and set the > boot flag active > - copy data with ntfsclone > - run ntfsreloc (bundled on sysrescuecd, or you can compile your own) > to adjust filesystem geometry for a NTFS partition on the new > partitionI don''t suppose we could impose on you to write a short "HOWTO import from VMDK" or similar doc on the wiki could we? Please be aware that due to an ongoing SPAM attack we are having to manually give new users write permissions. Either mail me your Xen wiki user name or ask on freenode #xendocs where someone will take care of you. Thanks, Ian
Hi guys, now thanks for bothering ;-) I went a few steps longer and it seems like all comes down to the partition table and the NTFS entries in the boot sector of the actual NTFS partition. Changing some of the values in order to get anything look like a 63 sectors/track harddisk, I get longer now. Now it isn''t the MBR any longer that casts an error, now the Windows XP system really tries to start up, even showing the typical "safe mode/normal startup" joice as a first screen. However, whichever option I choose, I get a blue screen for 1/2 of a second and then the VM crashes; yes: xm list shows that the vm has stopped by itselv. Ok, next steps I will try: 0) try out ntfsreloc on my currently nearly running virtual disk; if that doesn''t work: 1) Fajar''s approach to copy the ntfs content manually with nfsclone 2) and relocate the NTFS partition You''ll hear from me. Best regards, Stefan. Stefan Pielmeier email:stefan@symlinux.com On 4 Jun 2013, at 11:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:> On Tue, 2013-06-04 at 16:33 +0700, Fajar A. Nugraha wrote: >> What I usually do: >> - make sure the XP image has IDE drivers installed >> - create a new virtual harddisk, partition it for windows and set the >> boot flag active >> - copy data with ntfsclone >> - run ntfsreloc (bundled on sysrescuecd, or you can compile your own) >> to adjust filesystem geometry for a NTFS partition on the new >> partition > > I don''t suppose we could impose on you to write a short "HOWTO import > from VMDK" or similar doc on the wiki could we? > > Please be aware that due to an ongoing SPAM attack we are having to > manually give new users write permissions. Either mail me your Xen wiki > user name or ask on freenode #xendocs where someone will take care of > you. > > Thanks, > Ian > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Status update: - I tried to fix my existing qemu-img converted partition with ntfsreloc, but even if my whole disk geometry is errorless according to testdisk now, and the 2 boot records function well, Windows shows a bluescreen after offering me safe mode, etc. - so now I start fresh with Fajar''s method, and some questions arise: /1/ make sure the XP image has IDE drivers installed: - the boot/OS disk is SCSI => maybe the IDE drivers are missing. - in VMWare Fusion, I created a 1GB IDE harddisk and the new IDE disk is formatted and working in WinXP => now the drivers should be ok /2/ create a new virtual harddisk, partition it for windows and set the boot flag active - I suppose, that this step is done by following: - lvcreate -L25G -n domU-winxp vol0 [where vol0 is my volume group and 25G the size of the disk] - then run fdisk /dev/vol0/domU-winxp and a) create a dos partition table with the ''o'' command, write changes to disk with ''w'' b) but: when I try to create the windows partition with ''np1'', the start sector cannot be chosen to be 63 but minimum must be 2048! I set the type to 0x07 with the ''t'' command and make it bootable with the ''a'' command. I get: Disk /dev/vol0/domU-winxp: 26.8 GB, 26843545600 bytes 255 heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xd02fe7f2 Device Boot Start End Blocks Id System /dev/vol0/domU-winxp1 * 2048 52428799 26213376 7 HPFS/NTFS/exFAT Then write the whole stuff with ''w'' command. - I run ''partprobe /dev/vol0/domU-winxp'' to sync the kernel to the new disk partition /3/ copy data with ntfsclone - here it get''s tricky. I suppose that I shall use ntfsclone inside the VM when booting from the sysrescuecd? - then, I would store the ntfscloned NTFS partition to a file, I guess, maybe a shared drive I can mount when in the systemrescuecd operating system? - that I did, using sshfs I mounted a external drive in the systemrescuecd environment and used following command to clone my WinXPBoot partition: ntfsclone -s --output /mnt/backup/winxp.img /dev/sdb1 - when that was done, I booted the new XEN HVM with sysrescuecd and the newly created /dev/vol0/domU-winxp - in sysrescuecd environment, I connect via sshfs to the same shared drive to access my winxp.img file also from there - using ntfsclone again, I put the winxp.img onto the newly created partition which still starts at sector 2048: ntfsclone -r --overwrite /dev/xvda1 /mnt/backup/prg/winpx.img /4/ run ntfsreloc (bundled on sysrescuecd, or you can compile your own)>> to adjust filesystem geometry for a NTFS partition on the new >> partition- I do this in the sysrescuecd environment: ''ntfsreloc -s 63 -w -p /dev/xvda1'' and I get: heads sectors start partition: 255 63 2048 filesystem: 255 56 56 backup sector:255 56 56 target: 255 56 63 done! - ah well, that doesn''t look too good. As I said earlier, the original SCSI disk under VMWare has 56 sectors/track ... and it seems that using ntfsclone didn''t remove such adjustments. - however, I followed Fjar''s hints, so now I give it a try: of course, the system cannot boot, as I didn''t install a MBR, jet. This is obviously missing. Fajar: how do you normally get the MBR installed and do your conversions from SCSI to IDE also lead to these problems with 56 -> 63 sectors issues? Which kind of software is good to get the NTFS from 56 to 63, or maybe this is not necessary? Still a bit lost, Stefan. On 4 Jun 2013, at 11:39, Ian Campbell <Ian.Campbell@citrix.com> wrote:> On Tue, 2013-06-04 at 16:33 +0700, Fajar A. Nugraha wrote: >> What I usually do: >> - make sure the XP image has IDE drivers installed >> - create a new virtual harddisk, partition it for windows and set the >> boot flag active >> - copy data with ntfsclone >> - run ntfsreloc (bundled on sysrescuecd, or you can compile your own) >> to adjust filesystem geometry for a NTFS partition on the new >> partition > > I don''t suppose we could impose on you to write a short "HOWTO import > from VMDK" or similar doc on the wiki could we? > > Please be aware that due to an ongoing SPAM attack we are having to > manually give new users write permissions. Either mail me your Xen wiki > user name or ask on freenode #xendocs where someone will take care of > you. > > Thanks, > Ian > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
It''s been a while since I''ve migrated XP, but here goes from memory: On Wed, Jun 5, 2013 at 9:34 PM, Stefan Pielmeier <stefan@symlinux.com> wrote:> b) but: when I try to create the windows partition with ''np1'', the start > sector cannot be chosen to be 63 but minimum must be 2048!That is fine.> /3/ copy data with ntfsclone > - here it get''s tricky. I suppose that I shall use ntfsclone inside the VM > when booting from the sysrescuecd?That''s one way. Another way would be to use kpartx.> - I do this in the sysrescuecd environment: > ''ntfsreloc -s 63 -w -p /dev/xvda1'' and I get:I''m pretty sure the only parameter to pass is "-w and the partition". No need for other manual adjustments.> Fajar: how do you normally get the MBR installedsyslinux (or syslinux-common, if on Ubuntu or similar) has /usr/lib/syslinux/mbr.bin. Just write it with dd.> and do your conversions > from SCSI to IDE also lead to these problems with 56 -> 63 sectors issues?It should not matter. When run from the live environment (e.g. sysrescuecd on HVM), it will adjust the sectors to whatever it detects. -- Fajar