Share Your VirtualBox VM Across Different OS

[ad_1]

A photograph of a desktop computer on a table.

While creating a virtual machine in VirtualBox is an easy task, sharing that virtual machine across a different OS is not. If you’re dual-booting your computer and have created a virtual machine in one of the OSes partitions, due to the difference in file structure among different OSes, you will not be able to access and open the VM file in the other partition. The following tutorial will show you how you can share to your VirtualBox virtual machine regardless of which OS you are in.

Tip: learn how you can install Windows as a VirtualBox VM in Linux.

Creating the Storage Device for Your VM

The first step in sharing your VM across different systems is to create an external storage device with an ExFAT filesystem. This allows you to load the hard disk file for your VM regardless of its parent OS.

To do this in Windows, open your system’s file manager then plug your external hard disk in.

Find your disk on the file manager’s left sidebar, right-click the mouse then select Format…

A screenshot highlighting the

Click the dropdown list below the File system label, then select ExFAT.

A screenshot highlighting the ExFAT filesystem in the disk format prompt in Windows.

Accept the default values, then click Start.

Creating an ExFAT Drive in macOS

Press Command + Space to open your machine’s Spotlight Search, then type “Disk Utility.”

Click the entry for your physical disk on the window’s left sidebar.

A screenshot highlighting the external physical disk in MacOS' Disk Utility.

Note: Sometimes the Disk Utility app will not show the physical devices by default. To fix this, go to the View menu item, then click Show All Devices.

Click the Erase button on the window’s upper bar, then select ExFAT on Format Dropdown box.

A screenshot highlighting the filesystem format in MacOS.

Press Erase to format your drive to ExFAT.

Creating an ExFAT Drive in Linux

Open a new terminal session, then type the following command to install the ExFAT filesystem in your machine:

sudo apt install exfatprogs exfat-fuse

Open your system’s disk utility program. In Ubuntu, you can do this by pressing Win then typing “disks.”

Select your physical disk, then click the dotted menu on the window’s upper right corner.

A screenshot highlighting the dotted menu in the Gnome Disks utility.

Click Format Disk…, then select Format. This will remove all the existing partitions in your storage device.

Click the + button under your storage device’s Volumes diagram.

A screenshot highlighting the

Click Next to accept the default partition size, then click the Other radio button, then press Next.

A screenshot highlighting the

Select ExFAT on the filesystem selection, then press Create to install it to your device.

A screenshot highlighting the ExFAT filesystem under Gnome Disks' Custom Filesystem Format.

Good to know: learn how you can secure your data by creating a hidden filesystem in Linux with Shufflecake.

Sharing the VDI File Between Windows and Mac/Linux

Boot into your Windows system, open VirtualBox, then click the New button on the window’s top bar.

Provide the name of your VM, then select your ISO file.

A screenshot showing the VM configuration menu in VirtualBox for Windows.

Click the Hard Disk dropdown tab, then click the Browse button under the Hard Disk File Location and Size category.

A screenshot highlighting the default location for the VDI file.

Find your external disk, then select that as the location of your VDI disk.

A screenshot showing the Windows File Picker on the location of the external disk.

Go through the installation wizard of your VM’s OS, then turn off the VM.

Boot into either MacOS or Linux, then open your copy of VirtualBox in the system.

On the top of the window, click “New” to create a new virtual machine.

A screenshot highlighting the

Provide the name and type of your VM, then click Next.

A screenshot showing the default VM creation screen in VirtualBox for MacOS.

Ensure that the VM on your second OS has the same amount of memory and processors allocated to it.

A screenshot showing the default system resources allotted for Ubuntu in VirtualBox.

Click the Use an Existing Virtual Hard Disk File radio button, then click the Browse button on the right side of the window.

A screenshot highlighting the option to select a custom VDI disk to load for the new VM.

Click Add, then search for your VM’s VDI file on your external disk.

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

A screenshot highlighting the "Choose" button on VirtualBox's default VDI list.

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

A screenshot showing the active VM using an external VDI disk.

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

Tip: learn how to create a portable VM for cloud services by exporting your VirtualBox VM as an OVA file.

Sharing the VDI File Between Mac and Linux

Boot into Linux, then open VirtualBox using your system’s app launcher.

Create a new virtual machine, then click Expert Mode at the bottom of the creation wizard.

A screenshot highlighting the

Provide the name and a type to your new VM, then click the Hard Disk dropdown tab.

A screenshot highlighting the

Click on the icon beside the Hard Disk Location and Size field and select any folder in the external disk.

A screenshot highlighting the location chooser for the VDI file in VirtualBox for Linux.

Proceed with the standard installation of the guest OS.

Once you are done creating the virtual machine, reboot into macOS and create a new VM that uses your existing VDI file.

A screenshot showing the Ubuntu VM from Windows running in MacOS.

FYI: learn some of VirtualBox’s hidden features in our VirtualBox Cheatsheet.

Frequently Asked Questions

Why does my VM load slowly whenever I boot it?

This is most likely due to the transfer speed of either your machine’s USB port or your USB storage device. To fix this, you can install your VM’s VDI file on a USB 3.0-compatible disk and plug it to your machine’s USB 3.0 port.

Can I convert an existing VM install to a shareable one?

Yes. To do this, you need to copy the VDI file from your computer’s disk to your external drive. In Windows, you can find your existing VDI files in “C:UsersYOUR-USERNAMEVirtualBox VMs.” For MacOS, it’s in “/Users/YOUR-USERNAME/VirtualBox VMs”, while in Linux it’s in “/home/YOUR-USERNAME/VirtualBox VMs.”

You can copy this VDI file to your external disk and when creating a new virtual machine. That said, in order to use this disk on your current VM you also need to update the location of your VM’s storage device under Settings > Storage in VirtualBox.

Can I move my VDI file on a larger disk after creating the VM?

Yes. VDI files are self-contained virtual versions of physical hard disks. This means that you can move a VDI file to any storage medium that you want and VirtualBox will still be able to load it properly.

Image credit: Gabriel Beaudry via Unsplash and Wikimedia Commons (MacOS Logo, Tux Logo, Windows Logo, VirtualBox Logo). All alterations and screenshots by Ramces Red.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Ramces Red

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

[ad_2]

Source link

Leave a Reply

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

Call Us