Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VirtualBox VM that has a project I'm working on. I'd like to be able to use this VM on two separate computers, so I can work on it where I happen to be at that time. I've seen answers on transferring, cloning, and backing up VMs, but nothing on having two copies and keeping them in sync.

What's the easiest (fewest or simplest steps) or best (lowest risk of problems) way to maintain a single VM image on multiple computers?

Ideally, I'd rather not run the VM from a USB drive as one of the two computers has very few USB ports, but if that's going to be best, then I'll take it (I'm actually not sure if there are any problems with running a VM from a USB drive). I would, however, plan on using a USB drive to transfer any files between computers.

share|improve this question
up vote 5 down vote accepted

I think that you have two options here: the first one is to set (in the installations of Virtualbox on both computers) the folder where the VMs are stored on some kind of portable or remote hard drive; if the computers that you will be using are linked together on a network, you can use a shared folder, if not, I fear that the only solution is a USB pendrive or an external harddrive. To set the folder, go to File > Preferences > General > Default Machine Folder. The speed of the USB key could be a limit on the overall performance.

The second solution, that also require a pendrive or something similar (but just to carry around your VM files), is to manually export and import the desired VM every time that you need to carry it away. You can do this by selecting the VM and go with File > Export Appliance and File > Import Appliance. By exporting, a file with the .ova format will be created, it is an archive that contains all the files needed to use the VM, by importing it in another installation, you will have the same VM on the second computer. This way you are using the pendrive to simply carry around your files, that when reimported will be stored and accessed from your computer, thus the USB speed is not a concern.

share|improve this answer

I think Sekhemty's answer is the only way to do what you want.

But why does your virtual machine need to be moved? Why not just your project(s)? Set up your project in a private git and just push and pull as you need it.

Another method to try, if you need to maintain machine consistency and you're changing alot, would be to use a vagrant and chef/puppet setup. This works by using either a chef(which is a ruby gem) and puppet(I haven't used puppet) to tell vagrant what you want your VM to include and install.

It works by using a script, using chef or puppet, and vagrant reads this script when starting up the VM. If you want anything to be installed just add it to the script and if it's not already there it will be installed when you "vagrant up"! It took me a while to get used to it, steep enough learning curve, but it's very efficient once you get used to it and it will mean you just have to move around a script file instead of a whole VM.

share|improve this answer
It's not just about the code (which does go into a repository) and configuration; it's because the VM is my development environment. I started using VirtualBox so I could work in Ubuntu on a computer running Windows. This would give me a consistent development environment when it's less convenient to move the environment than it would be to move a copy of it. – rsgoheen Apr 29 '13 at 15:59
Well then vagrant and chef/puppet seems like it's the best. That way if you need to change something in your dev environment, there's no need to export and import your VM, you just add what you installed to your script and vagrant will build it into your VM on start up. It's very handy for having different instances of dev builds as well, as vagrant works off a "base-box(OS)" and builds on top of that what the script tells it too, so you could have multiple testing environments but only using the space of one. – boundless08 Apr 29 '13 at 16:29

You could rsync the virtual machine images between your two computers.

share|improve this answer
A bit more detail would make this a better answer. Can you elaborate? – Dave M Sep 20 '13 at 20:20

I know this thread is a year old, but it is a top search result on google for the issue of sharing one VM between two locations.

VirtualBox allows you to remotely connect to a running VM using RDP. If you don't want the VM running continuously, rig some way to launch it remotely.

There is an option for "Allow Multiple Connections", so you wouldn't even have to disconnect from one location before connecting from another.

If you are not able to host your own VM, a quick google search found providers that will host your VirtulaBox images for you.

I've never tried all of this...

share|improve this answer

Faced with exactly the same problem and I think I solved it.

Say you have two machines, A and B. Create/prepare your vm in A. After that take a snapshot or create a linked clone (both works, but further steps differ, will give one, you can resolve the other)

Now, make sure that you have a freshly installed Virtualbox in B. Copy ~/.VirtualBox and ~/VirtualBox VMs from A to B with a USB (considering that they are in far away sites)

Now, if you chose the snapshot way, then sync ~/VirtualBox VMs/YourVM/Snapshots folder until it gets big enough. If it gets larger, then create another snapshot in A and copy the YourVM folder to B for once and only sync this new snapshot file in Snapshots folder.

If you take a snapshot or make a linked clone in either A or B, this ritual will be broken, be warned.

Tested in 5.0.20

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .