How to Share Host Folders with VirtualBox Ubuntu Guests

|

|

The tutorial guides on sharing folders from VirtualBox host computers to Ubuntu guest machines. This process requires the newest version of VirtualBox and its guest addition tools. Firstly, install VirtualBox Guest Additions, which aids interaction between computers, improves graphics, and enables file sharing. Secondly, share host folders by choosing the guest machine from Settings and…

This brief tutorial shows students and new users how to share folders from VirtualBox host computers to Ubuntu 20.04 | 18.04 guest machines.

You can share folders from the host computer with guest machines when using VirtualBox. Guest machines can be Windows, Linux, or macOS.

This is made possible by the VirtualBox host folder-sharing feature. Folder sharing exposes the host computer files and folders to virtual machines.

For this to work, you must run the latest version of VirtualBox virtualization software with the current version of guest addition tools. You’ll have to enable bidirectional sharing from the host software, and the steps below show you how to do that.

To get started with sharing folders from VirtualBox host to guest machines, follow the steps below:

Install VirtualBox Guest Additions

VirtualBox comes with a guest machines tool called guest additions. You must install the guest additions tool when creating a new guest machine.

The tool provides tight integration between the host and virtual machine operating systems, improvement to the VM graphics performance, shared folder between the host and guest machines, copying and pasting of text, images, and files between the host and guest machine as mouse improvement.

To install the tool in Ubuntu, follow the steps below. First, run the commands below to update the Ubuntu guest machine.

sudo apt update && sudo apt dist-upgrade && sudo apt autoremove

When you’re done, run the commands below to install the latest kernel header and dkms package to support VirtualBox.

sudo apt install virtualbox-guest-dkms build-essential linux-headers-virtual

After installing the packages above, restart your machine and continue below.

To install VirtualBox Guest Additions software on Ubuntu virtual machine operating systems, select the Devices from the VirtualBox host application menu and click Insert Guest Additions CD image…

This should mount a virtual CD/DVD drive inside the Ubuntu guest machine. When that happens, you should get a prompt to run the software. Click Run to begin the installation.

You will have to type your password to install the software. If your account is not an administrative account, the installation will fail.

The Guest Additions suite of utilities is the official tool for VirtualBox virtual guest machines.

Restart the guest machine, and you’re set.

To enable copying and pasting between the guest machine and the host, go to the guest machines settings page (General –> Advanced) and enable it as shown below.

Share the Host Folders

Now that the guest tool is installed in Step 1 run the commands below to enable your account to access the host folder in Ubuntu.

The command to do that is below:

sudo usermod -G vboxsf -a $USER

After running the command above from Ubuntu guest to Ubuntu guest machine settings from the host software, share the folder from the host machine.

Select the guest machine you want to share with, go to the Settings tab, and pick the Shared Folders from the list. Click the Plus ( + ) top to add a folder you want to share.

Browse to the folder on the host machine and select it. Choose that option if you want the folder to mount every time the guest machine starts automatically.

Click OK to save your changes and close.

Turn on the guest machine or reboot if you’re already logged in. The next time you log in, the shared folder on the host should be mounted.

If you don’t see it mounted, go to the /media/sf_FOLDERNAME

That’s it!

Conclusion:

This post showed you how to share VirtualBox host folders with guest machines, including Ubuntu. If you find any error above, please use the comment form below to report.


Discover more from Geek Rewind

Subscribe to get the latest posts to your email.

Like this:



3 responses to “How to Share Host Folders with VirtualBox Ubuntu Guests”

  1. Alan Stubbs Avatar
    Alan Stubbs

    As a newbie, I am baffled from Step 2 onwards.

    My guest machine is Windows XP, so I can’t run Linux commands on it.

    1. Newbie too Avatar
      Newbie too

      The title of this tutorial is “Share Host Folders with VirtualBox Ubuntu Guests”. Emphasis is on the last three words. 😉

  2. Surya Pusapati Avatar
    Surya Pusapati

    Well done, It worked for me.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Geek Rewind

Subscribe now to keep reading and get access to the full archive.

Continue reading