I renamed a directory that my virtual disk was in and now I can't start the Ubuntu VM, and can't figure out how to specify the virtual disk's new location with VirtualBox. Please help.
To move a .vbox file, edit
C:\Users\USER\.VirtualBox\VirtualBox.xml
The file is quite self-explanatory, I updated the
/VirtualBox/Global/MachineRegistry/MachineEntry[N]/@src
attribute. Works like a charm. It seems not to care whether you use slashes/backslashes. You may want to make a backup copy first. Restart VirtualBox as explained below.
--
To move a disk image, edit the .vbox file, which is an XML file as well. I updated the
/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk/@location
attribute. Example value:
location="C:/VM/UbuntuServer12/UbuntuServer12.vdi"
--
Restarting VirtualBox
When restarting VirtualBox, I waited for the VBoxSVC.exe daemon to exit as well. Not sure if it makes a difference, takes a few seconds only, was mentioned somewhere.