You are here
Home > How To > Moving VirtualBox VM’s To An External Drive

Moving VirtualBox VM’s To An External Drive

Resizing VirtualBox Disks

Moving Virtual Box VM’s – The other day I created a VM in VirtualBox, and it created the VM in the default directory on my local drive. My local drive is not full, but having a virtual machine hogging an initial 23 Gb of disk space, didn’t excite me too much. This is especially true if it is set to dynamically grow in size. As I found out, moving VirtualBox VM’s is really quick and easy. Here’s how.

IF YOU CAME HERE FOR SOMETHING ELSE —> TRY THE FOLLOWING LINKS INSTEAD:

Moving VirtualBox VM’s

The current version of my Virtualbox installation is 4.2.14r86644. The first step is to ensure that the virtual machine is powered off.

Moving VirtualBox VM

Navigate to the settings for the specific VM you want to relocate. Click on the Storage item and select your vdi file (your hard disk). Click on ‘Remove Attachment’.

Remove attachments

When you have done that, click on OK and then open up the Virtual Media Manager from the VirtualBox file menu.

Moving VirtualBox VM

Select your vdi file again from the Hard drives tab and click on the Remove button.

Moving VirtualBox VM

VirtualBox will now prompt you to confirm your selection to remove the hard disk (unless you selected not to show this message at an earlier time). Click on the ‘Remove’ button.

Moving VirtualBox VM

Because we want to relocate the VM, you need to keep the hard disk. If you delete it here… well, just don’t.

Keep hard disk

Once you have done that, go the the disk location for your VM (mine was at “C:Users[username]VirtualBox”, but your path will be different) and copy it to your external drive. Go make a cup of coffee.

Copy to external drive

When the disk has been copied, you need to select the settings for your VM again and click on the Storage menu. This time, click on the ‘Add Hard Disk’ button.

Add hard disk

VirtualBox then asks you if you want to create a new disk or add an existing one. We want to use the disk we copied on to our external drive. Click on ‘Choose existing disk’ and browse to the location on your external drive.

Choose existing disk

VirtualBox will then add the disk on your external drive to your storage tree. Click OK and start your VM.

Disk added

Lastly, don’t forget to remove the old VM from the location it originally was created in. Having my VM on an external Hard Drive allows me to free up space on my development machine. Another good idea is to Export Appliance once you have your VM set up just right. That way you can import it if you need to create a new VM or distribute it to others in your organization.

 Al Forno

Dirk Strauss
Dirk is a Software Developer and Microsoft MVP from South Africa. He loves all things Technology and is slightly addicted to Twitter and Jimi Hendrix. Apart from writing code, he also enjoys writing human readable articles. "I love sharing knowledge and connecting with people from around the world. It's the diversity that makes life so beautiful." Dirk feels very strongly that pizza is simply not complete without Tabasco, that you can never have too much garlic, and that cooking the perfect steak is an art he has yet to master.

Similar Articles

Top