nce upon a time I’m writing another blog post about Virtualbox. It’s my obsession lately.
So, I finally discovered a simple way to make it so that any folders I share using Virtualbox will mount automatically when I start up the guest operating system. I am using Windows Vista as my host, and Ubuntu 8.04.1 (Hardy Heron) as my guest. I have shared my Videos folder in Windows with my virtual Ubuntu installation (using Devices/Shared Folders in VirtualBox). I used to have to type
mount -t vboxsf Videos /home/my_user_name_here/Videos
in the Terminal everytime I wanted to use the folder. But now I add
Videos /home/my_user_name_here/Videos vboxsf defaults 0 0
to the end of my fstab file (in Terminal: sudo gedit /etc/fstab) and when I restart Ubuntu, my Videos folder is populated with all of my beloved video files sitting on my Windows host machine. Hope that helps someone. And they all lived happily ever after. ZZZZZZ
UPDATE: FYI, this works on Ubuntu 8.10 (Intrepid Ibex) as well.
UPDATE: To get this to work in Ubuntu 9.04 (Jaunty Jackalope) I used this:
videos /home/my_user_name_here/Videos vboxsf
I guess it just uses the defaults. Security concerns? Probably.
18 Comments
Thanks, It helped me!
Yeah, helped me, too. I’d figured this out for another VM about a year ago but had forgotten the details. Thanks.
This is the first time I’m using anything virtual, and also (about a week or two after I’ve started experimenting with VirtualBox) the first time I’ve decided to try to use a shared folder.
I can’t say this told me anything new (before SD and CF cards were automatically mounted, I had to bend over backwards to get those things to work!), but I needed the refresher to make sure I was doing everything (at least approximately) right.
Thanks!
Thanks~I’m trying…..
Wow it’s working….
But I indeed reserve the “default 0 0″ in the line. My fault, unexpectedly, is the “Vboxsf” —BIG “V”—- and My guest os, building in Ubuntu 9.04 either, now can auto-mount shared folders.
So I apparently reckon that the “default” problem is a bit of bug in former version
cheers dude, big help
this is great, thanks
Just FYI, if you’ve got Mac OSX or Linux as a host you may need to add uid and gid parameters to get things working. With default parameters I ended up getting permission errors when I tried to read/write files.
For example, with a Ubuntu 9.10 guest on a Mac OSX 10.5 host I had to use the equivalent of:
videos /home/my_user_name_here/Videos vboxsf gid=1000,uid=1000
Thanks!
This post might be old but the information is still useful. Using the 3/11/2010 post info I am able to get this to work in ubuntu 10.04 (guest) on a 10.04 host box
Thanks.
Hi,
Thanks for this post. Just out of interest I too was rebooting to apply the fstab changes. However, you can do mount/remount fstab changes by;
sudo mount /home/my_user_name_here/Videos -o remount
Thanks again, Tom.
I am trying to get this to work to mount a shared folder as the user rather than root, but it just mounts as root, despite having an fstab entry:
pics ~/Pictures vboxsf defaults 0 0 uid=1000 gid=1000
The user ID is 1000, but it only mounts as root.
This is for an Ubuntu 10.04 guest on a Ubuntu 9.04 host.
I think I managed to resolve it by changing the fstab entry to
pics ~/Pictures vboxsf rw,uid=1000,gid=1000,auto,exec 0 0
thank you Avora! You saved my day!
@ Avoura/Rodrig/OP
I’m using this on a Ubuntu 10.04 Guest and before the boot screen it throws an error trying to mount, although still does anyway using this command “videos /mnt/shares/videos vboxsf rw,uid=1000,gid=1000,auto,exec 0 0″ Any thoughts or similar problems? The error says “Error while mounting /mnt/shares/videos”
You can also just do this to immediately execute the new fstab line:
sudo mount -a
Thanks a lot guys! With Ubuntu 10.10 as host and guest OS’s
Simple as: “pics ~/Pictures vboxsf rw,uid=1000,gid=1000,auto,exec 0 0″
in the last fstab line guest like avoura said and testing without reboot like Dave said.
This doesn’t work for me.
I am on macOS, and I installed Ubuntu 10.10. I try to share a mac folder in my virtualized Ubuntu without success.
My fstab line is :
tex ~/TeX vboxsf rw,gid=1000,uid=1000,auto,exec 0 0
I also tried :
tex ~/TeX vboxsf
tex ~/TeX vboxsf default 0 0
tex ~/TeX vboxsf gid=1000,uid=1000
I defined a share folder in virtualbox. Everything seems ok, but my folder TeX remain empty. However, the line :
sudo mount -t vboxsf tex ~/TeX/
works fine
One Trackback/Pingback
[...] http://rotwhiler.wordpress.com/2008/10/09/mount-virtualbox-shared-folders-automatically-using-fstab/ [...]