From 4545f8d31812f7ad4f73ca84b287ef0c56e7c687 Mon Sep 17 00:00:00 2001 From: Matt Rickard Date: Fri, 23 Jun 2017 13:55:32 -0700 Subject: [PATCH] Disable virtualbox host mounting by default 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. --- .../package/automount/minikube-automount | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/deploy/iso/minikube-iso/package/automount/minikube-automount b/deploy/iso/minikube-iso/package/automount/minikube-automount index a59993d62892..72f50c0f4a3a 100755 --- a/deploy/iso/minikube-iso/package/automount/minikube-automount +++ b/deploy/iso/minikube-iso/package/automount/minikube-automount @@ -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