Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable virtualbox host mounting by default #1646

Merged
merged 1 commit into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ var settings = []Setting{
name: useVendoredDriver,
set: SetBool,
},
{
name: "disable-driver-mounts",
set: SetBool,
},
}

var ConfigCmd = &cobra.Command{
Expand Down
3 changes: 3 additions & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const (
apiServerName = "apiserver-name"
dnsDomain = "dns-domain"
mountString = "mount-string"
disableDriverMounts = "disable-driver-mounts"
)

var (
Expand Down Expand Up @@ -116,6 +117,7 @@ func runStart(cmd *cobra.Command, args []string) {
HypervVirtualSwitch: viper.GetString(hypervVirtualSwitch),
KvmNetwork: viper.GetString(kvmNetwork),
Downloader: pkgutil.DefaultDownloader{},
DisableDriverMounts: viper.GetBool(disableDriverMounts),
}

fmt.Printf("Starting local Kubernetes %s cluster...\n", viper.GetString(kubernetesVersion))
Expand Down Expand Up @@ -288,6 +290,7 @@ func init() {
startCmd.Flags().Bool(keepContext, constants.DefaultKeepContext, "This will keep the existing kubectl context and will create a minikube context.")
startCmd.Flags().Bool(createMount, false, "This will start the mount daemon and automatically mount files into minikube")
startCmd.Flags().String(mountString, constants.DefaultMountDir+":"+constants.DefaultMountEndpoint, "The argument to pass the minikube mount command on start")
startCmd.Flags().Bool(disableDriverMounts, false, "Disables the filesystem mounts provided by the hypervisors (vboxfs, xhyve-9p)")
startCmd.Flags().String(isoURL, constants.DefaultIsoUrl, "Location of the minikube iso")
startCmd.Flags().String(vmDriver, constants.DefaultVMDriver, fmt.Sprintf("VM driver is one of: %v", constants.SupportedVMDrivers))
startCmd.Flags().Int(memory, constants.DefaultMemory, "Amount of RAM allocated to the minikube VM")
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ func createVirtualboxHost(config MachineConfig) drivers.Driver {
d.CPU = config.CPUs
d.DiskSize = int(config.DiskSize)
d.HostOnlyCIDR = config.HostOnlyCIDR
d.NoShare = config.DisableDriverMounts
return d
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/minikube/cluster/cluster_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type xhyveDriver struct {
}

func createXhyveHost(config MachineConfig) *xhyveDriver {
useVirtio9p := !config.DisableDriverMounts
return &xhyveDriver{
BaseDriver: &drivers.BaseDriver{
MachineName: cfg.GetMachineName(),
Expand All @@ -68,6 +69,8 @@ func createXhyveHost(config MachineConfig) *xhyveDriver {
Boot2DockerURL: config.Downloader.GetISOFileURI(config.MinikubeISO),
BootCmd: "loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 systemd.legacy_systemd_cgroup_controller=yes base host=" + cfg.GetMachineName(),
DiskSize: int64(config.DiskSize),
Virtio9p: useVirtio9p,
Virtio9pFolder: "/Users",
QCow2: false,
RawDisk: config.XhyveDiskDriver == "virtio-blk",
}
Expand Down
1 change: 1 addition & 0 deletions pkg/minikube/cluster/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type MachineConfig struct {
KvmNetwork string // Only used by the KVM driver
Downloader util.ISODownloader
DockerOpt []string // Each entry is formatted as KEY=VALUE.
DisableDriverMounts bool // Only used by virtualbox and xhyve
}

// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
Expand Down