HELP Booting a Virtualbox Guest from a hard drive

Discussions related to using VirtualBox on Linux hosts.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

I have recovered the SSD from a damaged Windows 10 laptop and now my aim is to log-in in the user account that is stored on this SSD. I figured out that booting the OS on virtual box is a possibility but I haven't been able to successfully do it yet.
I followed the tutorial and documentation from www[dot]jamieweb[dot]net/blog/booting-a-physical-windows-10-disk-using-virtualbox-on-linux/ and www[dot]virtualbox[dot]org/manual/ch09.html#rawdisk but I have encountered a road block. It seems that not all of the partitions are mounted and or the guest cannot access all of the partitions.
The disk is multi-partitioned. Here is how it looks:
1m5YV3a.png
1m5YV3a.png (52.03 KiB) Viewed 4344 times
I also used the listpartitions command to try to manually mount all of the partitions.

Code: Select all

~$ VBoxManage internalcommands listpartitions -rawdisk /dev/sdaNumber  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x07  0   /32 /33  63  /221/30           500         2048
5       0x07  0   /1  /1   1023/254/63        121150      1028223
6       0x27  0   /19 /6   57  /112/41           450    249145344
And I used

Code: Select all

sudo vboxmanage internalcommands createrawvmdk -filename  /home/ssd3.vmdk -rawdisk /dev/sda -partitions 1,5,6
to create the raw disk.
But I get the following error message when trying to boot from it:
RiZA4jw.png
RiZA4jw.png (28.28 KiB) Viewed 4343 times
The fact that it says can't find winload.exe lead me to believe that virutalbox cannot access the partition that includes Windows itself. I manually checked and that file exists.
How can I overcome this issue and boot the Windows OS in virtualbox? This is a serious matter for me. I would really appreciate the help.
Last edited by mpack on 31. Aug 2021, 12:40, edited 3 times in total.
Reason: Replace offsite images with local attachments.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by mpack »

I'm not going to start parsing third party blogs.

Getting Win10 to boot should be relatively straightforward - it's far more forgiving of hardware changes than past Windows versions. Just image the disk using Disk2VHD then build a VM around the VHD. Try to make the VM recipe close to the old PC. Make sure that the VM has a working (NAT) network connection, as Windows will need it to fetch drivers.

You'd have to be a glutton for punishment if you wanted to throw a raw disk access fight into the mix as well. Virtualizing the drive requires disk space (not as much as you think), but then is far more reliable.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

I did what you said but ultimately, I encountered the exact same error. Is there a way to make Virtualbox mount all the partitions? Why can't the Windows bootloader access the Windows files? Could it possibly be because that the partition is mounted using a different letter and the mbr is not checking for other partitions?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by scottgus1 »

Did you image the entire drive? If not, it could be that picking partitions might leave something out. It should be possible to experiment later with recovering unneeded partitions' space or some such.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

Yes, I included all the 3 partitions. I believe that only the EFI bootloader is being loaded onto the system. If needed, I can provide whatever information needed to help make troubleshooting it easier.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by scottgus1 »

One thing I see in the data provided. Partitions 5 & 6 are under a partition 2, which looks to my unexperienced eye like four partitions, not 3, and maybe that's influencing the problem.

Please try again with Disk2VHD, and image all partitions, everything on the drive.

Or try the raw disk again, without the '-partitions 1,5,6'.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

scottgus1 wrote: Or try the raw disk again, without the '-partitions 1,5,6'.
That was the first thing I tired and it didn't work.
scottgus1 wrote:Partitions 5 & 6 are under a partition 2,
Yes sort of. This is what the partition table looks like:
BGMLopV.png
BGMLopV.png (51.65 KiB) Viewed 4343 times
When I tried to include the partition 2 using the rawdisk -partitions command, it gave an error message that it is not needed and possible to include this partition. Also in disk2vhd and the windows disk management app, only the 3 ntfs partitions are shown.
Last edited by mpack on 31. Aug 2021, 12:11, edited 1 time in total.
Reason: Replace offsite image with local attachment.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by mpack »

Did you enable EFI in the VM settings?

Most Win10 installations use UEFI and GPT partitions. If you don't enable the EFI setting then the GPT partitions will not be recognized correctly.

p.s. Attach images locally if you want us to see them.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

mpack wrote:Did you enable EFI in the VM settings?
I just did and I get the following screen:
(I added it to attachments but here is also a link to it)
https://i.imgur.com/pHn19eZ.png
mpack wrote:p.s. Attach images locally if you want us to see them.
I'll do that from now on. The forum was really making my life hard by not allowing me to post links up until now.
Attachments
Screenshot_20210831_102116.png
Screenshot_20210831_102116.png (16.91 KiB) Viewed 4355 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by mpack »

I have discarded your external image links and replaced them with local attachments.

Now that I've done so... Ok, it looks like the EFI setting was a mis-step. You should undo that. Also the third partition being split into two is not unknown, it's called an extended partition - i.e. it has a second partition map inside a primary partition. It's unusual to add that complexity when you don't need more than four partitions (*), but it's not invalid.

The Windows blue recovery screen is actually good news, it means you got past the BIOS boot and you reached the Windows boot manager, even though it tells you that recovery is needed. For recovery purposes I think you need the Windows RE (Recovery Environment) download.

If you are willing to retreat a bit further then here's another thing that might work. Download the Macrium Reflect (free edition) software and use that to make an image of your drive. Also get Macrium to create a bootable recovery disk for you, ideally as an ISO, which you'll use to boot the VM and restore the image into it. This might work because (a) Macrium recovery disks are actually based on Windows RE, (b) Macrium tries hard to ensure that the disk is bootable.

(*) Back in earlier DOS days there was a limit on the size of a volume of only 528MB or so. If you needed more you had to add more partitions. That limitation is long gone, and with it (for most) went the need the have large numbers of partitions.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

mpack wrote:I have discarded your external image links and replaced them with local attachments
I noticed that thank you.
mpack wrote:I think you need the Windows RE (Recovery Environment) download.
I am downloading a Win 10 ISO right now. I will try doing that.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by mpack »

Windows 10 ISO and Windows RE image are not the same.

That said, it's possible that a standard Win10 installer could offer to repair an existing installation... but make sure you have a backup of the VHD.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by mpack »

One more thing that someone ought to make sure you understand: you mentioned at the start that your goal was to boot this Win10 image. However if your real goal is to recover some files then you can do that much more easily by attaching the VHD to another working VM. Ideally a Windows VM since it has the best NTFS implementation.
taha_mct
Posts: 10
Joined: 30. Aug 2021, 08:25

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by taha_mct »

I want to access a file that is only accessible through the user account stored on the OS. I tried some tricks of moving the user account to a working Win 10 instance but I don't think that is possible. That's what I'm trying to do.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: HELP Booting a Virtualbox Guest from a hard drive

Post by scottgus1 »

If the disk is not encrypted then you should be able to attach the disk via USB adapter to a computer that can read NTFS. Then browse to the user folder. If you get a admini-privileges request, give admin access, then brose to the file and grab the file. Shouldn't need any Virtualbox.

If the disk is encrypted, then you have to get the disk's OS to boot.
Post Reply