Created
February 20, 2017 10:25
-
-
Save Luxian/f6c8bd9cea390206aa7cc64c89742eb0 to your computer and use it in GitHub Desktop.
Script that mounts a VirtualBox share in Linux guest VMs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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