Page 1 of 1

How to move VMDK file

Posted: 9. Oct 2013, 20:01
by J. Merrill
A VMDK file was created in "C:\Program Files\Oracle\VirtualBox" -- so I have to run VirtualBox "as Administrator" or the file can't be written.

I copied the file to a writeable-by-non-Admin directory but can't figure out how to get VirtualBox to change where it thinks the file is.

I was able to move other references by editing the file ~\.VirtualBox\VirtualBox.xml (when VirtualBox was not running) but it does not seem to point to the VMDK file. Where is that pointer so that I can change it?

Thanks for any assistance.

Re: How to move VMDK file

Posted: 12. Oct 2013, 11:21
by noteirak
First of all, do not edit the XML file by hand unless you know what you are doing! Then go in the VM using the disk, and replace it with the new disk location.

Re: How to move VMDK file

Posted: 12. Oct 2013, 11:43
by mpack
VirtualBox v4.x does not store any media paths in VirtualBox.xml, so best forget about that idea.

Run VBox and go to File|Virtual Media Manager. Select the vmdk and first Release (detach from VM) and then Remove (unregister) it. Now you can shut down VirtualBox and move the VMDK wherever you want. Later on you start VBox again, go to the VM settings | Storage section, and use the little icon beside the correct disk controller to add a new (existing) hard disk attachment.

Re: How to move VMDK file

Posted: 14. Mar 2014, 02:47
by virtualbocks
mpack wrote:Run VBox and go to File|Virtual Media Manager. Select the vmdk and first Release (detach from VM) and then Remove (unregister) it.
This works great until snapshots are used. Once differencing disks are based on that file, that disk can no longer be released or removed until the whole hierarchy of differencing disks are released, which I presume renders the snapshots unusable. Is there any way to move a virtual disk if snapshots are being used?

Re: How to move VMDK file

Posted: 14. Mar 2014, 13:20
by mpack
virtualbocks wrote:Is there any way to move a virtual disk if snapshots are being used?
Practically speaking, no. You can easily move the entire VM, but not just the disk. Not to worry, if this is the worst outcome of your decision to use snapshots then count yourself lucky!.