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

Moving VirtualBox VM’s To An External Drive

Moving VirtualBox VM to an external drive

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. I set out to find a way of moving VirtualBox VM files. As I found out, moving VirtualBox VM’s is really quick and easy. Here’s how.


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

Relocating your 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. That’s all there is to it. Moving VirtualBox VM files is really easy to do.

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.

Dirk Strauss
Dirk is a Software Developer from South Africa. He loves all things Technology and is slightly addicted to Jimi Hendrix. Apart from writing code, he also enjoys authoring books and 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 almost mastered.

Similar Articles