Win8 : Unable to use raw disk. Prob. permission error
Posted: 18. Jan 2013, 20:39
Hi. i have a computer with dual-boot Win8 and Ubuntu. I'm trying to "virtualize" this dual boot so i can use both OSs at the same time. My most resource-hungry applications being in windows i decided to use Win8 as the host. However, my disk is already partitionned for dual-boot and i'd like to keep the ability to boot directly to Ubuntu if i need to, so i decided i would try and use VirtualBox ability to "map" an existing partition as a virtual drive.
So i followed the manual and (using PowerShell because i can customize the size, but i get the same output with cmd.exe)
After several attempts, i started PowerShell as administrator and it worked immediately. So i created the vmdk (still in admin shell)
I installed VirtualBox outside the Programs folder so Windows UAC wouldn't be an annoyance if i had to change something manually. I had to put the partition numbers in quotes to get them both as a single parameter.
It worked immediately and created 2 vmdk files : Ubuntu.vmdk and Ubuntu-pt.vmdk. I suppose it's the expected behaviour.
However, when i tried to add the vmdk to my virtual machine (using the GUI), i got an error po-up. So i started PowerShell again (in normal user mode) and
Back to admin mode, i was able to attach the vmdk, but then when i start VirtualBox (the GUI), i get an error message about the disk image being inaccessible, and i can't start the VM.
If i run VirtualBox as admin, i don't have any error and i can start the VM (ubuntu doesn't boot correctly, but that's another point, the VM itself does work). However, i don't like running applications as admin. This is probably caused by me also using Linux where everyone tells you to never get an application running as the superuser by default.
Does anyone have an idea how i can get VirtualBox to accept the vmdk i created as admin. I tried changing the permissions, setting every user to full access and changing owner from admin to my user account, but that didn't help.
So i followed the manual and (using PowerShell because i can customize the size, but i get the same output with cmd.exe)
Code: Select all
PS C:\Users\Roland> VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
VBoxManage.exe: error: Cannot open the raw disk: VERR_ACCESS_DENIEDCode: Select all
VBoxManage internalcommands createrawvmdk -filename C:\VirtualBox\Ubuntu.vmdk -rawdisk \\.\PhysicalDrive0 -partitions "5,6"It worked immediately and created 2 vmdk files : Ubuntu.vmdk and Ubuntu-pt.vmdk. I suppose it's the expected behaviour.
However, when i tried to add the vmdk to my virtual machine (using the GUI), i got an error po-up. So i started PowerShell again (in normal user mode) and
Code: Select all
PS C:\Users\Roland> VBoxManage storageattach VB_Ubuntu --storagectl "Contrôleur SATA" --port 0 --device 0 --type hdd --medium C:\VirtualBox\Ubuntu.vmdk
VBoxManage.exe: error: Permission problem accessing the file for the medium 'C:\VirtualBox\Ubuntu.vmdk' (VERR_ACCESS_DENIED)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "C:\VirtualBox\Ubuntu.vmdk"If i run VirtualBox as admin, i don't have any error and i can start the VM (ubuntu doesn't boot correctly, but that's another point, the VM itself does work). However, i don't like running applications as admin. This is probably caused by me also using Linux where everyone tells you to never get an application running as the superuser by default.
Does anyone have an idea how i can get VirtualBox to accept the vmdk i created as admin. I tried changing the permissions, setting every user to full access and changing owner from admin to my user account, but that didn't help.