Feb 25, 2014

Moving a VirtualBox VM to a New Hard Drive

The information for this blog is  taken from a post by mpack on the virtualbox forums. The directions there were very clear I just wanted an easier way to find it in the future. I also added a little information from some additional areas of the thread.

  1. Shut down all the running virtual machines and the exit the VirtualBox Manager.
  2. Make a safety backup copy of your VirtualBox.xml file. In my case this path was used: <userDirectory>\.VirtualBox \VirtualBox.xml. Not that .VirtualBox is hidden by default so you have to enable the feature to see hidden folders on your OS.
  3. Navigate to the folder that is currently home to your Virtual machine. In my case this was under my <userDirectory>\VirtualBox VMs folder.
  4. We are going to copy the folders rather than move them so that we can easily remove this VM in an upcoming step and to have a backup if anything goes wrong.  Copy all the VM folders you wish to move to the new drive. In my case this was E:\VirtualBox\VirtualMachines.
  5. Restart the VirtualBox Manager and right click on the machine that you want to move and select Remove… from the context sensitive menu.  Some users reported problems with the VirtualBox Manager keeping an in-memory copy of the removed machine. I didn’t have this problem but if you do, the fix is to quit VirtualBox Manager after this step and wait long enough for the VBoxSvc task to time out and terminate. I think I would just restart my physical machine.
  6. Use the Machine menu and select the Add… option. Navigate to the new drive/folder location and select the machine.
  7. Under the File menu select the Preferences… and  on the General tab change your Default Machine Folder  entry to be the path on your new drive. In my case again it was E:\VirtualBox\VirtualMachines.

Test and validate that your moved VM works properly. Once you are confident that everything works well you can go back to your original drive and delete the VM folder.

About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.