Page 1 of 1

permission error adding hard disk to virtual machine

Posted: 18. Mar 2015, 16:39
by omegamale
I am trying to add a partition as a disk to my guest machine. This is what I tried.
Firstly I used Windows Disk management to shrink the existing partition on my hard disk.I then created a new unformatted partition from the free space.
Next I started command prompt as administator. I changed directory to C:\Program Files\Oracle\Virtual Box
From there I issued the command
VBoxManage internalcommands createrawvmdk -filename "C:\Users\ajf\VirtualBox VMs\Ubuntu 14.10\t2k.vmdk" -rawdisk \\.\PhysicalDrive0 -partitions 3
RAW host disk access VMDK file C:\Users\ajf\VirtualBox VMs\Ubuntu 14.10\t2k.vmdk
created successfully.

Next in virtualbox I went to
Settings
Storage
Add Hard Disk
Choose existing disk
- selected virtual machine disk format file called t2k
Open

I get an error
Failed to open the hard disk file

Permission problem accessing the file
VERR_ACCESS_DENIED
Failed to open the hard disk file C:\Users\ajf\VirtualBox VMs\Ubuntu 14.10\t2k.vmdk.

Permission problem accessing the file for the medium 'C:\Users\ajf\VirtualBox VMs\Ubuntu 14.10\t2k.vmdk' (VERR_ACCESS_DENIED).

Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: Medium
Interface: IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}
Callee: IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

Any idea what is wrong?

Re: permission error adding hard disk to virtual machine

Posted: 19. Mar 2015, 06:24
by ChipMcK
omegamale wrote: . . . created a new unformatted partition from the free space . . .
As I recall, an existing virtual disk is expected to have been formatted.

Re: permission error adding hard disk to virtual machine

Posted: 19. Mar 2015, 09:58
by Martin
The problem here most probably is that the host os has not released the access to the disk/partition.

Re: permission error adding hard disk to virtual machine

Posted: 19. Mar 2015, 16:13
by omegamale
I don't see how I can format it from windows, as it is going to be a Linux format partition, once I can access it from the guest (Linux) system I can format it.

How can I tell windows to release the partition ?