Sharing Folders between Host OS and Guest OS in VirtualBox (2024)

When working on a guest OS, you often need to share files to and from the host OS. A guest OS is an isolated OS that has access to neither the host nor the other machines in VirtualBox. However, the VirtualBox guest addition utility enables the guest machine to share files to and from the host OS.

In this article, we will show you how to install VirtualBox Guest Additions and share folders between the host OS and the guest OS.

Prerequisites

  1. Host OS with VirtualBox installed
  2. Guest OS installed in the virtual machine

For this demonstration, we are using Windows10 as the host OS and Ubuntu 20.04 LTS as the guest OS. To enable sharing between guest and host OS, we will install VirtualBox Guest Additions on the guest OS and then share and mount a folder from the host OS to the guest OS. Let’s get started.

Install VirtualBox Guest Additions on the guest system

To enable file sharing between host and guest, you must install Guest Additions in the guest OS. To do so, the following steps must be taken:

1. Open VirtualBox in your host system and start a guest operating system.

2. On the top menu bar of VirtualBox, click Devices, then select Insert Guest Additions CD image to insert a virtual CD inside the guest system.

Sharing Folders between Host OS and Guest OS in VirtualBox (1)
3. The following message will appear. Click Run to install Guest Additions on the guest machine.

Sharing Folders between Host OS and Guest OS in VirtualBox (2)
4. Installation will begin, and once completed, you will be asked to press Enter to close the window. Press Enter to finish the installation.

Sharing Folders between Host OS and Guest OS in VirtualBox (3)
Once VirtualBox Guest Additions has been installed on the Guest OS, you can share folders between the host system and the guest system.

Share folders between host and guest

Now, we will share a folder between the host and guest systems. You can share multiple folders between the guest OS and the host OS. For folder sharing, either create a new folder or use an existing folder. Follow the steps below to share a file or folder between the host and guest systems.

1. From the top menu bar of VirtualBox, go to Shared Folders > Shared Folders Settings.

Sharing Folders between Host OS and Guest OS in VirtualBox (4)

2. You will see the following settings window in your guest system. Click the + button to open the Add Share dialog box.

Sharing Folders between Host OS and Guest OS in VirtualBox (5)

3. In the Add Share dialog box, select the shared folder using the Folder Path drop-down, and choose a folder from your host OS. Then, type a name for your shared folder, and check the Auto-mount box. The Auto-mount option will automatically mount the shared folder on the next boot.

Sharing Folders between Host OS and Guest OS in VirtualBox (6)
Now, click OK to close the Add Share dialog. You will now see the shared folder in the Settings window. Click OK to close the window.

Sharing Folders between Host OS and Guest OS in VirtualBox (7)
4. By default, only root and members of vboxsf are allowed to access the shared folder. To assign permissions to your user account, issue the following command in the terminal, replacing with the actual username:

$ sudo usermod -aG vboxsf

5. If you open File Manager or Explorer in your guest OS, then you will see the shared folder sf_shared_folder mounted there, where sf_shared_folder is the name of your shared folder.

Sharing Folders between Host OS and Guest OS in VirtualBox (8)
The shared folder can also be accessed from the command line. Open the command line using Ctrl+Alt+T, and then navigate to /media directory using the following command in the terminal:

$ cd /media

Here, if you run the cd command, you will see your shared folder listed under the /media directory.

Sharing Folders between Host OS and Guest OS in VirtualBox (9)
Now, navigate to the shared folder using the cd command as follows:

$ cd sf_shared_folder/

Make sure to replace sf_shared_folder with the name of your shared folder.

In the shared folder, you can place any file you want to share with your host OS. Similarly, you can access any file shared by your host OS.

Sharing Folders between Host OS and Guest OS in VirtualBox (10)

Conclusion

This article showed you how to set up folder sharing between a host system and a guest system in VirtualBox. You need to follow the above procedure for your guest machines only once. After that, the shared folder of the host will be automatically mounted in the guest OS on every boot for file sharing.

Sharing Folders between Host OS and Guest OS in VirtualBox (2024)

FAQs

How to share folders between guest and host in VirtualBox? ›

To share a host folder with a virtual machine in Oracle VM VirtualBox, you must specify the path of the folder and choose a share name that the guest can use to access the shared folder. This happens on the host. In the guest you can then use the share name to connect to it and access files.

