Why can't I access a shared folder from within my 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:
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?
You have to mount your folder on your VM.
First you need to install Guest Additions (although I already did this during the installation).
- Start your VM
-
Devices
>Insert Guest Additions CD image...
- I had to manually mount the CD:
sudo mount /dev/cdrom /media/cdrom
- Install the necessary packages:
sudo apt-get install make gcc linux-headers-$(uname -r)
- 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.
How to access Windows Host shared directory from Ubuntu VirtualBox Guest:
- Create a directory in Windows on any location of your choice.
- In the VirtualBox go to the settings of the Ubuntu Guest.
- Under the Shared Folder section add the location of you folder created with full permission.
- Now start the ubuntu guest, and make sure that you have the latest VirtualBox Guest Additions installed
-
Now add your user to the vboxsf group:
sudo usermod -aG vboxsf $(whoami)
Logout the user and login again.
- Now you can access your shared directory in
/media/sf_(shared_folder_name)
.
How to share folders in virtual box (Step by Step Guide)
- Go to
Virtual Box/Device/Shared
Folder (on host OS) - Add a folder that you want to share in the pop-up. (on host OS)
- Let’s name this folder “Shared” (on host OS)
- Now Go to Device and install guest addition.
-
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
-
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
-
Now do the final step by mounting the folder (on guest OS)
sudo mount -t vboxsf share ~/Share/
Done! now sync files between Host and Guest OS through virtual box.
- Highlight the VM, go to Settings > Shared Folders and add folder.
- Start VM Go to Devices > Insert Guest Additions CD image.
- Allow VM to run Guest Additions installations.
- In terminal run:
sudo adduser (your user name here) vboxsf
- Restart VM.