Page 1 of 1

Is it possible to change the location of a VM?

Posted: 1. May 2011, 23:38
by scp
I am a VBox user since 1.6x so, I have the old scheme with different folders for VM config and VDIs.
The VM I want to move for example is located under:
/opt/VirtualBox/Machines/SCPW7/
And it has only one VMDK attached which uses a physical disk:
/opt/VirtualBox/VDI/SCPMain-nvidia_dihjeefh1b-6.vmdk

Now just want to move the existing files to ~/VirtualBox/Machines/SCPW7/ because /opt is on another partition.
In older versions it was possible to change the locations in the XML files, but now they make no sense to me anymore, because all changes get lost after starting VirtualBox, so they are dummys?

Is it possible to change the "src" value in "MachineEntry" and "location" in "HardDisk" by VBoxManage?

Deleting and recreating/reattaching is not the way I want to go.

Re: Is it possible to change the location of a VM?

Posted: 1. May 2011, 23:42
by Sasquatch
If you want to be sure everything goes right, make a backup, then modify the XML files manually. I haven't seen a syntax to change the path of a VM, so it's either removing the VM, keep the files and re-add it, or edit the files.

Re: Is it possible to change the location of a VM?

Posted: 2. May 2011, 03:29
by scp
That is what I already did, the result was:
"In older versions it was possible to change the locations in the XML files, but now they make no sense to me anymore, because all changes get lost after starting VirtualBox"

Re: Is it possible to change the location of a VM?

Posted: 3. May 2011, 21:47
by Sasquatch
Did you edit all the XML files that have something to do with it? In this case, both the VM XML and the VB.xml file. Be sure to check all path locations, I found out that the VDI path can be at the beginning of the VM xml as well.

Re: Is it possible to change the location of a VM?

Posted: 5. May 2011, 01:06
by scp
Yes I changed both, the main VirtualBox.xml file and the VM file SCPW7.xml.

Re: Is it possible to change the location of a VM?

Posted: 7. May 2011, 12:57
by Sasquatch
If changes are lost when you start VB, it means that the process writing the files hasn't closed yet after you modified the files. Just move the files to the new location and add it from the Machine > Add menu.