Use Physical disk

Here you can provide suggestions on how to improve the product, website, etc.
KarlWa
Posts: 1
Joined: 4. Jan 2009, 02:55

Use Physical disk

Post by KarlWa »

Hi,

I downloaded VBox as an alternative to VMWare, but it appears that VBox doesn't support using raw partitions to store VMs. I use this quite a lot, as I have a Mac and have Windows installed on an alternate partition. I occasionally come across something that I need Windows for and start a VM, and other times I need to boot in to Windows native.

Using the physical disk is the only real option here (other than having 2 installations, but that's overkill).

Thanks, Karl

P.S: I did search around here and found the command line tool. Didn't work on OSX (VERR_DEV_IO_ERROR with sudo). The VMDK that VMWare was using doesn't work either. Hence I don't believe the feature exists. Either I'm right or it's seriously badly exposed.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

You can use raw disks. I do on my dual boot XP config. You can use VMDKs. Please read the documentation before making "assertions".
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
aquarius
Posts: 69
Joined: 3. Jun 2008, 22:35
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: MS Windows XP

Post by aquarius »

Unfortunately this feature is still broken or almost unusable on OS X.
See this bug ticket for status and a possible workaround.
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

TerryE wrote:You can use raw disks. I do on my dual boot XP config. You can use VMDKs. Please read the documentation before making "assertions".
I have managed to get my physical disk recognized in VBox but now I have run into a problem. I would like to take a virtual image that I already have and migrate it to the physical disk. I cannot seem to find a way to do this. Did you do this by chance?

I also tried installing XP on the drive. It seemed to work but when I rebooted, the drive would not boot. Did you have this problem?

David
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Yup read my tutorial All about VDIs on how to copy partitions disk to disk. Also you need to set up your virtual MBR in your raw VMDK since the VM will use this to boot. This is covered in my tutorial and other posts if you want to search for fixmbr or MBR.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
stephanecharette
Volunteer
Posts: 300
Joined: 10. Nov 2007, 22:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu-64bit, Windows
Location: Kelowna, British Columbia, Canada
Contact:

Post by stephanecharette »

TerryE wrote:You can use raw disks. I do on my dual boot XP config. You can use VMDKs. Please read the documentation before making "assertions".
<offtopic>

An example of a product first-impression and/or evaluation based on what the GUI provides.

This is not surprising -- since the 1980s people have been getting used to starting GUIs to see what an application can do, and command-line or config file editing for tweaking specific settings, not for accessing large features.

At a previous company where I worked, it was understood that a feature didn't officially exist until the GUI supported it. This wasn't the rule, it was simply what we'd observed and feedback from our customers.

Stéphane
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

TerryE wrote:Yup read my tutorial All about VDIs on how to copy partitions disk to disk. Also you need to set up your virtual MBR in your raw VMDK since the VM will use this to boot. This is covered in my tutorial and other posts if you want to search for fixmbr or MBR.
How do you deal with the drive number changing on different machines or with different devices attached? For instance, when my laptop is in the port replicator at work I have a USB hub installed with 4 drives. When I attached my physical drive, it is drive 5. When I disconnect the laptop from the replicator, thus no longer using the usb hub, the physical drive is now 1. uugghh! Is there some way I can fix this drive as drive 1 always?

David
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Physical drive enumeration is a Windows property and not one that VBox can control. All that I can think of are botches, such as having two VMDK containers (one for each location) and wrapping the startvm in a script which detects whether your disk is 1 or 5.

However, this would get hopelessly confused if you savestate your VM then undocked the laptop.

What's the advantage of physical partitions anyway?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

TerryE wrote:Physical drive enumeration is a Windows property and not one that VBox can control. All that I can think of are botches, such as having two VMDK containers (one for each location) and wrapping the startvm in a script which detects whether your disk is 1 or 5.

However, this would get hopelessly confused if you savestate your VM then undocked the laptop.

What's the advantage of physical partitions anyway?
I have a usb drive that I am wanting to take between work and home. I need to have some software installed and be able to run it both at work and home. That is why I decided to try it this way.

David
stephanecharette
Volunteer
Posts: 300
Joined: 10. Nov 2007, 22:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu-64bit, Windows
Location: Kelowna, British Columbia, Canada
Contact:

Post by stephanecharette »

Couldn't you use VDI files and simply put your vdi file on the USB stick?

Stéphane
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

stephanecharette wrote:Couldn't you use VDI files and simply put your vdi file on the USB stick?

Stéphane
I wanted to be able to access the usb drive without loading vbox and I thought the performance would be better. I actually have an esata interface for the drive that I will try to use. Not sure what problems that will cause but this is mostly an experiment.

David
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

Well, my planned failed miserably. I closed VBox and then connected the drive to my laptop directly and just browsed the directories. When I reconnected the drive to VBox, I get a BSOD. I tried to attach it to another vm, it recognizes the drive but says it is unformatted. I can still attached to my laptop and see the filesystem, even copy a file to it. I disconnected it and reconnected it, file still there.

I am not sure what happened or how to fix this problem yet, but I am investigating it.
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

dmonder wrote:Well, my planned failed miserably. I closed VBox and then connected the drive to my laptop directly and just browsed the directories. When I reconnected the drive to VBox, I get a BSOD. I tried to attach it to another vm, it recognizes the drive but says it is unformatted. I can still attached to my laptop and see the filesystem, even copy a file to it. I disconnected it and reconnected it, file still there.

I am not sure what happened or how to fix this problem yet, but I am investigating it.
OK, I find this very weird. I can no longer use my hard drive via VBox as it thinks the drive is corrupt (chkdsk gives up at about 40% stating an unrecoverable error). However, I checked it from my physical machine and the drive is fine (it is recognized as NTFS and no errors are found on the drive). Any idea how I might figure out what is wrong?

David
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Checking the file on your host will pick up physical problems with your HDD and corruption of the container file. The issue is whether the contents of the VDI is corrupt, and the thing that could cause serious problems is when the block index in the file is partially updated. This rarely happens but it can happen if file systems are brought offline and then remounted in another VM when the first is suspended rather than shut down properly. Exactly the sort of failure that could occur when swapping a USB with VDIs on it between machines.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
dmonder
Posts: 8
Joined: 7. Jan 2009, 21:40

Post by dmonder »

TerryE wrote:Checking the file on your host will pick up physical problems with your HDD and corruption of the container file. The issue is whether the contents of the VDI is corrupt, and the thing that could cause serious problems is when the block index in the file is partially updated. This rarely happens but it can happen if file systems are brought offline and then remounted in another VM when the first is suspended rather than shut down properly. Exactly the sort of failure that could occur when swapping a USB with VDIs on it between machines.
Actually, this is a physical harddrive (attached via USB for the moment) that I was able to get setup in VBox as a VMDK according to the instructions on the website. I was using the drive in VBox fine until I shut it down and closed VBox. I then browsed the drive on my local machine and then restarted VBox. The drive has not booted since. I get an error upon boot that indicates there might be something wrong with the drive and to check it with chkdsk but in VBox, it indicates an unrecoverable error and quits. On my local box, chkdsk says the drive has no errors. I have been unable to find any information on the web that might help me resolve this issue.

David
Post Reply