Share Your Virtualbox VM Across Different OS

While creating a virtual machine in Virtualbox is an easy task, sharing the virtual machine across different OS is not. If you are dual-booting your computer and have created a virtual machine in one of the OS partition, due to the difference in file structure among the different OS, you will not be able to access and open the VM file in the other partition.

To illustrate: let’s say you have installed Win XP on your Macbook via boot camp. As you have heard so much about Ubuntu and wanted to try it out, you installed Virtualbox and created an Ubuntu virtual machine in your Mac partition. One day, while doing your work in the Win XP partition, you found that you need to access some applications in the Ubuntu virtual machine. There is no way for you to open the Ubuntu virtual machine in Windows since you can’t access your Mac partition. Now, rather than rebooting into the Mac partition, wouldn’t it be great if you can access and open the Ubuntu virtual machine in the Windows partition?

The above situation will happen even if you are running a Linux/Mac or Linux/Windows dual boot. The following tutorial will show you how you can have access to your Virtualbox virtual machine regardless of which OS you are in.

The rule of thumb:

Always create your Virtualbox virtual machine (the file with a vdi extension) in a NTFS partition.

That is to say, if you are dual-booting Windows and Linux/Mac, always save the vdi file in your Windows partition. For those with Mac and Linux, you will have to create a new NTFS partition either on your existing hard disk or on an external hard disk (preferably).

Here’s the complete tutorial to access the virtual machine from different OS

For computer that dual-boot Windows and Mac/Linux

  • Boot into Windows
  • Create your virtual machine as you always do. Note the file path where you save the virtual machine vdi file.

Restart your computer and boot into the other OS.

If you are in Mac OS

  • Download and install MacFuse and NTFS-3G. It will prompt you to restart your computer. After the restart, you will see a new drive mounted on your desktop. That is the Windows partition.

Now, we are going to create an entry on your Virtualbox and make it point to the vdi file in the Windows partition.

  • Open the Virtualbox application.
  • On the top of the window, click New to create a new virtual machine.

  • Click Next and follow the instruction to create a new VM until you reach the point where it asks you to specify your hard drive

virtualbox-new-hard-disk

  • Click on Existing. In the next window, click on the Add and point the file path to the vdi file in the Windows partition.

virtualbox-add-new-hdd

  • You should now see an entry in the window. Highlight the entry and click Select.

virtualbox-select-new-hdd

  • On the next window, click Next follow by Finish. It will bring you back to the main window.

virtualbox-main-window

  • Highlight the new VM entry on the main window and click Start. You should see the same virtual machine that you have created in your Windows partition running in your Mac now.

Dual-booting Linux and Windows

Restart your computer and boot into the Linux partition.

  • Install ntfs-3g (if you are using Ubuntu Hardy, you can skip this step. Ntfs-3g is already pre-installed in your system)
  • Download and install Virtualbox for your Linux distro (if you have not done so).

Now, we are going to repeat the same steps as we did in Mac (follow the screenshots instructions above) to create an entry on Virtualbox to point to the virtual machine in the Windows partition.

For computers that dual-boot Mac and Linux

If you are dual-booting Mac and Linux, first boot into the Linux partition.

  • Download and install Virtualbox. Create a new virtual machine and follow the instructions until it asks you the location of your hard disk.

virtualbox-new-hard-disk

  • Click New to create a new virtual hard disk. Click Next until it asks you where to store your virtual hard disk

virtualbox-hdd-location

  • Click on the icon beside the Image File name field and select any folder in the external NTFS hard disk. This will save the vdi file in the external hard disk rather than its default location.
  • Proceed on with the standard installation of the guest OS.

Once you are done creating the virtual machine, reboot into Mac and follow the above step to configure the Virtualbox in your Mac to access the VM on the external hard disk.

That’s it!

Screenshots

Windows Vista running as a VM in Ubuntu
Windows Vista running as a VM in Ubuntu
The same Vista VM running in Mac
The same Vista VM running in Mac

9 comments

  1. Thanks for your tutorial, it’s working great.

    Nevertheless, I’m experiencing problems with snapshots shares. My hosts OS are Linux/WinXP. Snapshots are not taken in account in the other OS, ie :
    – I’m on host XP, I take snapshot of the guest,
    – I reboot
    – I dual boot on Linux
    – VirtualBox does not seem to see the snapshot, and continue to use the “base” revision.

    It may be possible to copy a Virtual Box image with some manager ; but snapshot sharing management between hosts are not functional today.

  2. hi..
    btw i can’t open mac document in windows..
    i have installed virtual box…

    i have search google for 3 hours with no result..

    i dont know how to open mac document in windows using it..

    please help me..

    i have tried some ways but it didn’t work..

    my laptop: mac os x tiger

    thanks btw

  3. no, all document in mac can’t be open in windows..
    i don’t know what folder in window that contain my mac document..

  4. In Linux, I always move my /home/required/.VirtualBox folder to another partition, /giant-partition/VirtualBox, for example. Then do: ln -s /giant-partition/VirtualBox /home/required/.VirtualBox, so that VirtualBox can still get to its files using the expected path.

    I think you could possibly do this from each of your host OS systems, to store all VirtualBox information on the single shared partition.

  5. Sorry, I left out the important part: that idea is so that you could access your snapshots across Operating Systems.

    • I understand where you are coming from, and I think that is an useful method. Thanks for sharing.

  6. It does not work in VirtualBox. If you attach a same vdi file to different VMs, Virtual Box will create differencing images for them automatically. For example, you installed some security patches to your Ubuntu virtual machine on Mac, then you switch to Windows, start Ubuntu in VirtualBox, you will see that it is still not patched. I don’t know why VirtualBox is implemented that way. It makes sharing VM almost impossible. Sure, you can export/import VMs, but it clones a new VM, not sharing the same one. VMWare does better job on sharing.

Comments are closed.

Sponsored Stories