Skip navigation

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.



    • Prabu
    • Posted June 3, 2009 at 8:45 AM
    • Permalink

    Thanks, It helped me!

    • TXLogic
    • Posted June 10, 2009 at 8:31 PM
    • Permalink

    Yeah, helped me, too. I’d figured this out for another VM about a year ago but had forgotten the details. Thanks.

    • Alphy
    • Posted August 21, 2009 at 7:56 AM
    • Permalink

    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.


    • zerroei
    • Posted September 13, 2009 at 3:27 AM
    • Permalink

    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

    • weaselfeet
    • Posted November 14, 2009 at 7:23 PM
    • Permalink

    cheers dude, big help

    • Roy Canseco
    • Posted January 24, 2010 at 6:21 PM
    • Permalink

    this is great, thanks 🙂

    • Jeff
    • Posted January 27, 2010 at 8:24 AM
    • Permalink

    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

    • Brad
    • Posted March 11, 2010 at 7:55 AM
    • Permalink


    • John
    • Posted May 12, 2010 at 8:30 AM
    • Permalink

    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

  1. 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.

    • avoura
    • Posted May 31, 2010 at 1:46 PM
    • Permalink

    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.

    • avoura
    • Posted May 31, 2010 at 1:47 PM
    • Permalink

    This is for an Ubuntu 10.04 guest on a Ubuntu 9.04 host.

    • avoura
    • Posted May 31, 2010 at 2:33 PM
    • Permalink

    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

    • Rodrigo Lopes
    • Posted June 29, 2010 at 12:13 PM
    • Permalink

    thank you Avora! You saved my day!

  2. @ 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”

    • Dave
    • Posted November 19, 2010 at 6:25 PM
    • Permalink

    You can also just do this to immediately execute the new fstab line:
    sudo mount -a

    • João Vicente
    • Posted January 7, 2011 at 7:20 AM
    • Permalink

    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.

    • Autiwa
    • Posted April 3, 2011 at 7:43 AM
    • Permalink

    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

    • John
    • Posted September 10, 2012 at 1:31 AM
    • Permalink

    To automount (etc/fstab) with proper permissions:

    SHARENAME /mnt/shared vboxsf rw,exec,uid=1000,gid=1000,dev 0 0

    • Ivanov
    • Posted September 26, 2012 at 7:09 AM
    • Permalink

    Videos /home/my_user_name_here/Videos vboxsf defaults 0 0 works on ubuntu 12.04 😀

  3. Leaving the options after vboxsf solved my problem! Thanks

One Trackback/Pingback

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: