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?

  • How are you trying to access the shared folder? – Louis Matthijssen Apr 27 '14 at 14:08
  • @LouisMatthijssen, I was led to believe it would show up in my /media folder on my guest machine. There is no folder there, or in /opt or /mnt, or anywhere else. – Questioner Apr 27 '14 at 14:09
  • this askubuntu.com/a/161883/202806 may help you. – Avinash Raj Apr 27 '14 at 14:30
  • @AvinashRaj, I tried the commands suggested there, but I'm getting the same mount errors I've reported in the comments below. – Questioner Apr 27 '14 at 14:42
  • 1
    This may help too: askubuntu.com/questions/30396/… – Takkat Apr 27 '14 at 15:44
up vote 81 down vote accepted

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.

  • 1
    Thanks for this response. I got the error response: mount: unknown filesystem type 'vboxsf'. – Questioner Apr 27 '14 at 14:19
  • 4
    According to this you have to execute sudo apt-get install virtualbox-ose-guest-utils. – Louis Matthijssen Apr 27 '14 at 14:20
  • 1
    I've updated my answer, but you already seem to have the Guest Additions. I'll try it with Lubuntu myself and update my answer if I find a solution. – Louis Matthijssen Apr 27 '14 at 14:56
  • 2
    Okay, I managed to get it working. It seems that /sbin/mount.vboxsf is linked to the wrong file (this will be fixed in the next version). Please create a link to the good file (for x64): sudo ln -sf /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf. – Louis Matthijssen Apr 27 '14 at 15:14
  • 3
    I couldn't get it working in a clean way too. The following works for me: execute sudo nano /etc/rc.local and add mount -t vboxsf New /home/user/new before exit 0. – Louis Matthijssen Apr 27 '14 at 15:46

How to access Windows Host shared directory from Ubuntu VirtualBox Guest:

  1. Create a directory in Windows on any location of your choice.
  2. In the VirtualBox go to the settings of the Ubuntu Guest.
  3. Under the Shared Folder section add the location of you folder created with full permission.
  4. Now start the ubuntu guest, and make sure that you have the latest VirtualBox Guest Additions installed
  5. Now add your user to the vboxsf group:

    sudo usermod -aG vboxsf $(whoami)
    
  6. Logout the user and login again.

  7. Now you can access your shared directory in /media/sf_(shared_folder_name).
  • 2
    This answer helped me a lot. That was the ONLY reason. sudo usermod -aG vboxsf $(whoami) – user565447 Mar 27 '17 at 13:19
  • The usermod part worked for me ... after I logged out and back in again. Just opening a new terminal did not cut it, a login was required. – user1683793 Feb 24 at 3:22

How to share folders in virtual box (Step by Step Guide)

  1. Go to Virtual Box/Device/Shared Folder (on host OS)
  2. Add a folder that you want to share in the pop-up. (on host OS)
  3. Let’s name this folder “Shared” (on host OS)
  4. Now Go to Device and install guest addition.
  5. Now next step would be to create a folder that you want to sync with host OS, but make sure that you are at /home/UserName.

    You can check it by typing pwd in the terminal. Now creating directory -

    mkdir Share
    sudo chmod 777 /home/userName/Share
    
  6. Now install guest additional package (Crucial step! People generally miss this which creates an error “Unknown file type “vboxsf”)

    sudo apt-get install virtualbox-ose-guest-utils
    
  7. Now do the final step by mounting the folder (on guest OS)

    sudo mount -t vboxsf share ~/Share/
    
  8. Done! now sync files between Host and Guest OS through virtual box.

  • Can you explain 4-th point? – gstackoverflow Mar 24 '17 at 16:42
  • @gstackoverflow: From the host OS, in the VirtualBox menu, click [Devices] -> [Insert Guest Additions CD Image]. You will see a popup within the host prompting whether to automatically run the contents on the CD—do so. – Jay Sullivan Jun 21 '17 at 2:28

It`s important verify that you have upgraded the virtual box version. In my case I was trying to mount my very old version of guess additions on ubunto 15.04 and every thing failed. The solution were simple: Upgrade your Virtual box app.

1.) Highlight the VM, go to Settings > Shared Folders and add folder.
2.) Start VM
3.) Go to Devices > Insert Guest Additions CD image...
4.) Allow VM to run Guest Additions installations
5.) In terminal run: sudo add user (your user name here) vboxsf
6.) Restart VM

The easiest thing to do would be to create a homegroup in windows if you are running the ubuntu OS in Virtual box for windows. Install guest additions. Then go to Files and look for Network. Ubuntu will help you join the home-group in windows and depending on how you have set sharing privileges, you can access, edit and transfer data. Please bear in mind that you should be connected to a network, and ADHOC, some wireless LAN etc but not necessarily to the Internet.

I solved it by installing samba and sharing the folder with unity features. Then I could see the folder in the network of my virtual machine.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.