How to copy files from host OS to guest OS in VirtualBox? ›

Dragging and Dropping Files in VirtualBox

On the top bar of the running guest machine, click on Devices > Drag and Drop and make sure that Bidirectional is selected. This means that you will be able to drag files from the host to the guest and from the guest to the host.

How to share a folder from VM to host? ›

You can share a folder between the host and virtual machines by enabling folder sharing from the virtual machine's settings. For this, you need to go to the virtual machine library in the VMware workstation, click on the virtual machine settings, and enable folder sharing.

How is the shared folder mounted within the guest operating system? ›

Windows Guests

If "Auto-mount" is enabled in the VirtualBox settings, Windows guest systems typically make the shared folder available in the Network Locations. It can also appear as a network drive automatically.

How to copy and paste between a VirtualBox host machine and a guest machine? ›

Access the settings of the VM by navigating to the General section and selecting the Advanced tab. 3. Within the Advanced tab, you will find a setting to enable the “shared clipboard.” It offers three options: disabled, host to guest, and bidirectional. Opt for the bidirectional option.

How do I access files from guest in VirtualBox? ›

In the Virtualbox Manager window, right-click on your guest machine and select Settings. In the left pane, select Shared Folders. Then click on the add button to add a shared folder.

How do I share a VM between computers? ›

You can do this by selecting the VM and go with File > Export Appliance and File > Import Appliance . By exporting, a file with the . ova format will be created, it is an archive that contains all the files needed to use the VM, by importing it in another installation, you will have the same VM on the second computer.

How do I move a VM from one folder to another? ›

Process to copy the virtual machine:

Shut down your virtual machine. Note: Copying a virtual machine while it is running or suspended can create a copy that may not boot. Select the folder where the virtual machine is stored and press Ctrl+c. Select the location where you want to copy the virtual machine.

How do I share a VM with someone? ›

Sharing a VM to another user
  1. Connect to the VM via RDP and login to the administrator account. ...
  2. Create a local user or administrator account in Windows 10. ...
  3. Navigate to Control Panel > System and Security > Administrative Tools > Computer Management.
Aug 26, 2021

What is the role of host OS and guest OS in cloud computing? ›

The host operating system is software installed on a computer system that communicates with the underlying hardware. While a guest OS is software that is installed in a virtual machine. The host operating system executes directly on the hardware while a guest operating system executes on a virtual machine.

How to share files between two virtual machines? ›

Using Shared Clipboard to Transfer Files to VMs from a Host
  1. Select your VM in the left pane where VMs are listed.
  2. Click Edit virtual machine settings (VM > Settings).
  3. Select the Options tab and click Guest Isolation. Select two checkboxes: Enable drag and drop. Enable copy and paste.
Nov 6, 2023

What's the difference between a shared folder and a shared drive? ›

The key difference between Google Shared Drives and Google Shared Folders is ownership. Google Shared Drives: Ownership of the files and folders inside the drive is held by the drive itself, and all members of the drive have access to and control over the files and folders as set by the drive permissions.

How to share clipboard between VirtualBox and Host? ›

In virtualbox settings > shared folders for your VM click the icon top right with the + symbol. In the window that pops up: Folder path - this is the folder on the host you want to share, I'm sharing all of my home folder. You can click on the down arrow and navigate to the folder in the host you want to share.

How to enable a VirtualBox shared folder for Linux guest systems? ›

How to Share Folder Between Host and Guest System in VirtualBox
  1. Select the option in Device menu.
  2. Create a shared folder – settings.
  3. shared folder created by VirtualBox.
  4. owner of the share folder.
  5. Settings folder name mapping between guest and host.
Jan 6, 2023

How to share files between VirtualBox Ubuntu and host computer? ›

Create a shared folder. From Virtual menu go to Devices->Shared Folders then add a new folder in the list, this folder should be the one in windows which you want to share with Ubuntu(Guest OS). Make this created folder auto-mount. Example -> Make a folder on Desktop with name Ubuntushare and add this folder.

How do I share a VirtualBox VM between Windows users? ›

When you create a VM, it is added to VirtualBox Manager automatically, but for another user to see it in the Manager application, they must add it, from the menu Machine > Add and browsing to the VMs . vbox or . xml file. Note however that you will not be able to easily share a Running VM.

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 5869

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.