error: can't be used as the requested device type

Discussions related to using VirtualBox on Linux hosts.
Post Reply
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

error: can't be used as the requested device type

Post by neuronetv »

VBoxManage: error: The medium '/root/VirtualBox VMs/<vm> can't be used as the requested device type.
I previously had my vm as a vmdk and I converted it to vdi with this command:
VBoxManage clonehd --format VDI centos6-disk1.vmdk centos6-disk1.vdi
after which I had a vdi file as well as a vmdk file in my vm folder. Is this the way it's supposed to work? This is the first time I've ever tried to convert a vmdk so I don't know what to expect.
I then booted the vm and ran zerofree in it to prepare for the compact. However when I ran the compact command it throws the error. The console doesn't give any reason for this error, this is the full output:
# VBoxManage modifyhd "centos6" --compact
VBoxManage: error: The medium '/root/VirtualBox VMs/centos6' can't be used as the requested device type
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
What's the solution to this?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: error: can't be used as the requested device type

Post by Perryg »

What's the solution to this?
Stop using root.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: error: can't be used as the requested device type

Post by neuronetv »

thaniks but that didn't work. I stopped using root and changed to a user and I still get:
-sh-3.2$ VBoxManage modifyhd "centos6" --compact
VBoxManage: error: The medium '/home/<user>/VirtualBox VMs/centos6' can't be used as the requested device type
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
update; I've just noticed in the above error message that vboxmanage is trying to go to '/VirtualBox VMs/centos6' but the correct path is /VirtualBox\ VMs/centos6, I don't know how to tell vbox that there should be a reverse slash at the end of 'VirtualBox'.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: error: can't be used as the requested device type

Post by Perryg »

You need to provide the absolute path to the file and include the file name and extension. Put quotes around the path if there are spaces.
Post Reply