How to move VirtualBox VDI files the easy way


I’ve been using Oracle’s VirtualBox for a few years now but postings on how to move the Virtual Disks around have tended to center around modifying the VirtualBox.xml file.

There is currently, and I think always was, a simpler way to accomplish this task. Here are the steps.

********** UPDATED for V4.3 (finally) **********

1. With the VM in the powered-off state, copy the VDI file from point A to point B.

2. Start VirtualBox and a Warning dialog may appear to tell you that the .vdi file disappeared (obviously), just click the Ignore button if that dialog appears.

3. With the affected VM selected in VBox Manager, click the Settings gear icon at the top.

4. Locate the Storage choice (4th down) on the left and click it. In the Storage Tree in the center you will see an IDE controller, click that. Now click the Add Hard Disk icon (which does not look like a CD, but sort of like a hard disk :-). A VBox dialog appears, click the Choose existing disk button. Navigate to the location of your moved .vdi file and double-click that file (the red box icon) in the Windows Explorer dialog, and click the OK button.

Done, your VM should start back up.

Advertisements

About generation12

I am a SharePoint/.NET consultant in the twin cities.
This entry was posted in Uncategorized. Bookmark the permalink.

10 Responses to How to move VirtualBox VDI files the easy way

  1. Thanks, it works perfect…

  2. akismet-cefde5c328d2ddb5c764fa60a7f94b69 says:

    thanks for the tip!

  3. Thanks, I wouldn’t think of the Virtual Media Manager :)

  4. candritzky says:

    This seems to work only when you haven’t created snapshots (restore points) based on this disk. I haven’t found a way to move a .vdi file after snapshots have been created.

  5. Sam Swigert says:

    Great guideline on a simple way to move those pesky vdi files, though I should add, it is actually not necessary to copy them to their new location, as long as you know what you are doing you can save a lot of time by simply moving, or cut/paste to the new location – copying 150GB can take a long time! Just cut and paste the vdi to the new location, open virtual media manager, release and remove the old disk, go to storage options of the machine and add a new ide disk, select your vdi file in its new location from the file browser and youre good to go, without 30min-2hr wait.

    • generation12 says:

      Thank-you. This is an old posting that I should Update as there have probably been 14 point releases since that time :-) and in fact, I don’t usually copy the file anymore either…

  6. Attila Orosz says:

    Sam, that’s correct, unless you are moving to a separate physical disk. then the wait will be the same. :) Just been thorugh this after accidentally deleting one of the virtual disks. After recovery i’ve had to move it to the new location…

    Another advantage of moving instead of copying in a *nix system would be that mv always tries to preserve file permissions, while with cp you would have to explicitly tell it (with cp -p), that is handy, as without write access the machine wouldn’t start. I guess it would not affect a Windows host though, as NTFS handles permissions differently (or does it?)

  7. I get a registration error when I follow these instructions for VirtualBox 4.3.12. It’s complaining that the UUID already exists.

  8. Never mind. Deleting the old disk from the Virtual Media Manger (File | Virtual Media Manager) allowed me to add the disk.

  9. Thiago says:

    Thanks for the tip!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s