How to share folders between your Ubuntu Virtualbox and your host machine

Sometimes you need to share data files between your host computer and your Ubuntu virtualbox. In this tutorial, you will learn how to achieve this so that you will be able to access folders orfiles on your host computer from your Ubuntu virtualbox.

Installing guest additions

Before starting the sharting process, it is mandatory to install your so called virtualbox guest additions. This will allow you to use some cool features such copy and paste, folder sharing and mouse integration.

We have written a small article on how to do this in case your virtualbox runs on Ubuntu. If however your virtualbox runs on Windows, you may want to check this article.

Enabling shared folders

Now that you have installed the guest additions, select your Ubuntu virtual machine as shown below :

And then click on Settings on the menu bar. The popup below will show up. Select the Shared Folders item.

On the right hand side, click on the icon with the Add sign. The dialog box below will be displayed.

Once you click on the Folder Path drop-down list, select the ‘Other’ item.

You will be able to select a folder to be shared with your virtualbox. See snapshot below.

Once the folder is chosen, its full path will be inserted. Tick the checkbox Auto-mount. Click on OK to finish.

The selected folder will be displayed in the Transient Folders List as shown below. Click OK to close the window.

Now run your Ubuntu virtualbox and open up a terminal session.

Run the command below as root :

sudo apt install virtualbox-guest-utils

Once completed, exit the terminal.

Now open your file explorer :

Virtualbox shared folders

You will see your shared folder but with the string “sf_” added at the beginning.

Read: How to copy paste between Windows 10 and Android

If you click on the shared folder you will most likely see the error message below :

Virtualbox shared folder Ubuntu

Read: How to manage permissions in Linux – guide for beginners

In order to access the shared folders, you would need to add your user to a group called vboxsf (there are users and groups). Open up your terminal and run the command below :

sudo adduser [username] vboxsf

Now enter the command :

sudo reboot

And access again your shared folder. You will be able to create/delete/change files .

Virtualbox shared folders Linux


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Nikolaus Oosterhof

Nikolaus has a degree in software development. He is passionate about gadgets with a screen, nostalgic for phones, a retired gamer and open source programmer. He likes also to write about macOS and Windows. design web pages and debug long programs!

Leave a Reply

Close Menu