How can I set up a portable virtual machine?

I'd like to create a virtual machine with VirtualBox and use it on different computers. The problem is that I need to work on my programming projects on different machines and syncing them over the internet is getting increasingly uncomfortable.

Can I create a portable virtual machine and use it across several hosts? What if the host CPU architectures are different (32-bit vs 64-bit)?


Solution 1:

Export VM

With Virtual Box you can easily export, import or even clone your VMs to any place. This means, that once you export your VM to an external storage device you will be able to import this machine to any other instance of Virtual Box (of course irrespective of host OS).

Doing so is likely to be not so comfortable as you will have to export/import your machine everytime you made changes on the files hosted on your virtual drive. Depending on this drive size it may also take up quite some time to copy these data.

Define working directory on external drive

Therefore I suggest you set up Virtual Box to use a directory on the external drive as a standard location. In Virtual Box Manager open File - Preferences -General to define a "Default Machine Folder" than can also be on a (mounted) external drive.

enter image description here

Import VM

Then you also need to put your (previously exported) virtual hard disk there. Choose this location for the individual machine hard disk:

enter image description here

Carry your virtual machine to any place

You will now have a set up that not only stores the virtual disk drive but also the Virtual Box working directory for e.g. settings, snapshots etc. on the external drive.

Virtual Box is capable of running a 64-bit guest OS on a 32-bit host but this may not be as stable as when we stay within our architecture. You may need to test this first.

Solution 2:

Why don't you install a good environment on a memory stick and boot that? If you say more about your issues, it's easier to provide good ideas.

Solution 3:

Personally I would use portable virtualbox

http://www.vbox.me/