Share Your VirtualBox VM Across Different OS
[ad_1]
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…
Click the dropdown list below the File system label, then select ExFAT.
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.
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.
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.
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.
Click Next to accept the default partition size, then click the Other radio button, then press Next.
Select ExFAT on the filesystem selection, then press Create to install it to your device.
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.
Click the Hard Disk dropdown tab, then click the Browse button under the Hard Disk File Location and Size category.
Find your external disk, then select that as the location of your VDI 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.
Provide the name and type of your VM, then click Next.
Ensure that the VM on your second OS has the same amount of memory and processors allocated to it.
Click the Use an Existing Virtual Hard Disk File radio button, then click the Browse button on the right side of the window.
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.
On the next window, click Next then Finish. It will bring you back to the 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 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.
Provide the name and a type to your new VM, then click the Hard Disk dropdown tab.
Click on the icon beside the Hard Disk Location and Size field and select any folder in the external disk.
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.
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
[ad_2]
Source link