Page 1 of 1

Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 4. Jun 2017, 03:42
by FranceBB
Hi,
I've been successfully running Windows XP from another hard drive in my machine using VirtualBox.
Anyway, a friend of mine wants to use his install of Windows XP in his new computer (which doesn't work with XP).
It's a laptop and he has one single hard drive (1 TB).
I formatted it, installed Fedora 26 (one of the linux distros I'm familiar with)
and I cloned the old 80 GB PATA Disk to unallocated space of the new hard drive using EASEUS Partition Master.
So, now I have:

/dev/sda1 EFI Linux boot
/dev/sda2 Ext4 boot
/dev/sda3 LVM2
/dev/sda4 NTFS Windows XP (Clone)
/dev/sda5 Ext4 Data

I logged as root and I used the following command to make a vmdk to use in VirtualBox:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename /root/WinXP.vmdk -rawdisk /dev/sda -partitions 4 -relative
VirtualBox made two vmdk files itself, called "WinXP.vmdk" and "WinXP-pt.vmdk".
I can open and import as IDE disk the very first one (probably the second one it's just a file containing metadata that specify which partition to use).
Anyway, once I try to boot in VirtualBox, it says that there isn't any bootable partition.
Googling, I found out that it may be related to MBR, so I tried with:

Code: Select all

dd if=/dev/sda of=Fedora.mbr bs=512 count=1
and

Code: Select all

VBoxManage internalcommands createrawvmdk -filename /root/WinXP.vmdk -rawdisk /dev/sda -partitions 4 -mbr ./Fedora.mbr -relative
with no luck. (It does create the two vmdk files, but it doesn't start).

So... what now? It's not mandatory to boot Windows XP as rawdisk, I can convert it to a virtual machine file and my friend wouldn't mind (I think...).
Any suggestions?

Thank you in advance.

Re: Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 4. Jun 2017, 09:08
by mpack
Why?

Why does the XP image need to be in a host partition? Didn't you just say that the XP image can't run natively on this host? If it can't run physically then why would you install it on a physical partition?

I suggest trying the more obvious route: image the disk to a VDI, use the VDI in a normal VM.

Re: Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 4. Jun 2017, 13:17
by Perryg
Why are you running all of this as root? There is no real need to use root and permissions will be complicated.

Re: Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 5. Jun 2017, 04:26
by FranceBB
@mpack

Because I didn't install it, I just cloned the old hard drive to a partition (I mean, the whole hard drive, including Windows). Any suggestion about how to convert such partition to a VDI file in Fedora?

@Perryg

It was just a test and I didn't want VBox to complain about permission to use the vmdk to access the partition as rawdisk. (I don't use root account daily of course).

Re: Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 5. Jun 2017, 07:14
by socratis
FranceBB wrote:Any suggestion about how to convert such partition to a VDI file in Fedora?
You could try the Disk2VHD from former SysInternals, now Microsoft. I am not sure how well it will behave under Wine. You could then convert the VHD to VDI just because the former is really fragile.

Re: Boot Windows XP with Rawdisk from the same disk running Fedora

Posted: 5. Jun 2017, 11:00
by mpack
You should also search the forums for the previous discussions of this subject. The process is called a "physical to virtual migration", or P2V for short. So Google for "P2V site:forums.virtualbox.org".