How to move a VM from a drive to another
Posted: 23. Sep 2016, 17:54
Hi,
I post this message because I've just moved a set of VMs from a drive to another and I found easily the help to move "normal" VM by recreating them but :
1) I moved the normal VM without recreating them manually (and it is far more convenient because I had several ones)
2) I did not found help to move "linked cloned" VMs :
- the "non-linked" disks worked properly
- but the "linked" disks were unable to find their "master disks"
The trick is to replace the old directory name by the new one in the xml files of the VMs (it's quite dirty but it works) :
- in VirtualBox interface, menu File\settings, change the default directory for VM files
- close all the VirtualBox windows and processes
- move your VMs directories
- open the file %userdir%\.VirtualBox\VirtualBox.xml in a text editor and remplace all the occurences of the old dir name by the new one (the separator is \)
- go to the new VMs default directory and open all the .vbox files of the VMs (in the sub directories) which has snapshots (the one which are used as models and possibly some others). If you have any doubt, look at all the .vbox files. open those .vbox files in a text editor and replace the old dir names by the new ones. WARNING : in those files, directory separator is a /.
- relaunch VirtualBox. Normally all your VMs should not worse than before your moved them.
Herve
(PS : At the end, I finally found the trick above hidden in some comments of other posts but as the subject was not specific enough, I find usefull to publish this post anyway)
I post this message because I've just moved a set of VMs from a drive to another and I found easily the help to move "normal" VM by recreating them but :
1) I moved the normal VM without recreating them manually (and it is far more convenient because I had several ones)
2) I did not found help to move "linked cloned" VMs :
- the "non-linked" disks worked properly
- but the "linked" disks were unable to find their "master disks"
The trick is to replace the old directory name by the new one in the xml files of the VMs (it's quite dirty but it works) :
- in VirtualBox interface, menu File\settings, change the default directory for VM files
- close all the VirtualBox windows and processes
- move your VMs directories
- open the file %userdir%\.VirtualBox\VirtualBox.xml in a text editor and remplace all the occurences of the old dir name by the new one (the separator is \)
- go to the new VMs default directory and open all the .vbox files of the VMs (in the sub directories) which has snapshots (the one which are used as models and possibly some others). If you have any doubt, look at all the .vbox files. open those .vbox files in a text editor and replace the old dir names by the new ones. WARNING : in those files, directory separator is a /.
- relaunch VirtualBox. Normally all your VMs should not worse than before your moved them.
Herve
(PS : At the end, I finally found the trick above hidden in some comments of other posts but as the subject was not specific enough, I find usefull to publish this post anyway)