Move VirtualBox Machine & Disk Directory - Success
Posted: 24. Jan 2010, 14:46
This is my first post, but I've found the boards invaluable in my experiments with VirtualBox.
One thing I wanted to do but didn't find step-by-step instructions in one place, was to move my very large Machine and HardDisk directories to a different drive. This is how I did it, on Windows Vista, with virtual Windows XP Machines which have snapshots.
Background
On Windows Vista, the default directory for my disks and machines is:
c:/User/xxxx/.virtualbox
where xxxx is my username. As I don't have a large system partition, and I'd like to keep them seperate, I wanted to move my virtual machines (with snapshots) to:
F:/VirtualBox
This is how I did it:
0) Exit VirtualBox
1) Backup all .xml files in c:/User/xxxx/.virtualbox (and subfolders) to a "xml before move" folder - in case things go wrong!
2) Duplicate the backups to a "edited xml after move" folder
3) Make a new F:/VirtualBox folder, and move c:/User/xxxx/.virtualbox/Machines and c:/User/xxxx/.virtualbox/HardDisks to it (takes a while...)
4) Edit the VirtualBox.xml file (in the "edited..." folder), changing all the occurences of c:/User/xxxx/.virtualbox/ to F:/VirtualBox/
5) Edit the VirtualBox.xml file, changing the values of defaultMachineFolder and defaultHardDiskFolder in the SystemProperties tag to:
6) Copy your new VirtualBox.xml file to the F:\VirtualBox directory
7) What I did incorrectly - don't do this: tried starting VirtualBox - the Machines were listed, but as unregistered, and with an "103" error about the path of "machineimpl.cpp". Stopped VirtualBox
8) Add the system variable VBOX_USER_HOME with a value of F:\VirtualBox
9) Started VirtualBox - it worked and the machines are accessible and run just as before :-)
I will now try a similar procedure to clone a VirtualMachine (and Disks, and snapshots) to a new physical machine, having failed (VM crashed) when just moving the disks.
I cannot guarantee that it will work for you, though it seems straight forward. If you have invested a lot of time in setting up your VMs, you might want to do a more comprehensive backup before starting.
Andy
One thing I wanted to do but didn't find step-by-step instructions in one place, was to move my very large Machine and HardDisk directories to a different drive. This is how I did it, on Windows Vista, with virtual Windows XP Machines which have snapshots.
Background
On Windows Vista, the default directory for my disks and machines is:
c:/User/xxxx/.virtualbox
where xxxx is my username. As I don't have a large system partition, and I'd like to keep them seperate, I wanted to move my virtual machines (with snapshots) to:
F:/VirtualBox
This is how I did it:
0) Exit VirtualBox
1) Backup all .xml files in c:/User/xxxx/.virtualbox (and subfolders) to a "xml before move" folder - in case things go wrong!
2) Duplicate the backups to a "edited xml after move" folder
3) Make a new F:/VirtualBox folder, and move c:/User/xxxx/.virtualbox/Machines and c:/User/xxxx/.virtualbox/HardDisks to it (takes a while...)
4) Edit the VirtualBox.xml file (in the "edited..." folder), changing all the occurences of c:/User/xxxx/.virtualbox/ to F:/VirtualBox/
5) Edit the VirtualBox.xml file, changing the values of defaultMachineFolder and defaultHardDiskFolder in the SystemProperties tag to:
Code: Select all
defaultMachineFolder="F:\VirtualBox\Machines" defaultHardDiskFolder="F:\VirtualBox\HardDisks"7) What I did incorrectly - don't do this: tried starting VirtualBox - the Machines were listed, but as unregistered, and with an "103" error about the path of "machineimpl.cpp". Stopped VirtualBox
8) Add the system variable VBOX_USER_HOME with a value of F:\VirtualBox
9) Started VirtualBox - it worked and the machines are accessible and run just as before :-)
I will now try a similar procedure to clone a VirtualMachine (and Disks, and snapshots) to a new physical machine, having failed (VM crashed) when just moving the disks.
I cannot guarantee that it will work for you, though it seems straight forward. If you have invested a lot of time in setting up your VMs, you might want to do a more comprehensive backup before starting.
Andy