How to move VirtualBox machines to another hard drive
Recently I needed to free up some space on my Mac’s internal hard drive and decided to move my Virtualbox virtual machine disk images to an external drive.
At first I thought it was going to be as easy as just copying the .vdi files to the other drive and then pointing each Virtualbox machine to the new location of its corresponding .vdi file. Turned out it isn’t quite that easy.
For future reference, here’s what I did:
- Shut down the machine
- Use clonehd to create a clone. Open a Terminal window and enter vboxmanage clonehd [original] [clone], replacing [original] with the full paths to the .vdi file you want to clone and [clone] with the location where you want the clone, i.e. vboxmanage clonehd /VM/ubuntu10.10.vdi /Volumes/ExternalDisk/VM/ubuntu10.10.vdi.
- Open VirtualBox and go to Settings - Storage for the machine.
- Remove the disk in the Storage Tree.
- Add the cloned disk instead.
- Start the machine to verify that it works.
The Cloning disk images section of the VirtualBox manual notes that there may be problems with drive IDs and newer Linux distributions. I did not notice any such problems, but YMMV.
Subscribe / follow
- Operations Engineer @ Storenvy at The Sourcery (San Francisco, CA, Ca, US)
- Android Mobile Developer at Quirky (New York City or San Francisco, Ca, US)
- Dev Ops Engineer @ General Things at The Sourcery (San Francisco, CA, Ca, US)
- Front End Designer & Developer at iGovern.com (Anywhere within the USA, , US)
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost