2016. július 15.

Shared Folders setup on Ubuntu 16.04 as a VirtualBox Guest


  1. On Ubuntu 18.04 guest with VirtualBox 6.0.8: install build tools first
    1. sudo apt-get install build-essential gcc make perl dkms
    2. reboot
  2. Install the Virtual Box Guest Addition
    • from vbox menu: "Devices" --> Insert Guest Addition CD Image...
    • If you get "failed to connect to the virtualbox kernel service access denied" error message after reboot or in the future:
      1. Eject the VBOXGUESTADDITION CD image from Ubuntu
      2. Reinsert the image from the vbox menu.
  3. Add Shared Folders in vbox menu "Devices" --> Shared Folders --> Shared Folders Settings
    • check the checkboxes that apply to your needs.
    • the following part of the tutorial assumes you checked Auto-mount and Make Permanent options.
  4. Add yourself to the VBOXSF user group
    • A) install gnome-system-tools to get a graphical user interface for that, and then run users-admin from the terminal or "Users and Groups" from menu.
    • B) use the command line: sudo usermod -aG vboxsf userName
  5. Now, your shared folder should be mounted with the "sf_" prefix.
If something does not happen at once, then do a reboot.

To modify the default mounting point (/media/sf_...) refer to the accepted answer in this post.

Sources:
  • https://help.ubuntu.com/community/VirtualBox/SharedFolders
  • http://www.howtogeek.com/187703/how-to-access-folders-on-your-host-machine-from-an-ubuntu-virtual-machine-in-virtualbox/
  • http://askubuntu.com/questions/456400/why-cant-i-access-a-shared-folder-from-within-my-virtualbox-machine
  • http://askubuntu.com/questions/642991/virtualbox-ubuntu-14-04-vboxclient-the-virtualbox-kernel-service-is-not-runnin
  • https://askubuntu.com/questions/161759/how-to-access-a-shared-folder-in-virtualbox