Boot Windows XP with Rawdisk from the same disk running Fedora

Discussions related to using VirtualBox on Linux hosts.
Post Reply
FranceBB
Posts: 143
Joined: 20. May 2017, 05:07
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows XP x86
Contact:

Boot Windows XP with Rawdisk from the same disk running Fedora

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

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

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post by Perryg »

Why are you running all of this as root? There is no real need to use root and permissions will be complicated.
FranceBB
Posts: 143
Joined: 20. May 2017, 05:07
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows XP x86
Contact:

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

Post 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).
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

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

Post 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.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

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

Post 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".
Post Reply