Tuesday, June 5, 2018

How to Automount a Virtualbox Shared Folder at Startup



To always mount a Virtual Box "shared folder" on booting an Ubuntu guest we have two options. It is up to personal preference which option works best in our setting.

1. Mount with fstab


To mount a shared folder using the vboxsf filesystem provided with Guest Additions we first need to make sure prerequisites are met. Then we may put the following line in our etc/fstab file:

<name_of_share>   /path/to/mountpoint   vboxsf   <options>  0   0

Replace name_of_share and /path/to/mountpoint with your individual setup (the directory for the mountpoint has to be created first). See the manpage for mount <options>. One possibility is to mount with defaults, or to give specific mount options (e.g. rw, suid, exec, auto, users).