Using vhdx file as storage device

Discussions about using Windows guests in VirtualBox.
Post Reply
atomtm
Posts: 5
Joined: 3. Jun 2018, 21:50

Using vhdx file as storage device

Post by atomtm »

Hello everyone!
I have tried to use a VHDX file as a storage device with no luck. I then used the "VBoxManage clonemedium" command to convert it to a VDI file, and that worked fine (seemingly). My problem now is that once I boot the machine I am getting the following error:
A disk read error occurred. Press Ctrl+Alt+Del to restart.
I booted the VM using Hiren's Boot CD, and I used the MBRCheck program, which told me:
MBRCheck, version 1.2.3
(c) 2010, AD

Command-iine:
Windows Version:          windows XP Professionai
Windows Information:      (build 2600) k
Logicai Drives Mask:      0x0080001e

\\.\B: -->  error 1
\\.\C: --> \\.\PhysicaiDriveo at offset 0x00000000‘00100000
\\.\D: --> \\.\PhysicaiDriveo at offset 0x00000000‘06500000 (NTFS)
\\.\X: --> \\.\PhysicaiDrive-1 at offset 0x00000000‘00000000 (NTFS)

      Size  Device Name           MBR Status
  ----------------------------------------------
    232 GB  \\.\PhysicalDrive0
            SHA1: 639AC5CDF8A5CF32459?5932C6A421545OA7B98F

Found non-standard or infected MBR.
Enter 'Y' and hit ENTER for more options, or 'N' to exit:
It seems that it is an MBR issue, but have no clue how to proceed.

Here's how the VHDX looks when I load it from within my Windows 10 host:
VHDX file (Disk 3) mounted on my Win 10 host
VHDX file (Disk 3) mounted on my Win 10 host
disks2.png (21.5 KiB) Viewed 5024 times
I can see the files on the F:\ drive no problem, but I would like to be able to make a VM out of this VDI.

Anyone with experience on that problem please send me some feedback, as this is very important for me. The VHDX is from a Win7 32-bit guest machine created with disk2vhd and now the physical disk is gone.

Thank you in advance
pt58
Posts: 52
Joined: 7. May 2015, 11:00

Re: Using vhdx file as storage device

Post by pt58 »

I have managed to do something similar.
This is how I achieved it:

1. Mount the VHDX file in Win10 as you have done already
2. Create a new Win7 VM in virtualbox. Make sure the vdi it creates is large enough to accommodate the files on the VHDX.
3. Install Daemon Tools lite V10 or higher. Using this, you can mount the vdi file which has been created.

This should now appear in the Win 10 Disk Manager as a raw disk.

You can now use a disk cloning program such as Macrium Reflect free to clone the mounted VHDX disk to the mounted vdi disk.

When the cloning has completed, remember to unmount the vdi file from the Daemon tools GUI before you try to run it in VirtualBox.

Hope this helps.
atomtm
Posts: 5
Joined: 3. Jun 2018, 21:50

Re: Using vhdx file as storage device

Post by atomtm »

Thank you for your feedback !
By mounting the vhdx file to Win10 there are two partitions mounted ( one is MBR and one is with windows system files) .In my case,I believe the one with MBR of the vhdx is corrupted.
If I understood correctly you re suggesting to clone the windows partition of the vhdx to the windows partition of the vdi file and leave the System Reserved partitions as is , correct ?
pt58
Posts: 52
Joined: 7. May 2015, 11:00

Re: Using vhdx file as storage device

Post by pt58 »

I would try cloning the whole disk - both partitions. The 100MB partition looks like it is the active partition which it will boot from. It should contain the boot files which then point to the Windows partition.
If the 100MB partition is corrupted you may be able to repair it with Macrium tools. I was mainly outlining a method of cloning the whole vhdx onto a vdi.
Incidentally, I have used this method of mounting a vdi using Daemon Tools to clone a physical hard drive mounted in a USB adapter directly to a vdi file.
atomtm
Posts: 5
Joined: 3. Jun 2018, 21:50

Re: Using vhdx file as storage device

Post by atomtm »

Ok understood.
My problem is not the conversion though. I have mounted the vhdx file to hyper-v and I got the same error. So I am guessing I have to fix the System Reserved partition.
Any input on this using macrium tools ?
pt58
Posts: 52
Joined: 7. May 2015, 11:00

Re: Using vhdx file as storage device

Post by pt58 »

Ok. I only just noticed that the 100MB partition is showing as RAW which probably means the file system has been corrupted.
This is really outside the scope of a VirtualBox issue and is more of a WIndows issue. You would need to use the same kind of tools to fix it that you would to fix a physical WIndows PC. If you have a Windows 7 disc or an ISO image of a Win 7 disc, you could try booting from that in Hyper-V to repair the VHDX or VirtualBox to repair the vdi.
atomtm
Posts: 5
Joined: 3. Jun 2018, 21:50

Re: Using vhdx file as storage device

Post by atomtm »

That is true ! I posted this in case someone had faced a similar issue with vhdx files .

I really appreciate your feedback anyhow
pt58
Posts: 52
Joined: 7. May 2015, 11:00

Re: Using vhdx file as storage device

Post by pt58 »

I just thought I'd explain why I came up with this seemingly convoluted way of converting a VHDX file to a vdi file.
It's a while since I wanted to do this and at the time the "VBoxManage clonemedium" didn't appear to work correctly with VHDX files. Even now, I'm not sure it's officially supported because I can't find any mention of it in the user manual.
Mpack's excellent 'clonevdi' program does seem to officially support VHDX files as input, so I guess that would be another option.

Mounting a vdi file using Daemon Tools can still be useful on occasions. It allows you to view the contents of or clone a vdi from within a Windows host.
As I mentioned, I have used it to clone an external USB mounted HDD into a vdi file which can then run in VirtualBox.
atomtm
Posts: 5
Joined: 3. Jun 2018, 21:50

Re: Using vhdx file as storage device

Post by atomtm »

Thanks for the input !
Post Reply