Add share folder in VirtualBox (Windows,Ubuntu,Solaris)

Install VirtualBox Guest Addition
You can manually mount the shared folder from inside a VM the same way as you would mount an ordinary network share:

  • In a Windows guest, shared folders are browseable and therefore visible in Windows Explorer. So, to attach the host’s shared folder to your Windows guest, open Windows Explorer and look for it under “My Networking Places” -> “Entire Network” -> “VirtualBox Shared Folders”. By right-clicking on a shared folder and selecting “Map network drive” from the menu that pops up, you can assign a drive letter to that shared folder.
    Alternatively, on the Windows command line, use the following:

    net use x: vboxsvrsharename

    While vboxsvr is a fixed name (note that vboxsrv would also work), replace “x:” with the drive letter that you want to use for the share, and sharename with the share name specified with VBoxManage.

  • In a Linux guest, use the following command:
    mount -t vboxsf [-o OPTIONS] sharename mountpoint

    To mount a shared folder during boot, add the following entry to /etc/fstab:

    sharename   mountpoint   vboxsf   defaults  0   0
  • In a Solaris guest, use the following command:
    mount -F vboxfs [-o OPTIONS] sharename mountpoint

    Replace sharename (use lowercase) with the share name specified with VBoxManage or the GUI, and mountpoint with the path where you want the share to be mounted on the guest (e.g. /mnt/share). The usual mount rules apply, that is, create this directory first if it does not exist yet.
    Here is an example of mounting the shared folder for the user “jack” on Solaris:

    $ id
    uid=5000(jack) gid=1(other)
    $ mkdir /export/home/jack/mount
    $ pfexec mount -F vboxfs -o uid=5000,gid=1 jackshare /export/home/jack/mount
    $ cd ~/mount
    $ ls
    sharedfile1.mp3 sharedfile2.txt
    $

    Beyond the standard options supplied by the mount command, the following are available:

    iocharset CHARSET

    to set the character set used for I/O operations (utf8 by default) and

    convertcp CHARSET

    to specify the character set used for the shared folder name (utf8 by default).
    The generic mount options (documented in the mount manual page) apply also. Especially useful are the options uid, gid and mode, as they allow access by normal users (in read/write mode, depending on the settings) even if root has mounted the filesystem.