Share Folders between Host and Guest OS in VirtualBox

Sadly, not as simple as dragging and dropping

VirtualBox is one of the best (and free!)virtual machineapplications out there, but it’s even more useful if your virtual computer can integrate more tightly with the host computer.

While you can network the host and guest computer together pretty easily, most people probably just want a simple way to share folders between the host and guest OS in VirtualBox. The good news is that this is quite easy to do!

Clearing Up The Terminology

It’s important that we quickly clear up a few key terms that will be used in this article:

If you’ve ever seen the movieThe Matrixthen you can think of the virtual machine as a computer living in a simulated world. It thinks it’s a real computer, but it’s actually just software.

Operating System Compatibility

In order to use the shared folder function built into VirtualBox, you need to install something called “Guest Additions” on the guest computer. At the time of writing there are additions for:

For most people the guest machine will probably run Windows or Linux. If you’re running something more exotic (or trying to run macOS) then this method won’t work.

Installing Guest Additions

Before you can make shared folders work, you need to installguest additionson the virtual machine in question. This works by putting a virtual CD into the virtual machines imaginary CD drive. We’re usingUbuntu Linuxhere, but VirtualBox will automatically detect which additions are right for the Guest operating system.

All you have to do is run your virtual machine and then clickDevicesand thenInsert Guest Additions CD Image…

In our case the “CD” auto-played and the additions installed without issue. We restarted our virtual machine just in case, but it isn’t strictly needed. With guest additions installed, you’re ready to add a shared folder to your virtual machine.

Creating a Shared Folder On The Host Machine

VirtualBox presents a shared folder on the host computer as a shared network drive or as a special extension of the file system to the guest computer’s operating system. So you’ll want to designate that folder on the bare metal computer for it to use.

You can assign different shared folders to each virtual machine guest. It can be a folder that already exists or it can be one you’ve created especially for this purpose. In either case, once you’ve decided which folder you want to share with the virtual machine, we have to select and mount it.

We’ve created a folder with a test text file inside for demonstration purposes.

Enable File Sharing On The Guest Machine

You can add the shared folder to your virtual machine with it running or stopped. We’re going to mount the shared folder with our Ubuntu machine running.

The shared folder appeared on our Ubuntu desktop, but you may have to look for it in your operating system’s network drive list or in the file system explorer. In Ubuntu we had to enter the administrator password when opening the folder.

To remove the shared folder, simply go back to the same window you added it in the first place and remove it from the list. While the folder is shared, you can basically use it as any other mounted disk or drive.

Alternative Ways To Share Folders Between Host & Guest

Using the official method of sharing files between host and guest isn’t the only way you can move files between your bare metal computer and the virtual machine.

One easy way to transfer files is by using a USB flash drive. VirtualBox lets you give control of a USB device to the virtual machine. Simply copy all of the files you want to transfer to a flash drive and then switch control to the virtual machine using the VirtualBox menu.

Since your virtual machine also has internet access, you can install a cloud storage package such as Dropbox on both systems, assuming there’s a version available for the guest operating system. Although this does mean that files will sync over your internet connection, which could be slow and eat your data cap, if you have one.

If all you want to do is copy something that will fit in the clipboard (such as a password) then you’re better off enabling the shared clipboard in VirtualBox, which is also a part of guest additions.

Virtually Flawless File Sharing?

Virtual machines are an incredible feat of technology, but it’s still the computer equivalent of duct-tape and cardboard as far as elegance goes. Ultimately any solution to share files between a host and guest system will be some degree of kludge.

That being said, we didn’t have any trouble getting it to work between our Windows host and Ubuntu guest. Plenty of users are going to run into some rough spots thanks to how much variation there can be between host and guest operating system types, but luckily theVirtualBox communityhas seen it all.

So if you do run into an issue you can’t resolve, we recommend first giving the forums a search and then posting a question if the answer isn’t already there. However, most people who follow the instructions above are going to be just fine.

Sydney Butler is a social scientist and technology fanatic who tries to understand how people and technology coexist. He has two decades of experience as a freelance computer technician and more than a decade as a technologies researcher and instructor. Sydney has been a professional technology writer for more than five years and covers topics such as VR, Gaming, Cyber security and Transhumanism.Read Sydney’s Full Bio

Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.

HomeAbout UsEditorial StandardsContact UsTerms of Use

Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved