Skip to content

Instantly share code, notes, and snippets.

@Luxian
Created February 20, 2017 10:25
Show Gist options
  • Select an option

  • Save Luxian/f6c8bd9cea390206aa7cc64c89742eb0 to your computer and use it in GitHub Desktop.

Select an option

Save Luxian/f6c8bd9cea390206aa7cc64c89742eb0 to your computer and use it in GitHub Desktop.
Script that mounts a VirtualBox share in Linux guest VMs
#!/bin/bash
# Target directory
DIRECTORY=~/Desktop/vboxshare
# Folder name (from VirtualBox share folders settings)
FOLDER_NAME="share";
# Make sure the directory exists
if [ ! -d "$DIRECTORY" ]; then
mkdir -p "$DIRECTORY";
fi
# Mount VirtualBox share
sudo mount -t vboxsf -o umask=022,gid=$(id -g),uid=$UID $FOLDER_NAME $DIRECTORY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment