Ubuntu – Why can’t I access a shared folder from within the Virtualbox machine


I have Ubuntu 14.04 as my host system, and then on Virtualbox, I have Lubuntu 14.04.

I am trying to share a folder on my host system so that my guest system can write files to it. I've followed instructions as best I can, installed the Virtualbox guest additions. I've got to the point where I've added the shared folder in the Devices interface:

shared folder

However, even after rebooting, I can't find the folder anywhere in my guest system.

How do I get my shared folder to actually show up in my guest Lubuntu machine?

Best Answer

You have to mount your folder on your VM.

First you need to install Guest Additions (although I already did this during the installation).

  1. Start your VM
  2. Devices > Insert Guest Additions CD image...
  3. I had to manually mount the CD: sudo mount /dev/cdrom /media/cdrom
  4. Install the necessary packages: sudo apt-get install make gcc linux-headers-$(uname -r)
  5. Install the Guest Additions: sudo /media/cdrom/VBoxLinuxAdditions.run

Now you can mount your share using:

mkdir ~/new
sudo mount -t vboxsf New ~/new

Where New is the name of your shared folder.

Now you can access the shared folder at ~/new.

Note: this is not permanent. To permanently mount your folder you should add the following line to /etc/fstab (sudo nano /etc/fstab):

New /home/user/new vboxsf defaults 0 0

Obviously you should replace user in /home/user/new by your own username.

Related Question