Skip to content

Commit

Permalink
Disable virtualbox host mounting by default
Browse files Browse the repository at this point in the history
Users can still set up manual mounts through vbox using the vboxmanage
command or GUI.  Users can also utilized the built in `minikube mount`
command.
  • Loading branch information
r2d4 committed Jun 23, 2017
1 parent c5becb3 commit 4545f8d
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions deploy/iso/minikube-iso/package/automount/minikube-automount
Original file line number Diff line number Diff line change
Expand Up @@ -169,44 +169,6 @@ swapon "${UNPARTITIONED_HD}2"
# /etc dirs are initialised from /usr/local, to allow the user/admin to customise
mkdir -p /var/lib/boot2docker/etc/

# Below code is taken from: https://github.com/boot2docker/boot2docker/blob/master/rootfs/rootfs/etc/rc.d/vbox
# VirtualBox Host Mounting
# - this will bail quickly and gracefully if we're not in VBox
if modprobe vboxguest &> /dev/null && modprobe vboxsf &> /dev/null; then
mountOptions='defaults,iocharset=utf8'
if grep -q '^docker:' /etc/passwd; then
mountOptions="${mountOptions},uid=$(id -u docker),gid=$(id -g docker)"
fi

# try mounting "$name" (which defaults to "$dir") at "$dir",
# but quietly clean up empty directories if it fails
try_mount_share() {
dir="$1"
name="${2:-$dir}"

# normalize "dir" to be definitively root-relative
# ie, "/Users" and "Users" will both translate to "/Users" explicitly
dir="/${dir#/}"

mkdir -p "$dir" 2>/dev/null
if ! mount -t vboxsf -o "$mountOptions" "$name" "$dir" 2>/dev/null; then
rmdir "$dir" 2>/dev/null || true
while [ "$(dirname "$dir")" != "$dir" ]; do
dir="$(dirname "$dir")"
rmdir "$dir" 2>/dev/null || break
done

return 1
fi

return 0
}

for line in $(VBoxControl --nologo sharedfolder list -automount | tail -n+3 | cut -d ' ' -f 3); do
try_mount_share "$line"
done
fi

# This script will get called when the machine is started up
# Feel free to add any initialization you need to be ran here
if [ -e /var/lib/boot2docker/bootlocal.sh ]; then
Expand Down

0 comments on commit 4545f8d

Please sign in to comment.