Load VHD?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Load VHD?

Post by Pyros2008 »

Basic question, can Virtualbox load a VHD file? I've got a clone I made from my primary to VHD using disk2vhd. Trying to point/add that file in Virtualbox and it is not seen. Is there a compatibility pack that I need or something I am missing?

I am choosing VHD because with Windows 8 Pro (or possibly 7 Ultimate) I will occasionally be booting to them directly.

Edit: The reason I am using VB is because of the drive size limitation with Windows VPC. I am not sure if this limitation carries to boot loading, guess I will find out. Was hoping I would be able to load with VB to avoid the size limitation.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Load VHD?

Post by mpack »

Yes, you can mount a VHD in a VirtualBox VM, however the virtual hardware is different so expect driver changes. Also I would convert the VHD to VDI format before I started using it, because VHD is not very robust. The easiest way to convert is probably using CloneVDI (see sticky at top of this forum).
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

Can you explain how to load one or link to a document? I have a premade VHD clone and all the options in VB arent seeing the file. Is there some setting I might be missing or additional plugin?

Really I don't need many features, just the basic ability to load virtually. Since VPC cannot load 64Bit OS, I have to load with third party software. In virtual mode, I will be testing random small apps. Booting directly, I will test games or larger apps. All VHD will have a backup so each time I plan to revert back to the original copy, not a continuous project. As I load applications onto my physical install I will update the clones.

I just cant figure out how to load in VB. Something probably glaringly obvious ...
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Load VHD?

Post by BillG »

I really can't follow what you are trying to do. A .vhd file is a virtual hard disk. Normally it is bootable, and you allocate it to a vm as its hard drive and boot it up.

If you simply want to read data from a .vhd file, you attach it as a second disk to a working vm (which has its own boot virtual hard drive). You can then access the .vhd the same way that you would access a additional hard drive in a computer.

If you simply want to extract data from a .vhd you can use a disk imaging program such as winimage on your host machine.
Bill
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

Ok, I have my main machine which has Windows 7 Ultimate 64-Bit installed. I've loaded all my drivers and software how I want and made a copy/clone to VHD using disk2vhd. Now, I want to be able to do two things with the VHD:

First, I want to be able to load the VHD in VirtualBox (currently running on my main machine/main install). The reason I am using VirtualBox instead of Windows VirtualPC is because it is my understanding that VPC does not run 64-Bit OS. It's also my understanding that VirtualBox can run both 64-Bit and VHD, making it my first choice. I will be using this method as a test environment for new small apps.

Second, I want to boot live from the VHD using native features of Windows 7 Ultimate. Because this is booting directly from the VHD and loading actual drivers, this would work for testing large games or driver dependent applications.

In both situations, the VHD files will simply be test environments. After testing apps, I will revert to a copy of the last VHD to mirror my main machine. I could use snapshot or other features to revert or not save but I wasn't sure what options would be available going with VHD.

Converting VHD to VDI or any other format wouldn't suit my needs for booting live using Windows 7. I know very little about PXE/TFTP servers so I wanted to avoid that route for now. However, that would allow me to use other file formats I would assume. The main goal is to be dynamic, being able to load virtually or boot live.
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Load VHD?

Post by BillG »

I am afraid that you are mistaken about how virtualization works. Your physical machine does not boot from the .vhd file. You have to create a virtual machine, tell the setup program to use the existing .vhd as the virtual hard drive for this machine, then boot the vm. The vm does not see the physical devices in the host machine, so your drivers are useless. It sees the devices in the virtual machine.

Perhaps you are confusing virtualization with the option in Window7/8 to boot from a .vhd file? This has nothing to do with virtualization. The physical machine boots from the .vhd file instead of from its HDD. You have to reboot to get from one OS to the other. This is quite different from virtualization. A vm runs at the same time as the host OS and you can switch from one to the other.
Bill
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

Hey Bill, I know you're trying to help here but I am not sure whats getting lost or how to better explain.

I understand the machine itself will not see the VHD file to boot via the BIOS. I also understand that Windows 7 has the feature to boot the VHD, which is why I said that in my reply.

The ONLY thing I am asking here is how to load ANY VHD file with VirtualBox. So, I am in Windows 7 right now and have Virtual Box installed and running. I have my VHD file already created using disk2vhd. How do I load the VHD in VirtualBox? In VirtualBox, when I point to the folder that has the VHD, the file is not seen.

Edit: Are you saying that I have to load the VHD file as a VM for VB to even see it? If that is the case, wouldn't loading the VHD as a VM in Windows 7 still limit to a 32-Bit OS and completely defeat my entire goal here?
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Load VHD?

Post by BillG »

VirtualBox is just an application program. You do not load files for it to read. A .vhd file is just a file in the file system on your Windows 7 PC. There are no programs on your PC which can read it, unless you have an imaging program like Winimage.

On the other hand, a virtual machine can read a .vhd file. To a vm, the .vhd file looks like hard drive.

If you want to create a vm to boot from your converted .vhd file, start the VirtualBox program, and from the VirtualBox Manager screen create a new virtual machine. When you reach the stage in the wizard where you are setting up the hard drive, select the option to use an existing virtual hard drive, browse to your .vdi file and select it.
Bill
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

Sorry, I am new to this and think I have been confusing terms. Yes, I have tried to create a vm using vb, however VB does not see the VHD file under "Use existing hard disk."

Maybe the VHD didn't clone properly. It was recommended that I try disk2vhd but noticed it seems outdated. Maybe there is a better alternative out there to clone primary to 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: Load VHD?

Post by mpack »

If you want help for a problem then please give precise error messages - not "VB does not see the VHD file". Give an exact description of what you tried to do, and what error messages you have seen, if any.
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

There is no error message, it simply does not see VHD files. I tried creating a couple from scratch with Windows VPC and they weren't seen either. That's why I post this question, without an error, it appears VB doesn't support the file type. As you two are indicating though, it should.

I've tried reinstalling and using different VHD files (several from different sources) but none are seen in VB.
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Load VHD?

Post by Martin »

You still didn't tell us what and where you were doing/clicking/selecting to come to a point where "Vbox doesn't see 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: Load VHD?

Post by mpack »

Plenty of VirtualBox users use VHDs (despite my urging otherwise). No one else has reported what you say, although I'm still not sure what you mean by "it simply does not see VHD files" - the expression is simply too vague to do anything with.
 Edit:  If you have some kind of notion that the file menu in VirtualBox can "open" VHD files and let you browse through the contents - well you can forget that idea. VirtualBox creates and runs virtual machines - VHD and other disk images are present as data, not something which the user manipulates directly.

If you want to browse VHD files then try PowerISO, I know it supports VDI, so I assume it will support VHD as well. 
Pyros2008
Posts: 9
Joined: 26. Aug 2012, 06:06

Re: Load VHD?

Post by Pyros2008 »

I honestly don't know how else to describe the issue. It's really as simple as VB cannot use any VHD file I have. It really doesn't matter how you flip that statement, I tried the instructions here and it still doesn't see the file. Creating a VM, looking up independant, it doesnt matter ... the file is not seen.

Thanks for the help but I am moving on. No one seems to understand what I am asking so I guess it's just me...
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Load VHD?

Post by Martin »

So you have this VHD in some directory on your harddisk and it is visible in Windows Explorer.
Then you start Vbox, create a new VM and in the file selection dialog for "use existing harddisk" that VHD is not visible to select?
Post Reply