Page 1 of 1

Mount Real Hard Drive

Posted: 13. Jan 2009, 06:42
by tatemononai
Ok, I'm running Ubuntu and want to setup a Vista Virtual Box. I'd like to use a second IDE hard drive for the file system. Rather than having everything inside a .vid virtual drive I'd like to use a real hard drive for the file system... can this be done?

Posted: 13. Jan 2009, 12:49
by towo
Read the manual about raw disk access.

New Problem NS_ERROR_FAILURE

Posted: 13. Jan 2009, 16:19
by tatemononai
Ok, that got me started in the right direction. Using the manual I setup a VMDK with raw disk access. Now I am unable to mount that disk to the virtual box.

Just so you can see, here are the results of the VMDK creation.

andrew@andrew-desktop:~/.VirtualBox/HardDisks$ sudo VBoxManage internalcommands createrawvmdk -filename /home/andrew/.VirtualBox/HardDisks/Vista.vmdk -rawdisk /dev/sda -register

VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

RAW host disk access VMDK file /home/andrew/.VirtualBox/HardDisks/Vista.vmdk created successfully.

--------------

Then when I try to mount the drive via the VirtualBox GUI interface I get the following error.

Could not open the hard disk '/home/andrew/.VirtualBox/HardDisks/Vista.vmdk'.
VD: error opening image file '/home/andrew/.VirtualBox/HardDisks/Vista.vmdk' (VERR_ACCESS_DENIED).

Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
HardDisk2
Interface:
IHardDisk2 {ed6e2525-c2fd-42a4-917a-7a9045ac9e15}
Callee:
IVirtualBox {339abca2-f47a-4302-87f5-7bc324e6bbde}

FIXED

Posted: 13. Jan 2009, 18:23
by tatemononai
Ok, I fixed my problem. Just wanted to post the fix in case anybody has the same issue. It was purely a permissions problem as the error indicates.

I did two things. I had to grant full permissions to both the physical drive and the VMDK file.

So I did two commands.

sudo chmod 777 /dev/sda
sudo chmod 777 /home/andrew/,VirtualBox/HardDisks/Vista.vmdk

problem solved... it's working great now.

Permissions Lost On Reboot

Posted: 15. Jan 2009, 04:33
by tatemononai
Ok new update. When I reboot the machine the system loses the chmod settings on Vista.vmdk. So I have to rerun chmod every time I boot, which sucks. How might I go about making the changes permanent?

Thanks

Posted: 15. Jan 2009, 22:10
by Sasquatch
You need to change the ownership on the VMDK file. If that doesn't solve it, which would be strange, you can always put the chmod line (666 should be enough, you don't need to execute the drive ;)) in your boot script, like /etc/rc.local on Debian based systems.