If you want to move the VirtualBox folder that contains all your virtual machines to a different location, you have two options: the official one and the fast one.

Michael Pietroforte

Michael Pietroforte is the founder and editor in chief of 4sysops. He has more than 35 years of experience in IT management and system administration.

The official way to move the VirtualBox folder is to first export your virtual machines to an OVA file and then import the OVA file at the new location:

  1. Click File > Export Appliance.
    Export Virtual Appliance
  2. While holding the CTRL key, click the virtual machines you want to export.
  3. Choose the location of the OVA file, click Next, and then export.
  4. Change the Default Machine Folder under File > Preferences > General.
    Default Machine Folder
  5. Click File > Important Appliance, select the OVA file, and import.

The downside of this option is that the export and import of the OVA file is extremely slow and error prone.

The faster option is to simply move the VirtualBox folder with the virtual machines to a new location with File Explorer:

  1. You can usually find the VirtualBox folder in your Documents folder. If you can’t find the folder, check File > Preferences > General > Default Machine Folder.
  2. Ensure that the VirtualBox VM Manager is closed and all VMs are offline. Then, move the VirtualBox folder to the new location with File Explorer.
  3. Open the VM Manager and remove all VMs that are marked as inaccessible: hold the CTRL key and click all VMs, and then right-click and select Remove.
    VirtualBox inaccessible VMs
  4. Click File > Virtual Media Manager and remove all hard drives, optical disks, and floppy disks.
    Virtual Media Manager
  5. Navigate to each folder in the new VirtualBox directory in File Explorer and double-click the VBOX file to import the corresponding VM.
  6. Change the Default Machine folder under File > Preferences > General.

Depending on how many VMs you have, step 5 can mean a lot of click-click; however, in my experience, it will always be much faster than with the export/import method.

Are you an IT pro? Apply for membership!

Your question was not answered? Ask in the forum!

8+
Share
23 Comments
  1. Charles Butcher 5 years ago

    Thank you for this good clear explanation. It worked well for me, and it certainly sounds easier than the official method.

    1+

  2. Michael Pietroforte 5 years ago

    Thanks!

    0

  3. You didn't say, but does this work even if you are moving from one OS to another? In my case I have a handful of VirtualBox VMs on an Linux computer that I want to move to a newly installed VirtualBox on a Mac (both machines have Intel CPUs).

    0

  4. Michael Pietroforte 5 years ago

    I didn't try that, but I don't see any reason why this shouldn't work.

    1+

  5. Sally 3 years ago

    The 2nd method was easy and worked. Thanks for taking the time to write this!

    0

  6. Steve 3 years ago

    Thanks for this.  Was a great help!

    0

  7. JoeyH 2 years ago

    Thanks for the article. Just curious - if the machine is in a saved state, can the virtual machine be moved to another folder or drive?

    0

    • Author
      Michael Pietroforte 2 years ago

      I never tried this, but my (wild) guess is that the first method works. You will probably get an error message if it doesn't. If you try it with the second method, I recommend that you create a second copy of the VM at another location. If it doesn't work, you can restore the original configuration. You might also want to try it first with a test VM.

      0

  8. Paul 2 years ago

    I changed my user account and folder name and lost access to my VMS. The fast option did the trick.

    0

  9. Gerhard Gruber 2 years ago

    Thanks for the Article. One minor update you might include.

    After moving the files to their new location you don't need to change manually stuff in the GUI. Make sure that VirtualBox is not running. Then just go to  "C:\Users\MyUser\.VirtualBox" and open VirtualBox.xml

    Replace all occurrences of "C:\Users\MyUser\VirtualBox VMs"

    with your new path with an editor of your choice.

    No clicking required and this will also change the default path, so you can just start VirtualBox now and use your VMs in the new location.

     

    10+

  10. me 2 years ago

    Tried using both methods and hosed both vms in old location and new location. tried reinstalling the program and still gives fatal erros count not boot media

    0

  11. Marc 2 years ago

    Great article, thanks! Quick and successful procedure, helped a lot!

    0

  12. Mike 1 year ago

    Thanks for this.

    With VirtualBox 5.2.12   on Ubuntu,   at your step 5  I found the syntax is slightly different.

    You can't just click on a .VDI file in File Manager (pcmanfm) as nothing recognises what to do with it (neither does Virtualbox, if I point it there).

    BUT instead,  at the top menu of VirtualBox,  if I choose "Machine > Add"   -  that then invites me to import a VBOX file - so then completing your step 5,  works fine.

    Thanks again

    Mike, London

    0

    • pooky2483 1 year ago

      Step 5 worked for me, I'm running Kubuntu 16.04.
      If you have trouble again, jut go into system settings/applications/File Associations and look for .vbox then set the application that you want it to be opened by.

      I don't know why it worked for me without doing that first, maybe it's something your system missed!

       

      0

  13. Abhineet Ayan 1 year ago

    Awesome man... Thanks a lot. Cheers.

    0

  14. rafa 7 months ago

    Very clear explanation. Thanks!

    0

  15. Mathew 7 months ago

    Worked flawlessly

    Thanks for posting this tip

    0

  16. me1 6 months ago

    Hi 

    I'm getting error whole opening virtual machine.

    It gives me failed to open virtual machine located at my new path.

    0

  17. me1 6 months ago

    In details tab of the error, it shows Could not find an open hard disk with UUID.

    0

    • Swapnil Kambli 6 months ago

      Look for the UUID entry in VM's '.vbox' file. If it is data disk remove the entry and try again.

      0

  18. Jose Celano 5 months ago

    VirtualBox 6.0 allows you to move an image and it's fast.

    2+

  19. franck 3 months ago

    Tried this method but lost everything, don't use the fast if you're changing harddrive.  it will fail.

    0

  20. Han 2 months ago

    You can move VM files and delete the VM item in the list of virtualbox manager, and then ADD the moved VM to the virtualbox manager. That's it. I am using VirtualBox6.0 . Thank you  Michael and Jose.

    0

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2019

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account