Skip to content

Instantly share code, notes, and snippets.

@bguiz
Created July 8, 2014 01:11
Show Gist options
  • Save bguiz/a5a42ffbccfc46d74d23 to your computer and use it in GitHub Desktop.
Save bguiz/a5a42ffbccfc46d74d23 to your computer and use it in GitHub Desktop.
mounts virtualbox shared directories
#!/bin/bash
# Mounts all known drives shared via virtual box
# configuration
MOUNT_POINT="${HOME}/media"
MOUNT_DIRS="foo bar" #replace with the ones you have configured for your virtual machine
USERID=$( id -u )
GROUPID=$( id -g )
for DIR in ${MOUNT_DIRS} ; do
mkdir -p ${MOUNT_POINT}/${DIR}
sudo mount -t vboxsf -o rw,uid=${USERID},gid=${GROUPID} ${DIR} ${MOUNT_POINT}/${DIR}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment