minikube: Version 1.26 no longer auto-mounts VirtualBox shared folders

What Happened?

After upgrading from 1.25.2 to 1.26.0, shared folders from the VirtualBox driver are no longer auto-mounted. If this is expected behavior or requires new configs, I have not found any documentation to that effect.

Using:

  • Mac OSX Monterey 12.4
  • VirtualBox
  • minikube upgraded by brew

In versions prior to 1.26, the “Shared Folders” setup in VirtualBox with “automount” set to true would be auto-mounted to / on bootup of the host container. In 1.26 this no longer happens. minikube mount does work, but this is not convenient and would prefer to use the host drivers anyway instead of 9p.

Tried a full minikube delete and fresh minikube start, with no improvement.

The default setup for VirtualBox is to share the users home directory. In the past, minikube would automount this to /Users.

Adding more shared directories with “automount” would also result in them being automatically mounted in the root directory of the host container.

Note of this happens in 1.26.

Attach the log file

log.txt

Note log entries such as:

I0629 01:38:28.203993 32538 main.go:134] libmachine: COMMAND: /usr/local/bin/VBoxManage sharedfolder add minikube --name Users --hostpath /Users --automount I0629 01:38:28.134845 32538 main.go:134] libmachine: COMMAND: /usr/local/bin/VBoxManage guestproperty set minikube /VirtualBox/GuestAdd/SharedFolders/MountPrefix / I0629 01:38:28.168837 32538 main.go:134] libmachine: COMMAND: /usr/local/bin/VBoxManage guestproperty set minikube /VirtualBox/GuestAdd/SharedFolders/MountDir / SharedFolderNameMachineMapping1=“Users” SharedFolderPathMachineMapping1=“/Users”

These are expected and are supposed to result in auto mounting, but do not.

Operating System

macOS (Default)

Driver

VirtualBox

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 35 (12 by maintainers)

Most upvoted comments

@adam-olema, This is working for me now on RHEL-8. If it’s working for you, I think you can close the issue.

Downgrading back to 1.25.2 definitely fixes this problem.

Same problem on RHEL 8.6.

minikube ssh 'sudo mkdir -p /hosthome; sudo mount -t vboxsf hosthome /hosthome'

works, so the vboxsf drivers are working fine. It just doesn’t mount automatically on start. The missing VBoxService may well be the problem.

This is now fixed as of 1.28 @vroetman

Adding more shared directories with “automount” would also result in them being automatically mounted in the root directory of the host container.

@adam-olema I don’t see how this would be possible considering that VBoxService was previously configured to use the --disable-automount flag

If the binary is not needed (which will make the fix easier, as it is only a matter of a service), what is the path which should be mounted?

I think the service is what is missing. The path is different depending on the host operating system (Linux, Mac, and Windows are all different). My little mount test is only showing that the vboxsf hosthome share is able to mount somewhere.

If you have a working branch, or make a PR, I can build the iso and test it.

These are the steps I used:

% minikube version
minikube version: v1.26.1
commit: 1a5bb3e6850ca685fde7d4b07213e922680e9d2c-dirty

% minikube -p test start minikube --driver=virtualbox
😄  [test] minikube v1.26.1 on Redhat 8.6
✨  Using the virtualbox driver based on user configuration
👍  Starting control plane node test in cluster test
🔥  Creating virtualbox VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.24.3 on Docker 20.10.17 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
    ▪ Want kubectl v1.24.3? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "test" cluster and "default" namespace by default

% minikube profile test
✅  minikube profile was successfully set to test

% minikube ssh ls /hosthome
ls: cannot access '/hosthome': No such file or directory
ssh: Process exited with status 2

% minikube ssh sudo mkdir /hosthome
% minikube ssh 'sudo mount -t vboxsf hosthome /hosthome'
% minikube ssh mount | grep vboxsf
hosthome on /hosthome type vboxsf (rw,relatime)

Same problem on RHEL 8.6.

minikube ssh 'sudo mkdir -p /hosthome; sudo mount -t vboxsf hosthome /hosthome'

works, so the vboxsf drivers are working fine. It just doesn’t mount automatically on start. The missing VBoxService may well be the problem.

Same her on Ubuntu 22.04 with minikube 1.26

working is only on 1.24.0 and 1.25.2