Categories
Linux VirtualBox

Mounting VirtualBox Shared Folder in Ubuntu

2 min read

This how to guides you through the steps to setup a shared folder with your host OS and Ubuntu guest.

Prerequisites

There are a couple of prerequisites for this guide:

  • A folder for sharing created on the host
  • Guest Additions installed on guest

My host is Windows and I have created a folder C:\Shared.

Right click on your VM and go to Settings… or inside your running VM go to Devices > Shared Folders > Shared Folder Settings…

Add a new shared folder. At the Add Share window, choose your Folder Path. In Folder Name, type “Shared”. Uncheck Read-only and Auto-mount, check Make Permanent.

Open a terminal session in your VM. Create a “Shared” directory in your home.

mkdir ~/Shared

Mount the shared folder from the host to your ~/Shared guest directory.

sudo mount -t vboxsf Shared ~/Shared

You should now be able to access the share in your VM.

The mount created is just temporary. To make it permanent follow the below steps.

Add the following line to /etc/fstab – be sure to replace michael with your username.

Shared	/home/michael/Shared	vboxsf	defaults	0	0

Add the following line to /etc/modules.

vboxsf

Reboot the VM and verify your share on the guest is still linked with the host.