Sharing folders between Ubuntu(guest) and Windows 7 (host) using VirtualBox
Solution 1
If you get Permission denied when accessing the mounted shared folder, run the following command:
sudo adduser <yourUsername> vboxsf
Substitute <yourUsername>
by your actual username (e.g. john
or whichever is yours).
Then restart and you should have full access.
Solution 2
run this on your terminal and everything is going to be fine:
sudo mkdir /media/(folder-name-on-linux)
sudo mount -t vboxsf (folder-name-set-on-virtualBox) /media/(folder-name-on-linux)
(folder-name-on-linux) will be available easily on your File Manager
PS: That way you won't need to restart your VM ;-)
Solution 3
Close out your guest VM, and then open up the Settings dialog for that VM. Down near the bottom of the left hand navigation area in that dialog should be an option for shared folders.
You can select which folder(s) on the host machine you want shared with that particular guest VM, whether you want them mounted read-only by the guest, and whether to make them available on boot of the VM. Once done, restart / restore the guest VM and you should be able to navigate to the new filesystem or folder.
I usually make a new folder inside the 'VirtualBox VMs' folder in my user directory, titled 'Shared' and then share that folder with any guest VMs that need it. I mount it read-only so that no one machine can b0rk it for the others, and then I can place any necessary files in there that are desired.
Solution 4
you should make the option of "insert guest addition CD image" active, from the devices menu, in order to enable shared folder. the shared folder should appear in the /media.
Related videos on Youtube
user288609
Updated on September 18, 2022Comments
-
user288609 over 1 year
I installed Ubuntu guest on a Windows 7 machine using VirtualBox. How can share folders between Ubuntu guest and Windows host? Thanks.
-
Admin over 11 yearsPossible Duplicate: askubuntu.com/q/30202/44179
-
Admin over 11 yearsHave you tried the answer I provided here: askubuntu.com/questions/81757/… . I can't test since I do not have a windows OS around.
-
Admin over 11 yearsPlease also have a look here for prerequisites: askubuntu.com/questions/30396/…
-
-
user288609 over 11 yearsThanks for the answer. After restarting the guest VM, I opened the "Home" folder on Ubuntu(guest), but I still could not find the "shared" folder created and mounted.
-
memilanuk over 11 yearsIt is not normal to mount file systems under a user's /home; look for it in the file system. If it doesn't jump out at you in Nautilus (the file explorer app), it may be under /media/ or /mnt/. I'm not sitting in front of a box with Virtualbox on it at the moment so I can't be more specific than that for now. You may need to have Guest Additions installed on the guest VM - other distros like Debian and SuSE auto-install some version of them; Ubuntu does not.
-
Mitch almost 8 yearsWelcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
-
sercan almost 7 yearsThis definitely needs more upvotes
-
Melebius over 6 yearsLogging out and in sufficed in my case, a full reboot was not needed.
-
isick over 5 yearsThis solved it for me. For any future travelers: you may need to run that second command everytime you restart the guest. Does this mean something else is broken? Probably... But it works for me when nothing else did.
-
Gustavo almost 5 yearsDoesn't work on Windows 7 host and Lubuntu 18 guest.
-
Gustavo almost 5 yearsWorks for a round. After reboot the sharing is gone.
-
AlainD almost 4 yearsOr
sudo adduser $USER vboxsf
if you don't know your username or you want a generic command to use in a script