Can't use a raw host hard/flash disk image

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Woodward
Posts: 5
Joined: 14. Aug 2015, 23:23

Can't use a raw host hard/flash disk image

Post by Woodward »

I have a USB disk with Linux installed. I want to use it on my VBox. Since VBox doesn't support "Boot from Flash", I created a raw disk image linking to my USB disk (sdb)

Code: Select all

AspireV3:~/Downloads>sudo VBoxManage internalcommands createrawvmdk -filename ~/VirtualBox\ VMs/flash.vmdk -rawdisk /dev/sdb
[sudo] password for user: 
RAW host disk access VMDK file /home/user/VirtualBox VMs/flash.vmdk created successfully.
But when I tried to attached it to my guest OS, an error raised.

Failed to open the disk image file /home/user/VirtualBox VMs/flash.vmdk.

Permission problem accessing the file for the medium '/home/user/VirtualBox VMs/flash.vmdk' (VERR_ACCESS_DENIED).

Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Callee: IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

At the beginning I thought it was because the read/write access privilege, so I use chown and chmod to set as this

Code: Select all

AspireV3:~/VirtualBox VMs>sudo chmod 666 ./flash.vmdk 
AspireV3:~/VirtualBox VMs>sudo chown user:user ./flash.vmdk
AspireV3:~/VirtualBox VMs>ll ./flash.vmdk 
-rw-rw-rw- 1 user user 536 Sep 13 13:56 ./flash.vmdk
But it doesn't work. Anyone knows why ?
aLTeReGo
Posts: 1
Joined: 20. Nov 2015, 23:36

Re: Can't use a raw host hard/flash disk image

Post by aLTeReGo »

Did you ever manage to figure this out? I'm running into the same issue.
Elizine
Posts: 34
Joined: 19. May 2015, 10:49

Re: Can't use a raw host hard/flash disk image

Post by Elizine »

Follow the steps given in the link below -
https://scottlinux.com/2010/06/26/raw-d ... irtualbox/
bodHOST
onus
Posts: 2
Joined: 3. Oct 2016, 17:23

Re: Can't use a raw host hard/flash disk image

Post by onus »

shouldn't we be able to do this without logging in as root?

i was previously able to do so. lost my main HDD, had to reinstall Ubuntu (so I took the opportunity to update from 15.10 to 16.04), and now with all new updates I can no longer add a physical drive as a VM... why?

what am I missing?

thanks for all help.

I am currently running Ubuntu-MATE 16.04.1 with virtualbox 5.1.6 r110634(Qt5.5.1)
and I would like to mount my windows 10 x64 HDD as a virtual machine vmdk.

and I keep running into this:
Permission problem accessing the file for the medium '/media/VM/Win10-2/win10-2.vmdk' (VERR_ACCESS_DENIED).

Result Code:
VBOX_E_FILE_ERROR (0x80BB0004)
Component:
MediumWrap
Interface:
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Callee:
IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
onus
Posts: 2
Joined: 3. Oct 2016, 17:23

Re: Can't use a raw host hard/flash disk image

Post by onus »

well I feel like a moron.

windows did not shut down cleanly...

fix: boot into windows power off properly.
boot back into Linux add vmdk as per usual. no issues.

thnx
JavoMVD
Posts: 1
Joined: 26. Oct 2017, 16:04

Re: Can't use a raw host hard/flash disk image

Post by JavoMVD »

In my case the permissions issue was fixed by running Virtualbox as root (sudo). The vmdk file had 777 settings, but the actual raw file system could not be accessed unless the application was running as root.
Post Reply