Minikube: Minikube doesn't mount host's user home directory on HyperV VM (Windows 10)

Created on 23 Dec 2017  Â·  10Comments  Â·  Source: kubernetes/minikube

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Please provide the following details:

Environment:

Minikube version (use minikube version): minikube version: v0.24.1

  • OS (e.g. from /etc/os-release): Windows 10 (Version 1709 - OS Build 16299.125)
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): "DriverName": "hyperv",
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): "Boot2DockerURL": "file://C:/Users/adam/.minikube/cache/iso/minikube-v0.23.6.iso",

What happened:

I believe this could be similar to #716
My home directory is not mounted to the minikube VM.

minikube start --vm-driver=hyperv
minikube ssh
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ ls -la /
total 12
drwxr-xr-x  17 root root    0 Dec 23 10:26 .
drwxr-xr-x  17 root root    0 Dec 23 10:26 ..
lrwxrwxrwx   1 root root    7 Oct 19 16:45 bin -> usr/bin
drwxr-xr-x   2 root root 4096 Dec 23 10:26 data
drwxr-xr-x  16 root root 3040 Dec 23 10:26 dev
drwxr-xr-x  28 root root    0 Dec 23 10:26 etc
drwxr-xr-x   4 root root    0 Oct 19 17:23 home
-rwxr-xr-x   1 root root  176 Oct 19 17:23 init
lrwxrwxrwx   1 root root    7 Oct 19 16:45 lib -> usr/lib
lrwxrwxrwx   1 root root    3 Oct 19 16:45 lib64 -> lib
lrwxrwxrwx   1 root root   11 Oct 19 16:50 linuxrc -> bin/busybox
drwxr-xr-x   2 root root    0 Oct 19 16:37 media
drwxr-xr-x   3 root root    0 Dec 23 10:26 mnt
drwxr-xr-x   3 root root    0 Oct 19 17:17 opt
dr-xr-xr-x 131 root root    0 Dec 23 10:25 proc
drwxr-xr-x   2 root root    0 Oct 19 16:37 root
drwxr-xr-x  20 root root  660 Dec 23 10:26 run
lrwxrwxrwx   1 root root    8 Oct 19 16:45 sbin -> usr/sbin
drwxr-xr-x   2 root root    0 Dec 23 10:25 srv
dr-xr-xr-x  12 root root    0 Dec 23 10:25 sys
drwxr-xr-x   6 root root 4096 Dec 23 10:26 tmp
drwxr-xr-x   8 root root    0 Oct 19 16:37 usr
drwxr-xr-x   4 root root    0 Dec 23 10:25 var
$

What you expected to happen:

(copied form #716) I should normally be able to access this directory through the VM. I need this to provide files to the containers controlled by Kubernetes.

--mount-string string The argument to pass the minikube mount command on start (default "C:\Users\USERNAME:/minikube-host")

How to reproduce it (as minimally and precisely as possible):

(copied form #716) Run minikube start then minikube ssh. In the shell we are unable to find the mounted host directory under any names

Output of minikube logs (if applicable):

$ minikube logs |grep volume
Dec 23 10:26:36 minikube localkube[3287]: I1223 10:26:36.878439    3287 controllermanager.go:487] Started "persistentvolume-binder"
Dec 23 10:26:36 minikube localkube[3287]: I1223 10:26:36.878550    3287 pv_controller_base.go:259] Starting persistent volume controller
Dec 23 10:26:36 minikube localkube[3287]: I1223 10:26:36.878733    3287 controller_utils.go:1041] Waiting for caches to sync for persistent volume controller
Dec 23 10:26:36 minikube localkube[3287]: W1223 10:26:36.885288    3287 controllermanager.go:484] Skipping "persistentvolume-expander"
Dec 23 10:26:36 minikube localkube[3287]: W1223 10:26:36.888112    3287 probe.go:215] Flexvolume plugin directory at /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ does not exist. Recreating.
Dec 23 10:26:36 minikube localkube[3287]: I1223 10:26:36.986777    3287 controller_utils.go:1048] Caches are synced for persistent volume controller
Dec 23 10:26:38 minikube localkube[3287]: I1223 10:26:38.296823    3287 kubelet_node_status.go:276] Setting node annotation to enable volume controller attach/detach
Dec 23 10:26:38 minikube localkube[3287]: I1223 10:26:38.321030    3287 volume_manager.go:246] Starting Kubelet Volume Manager
Dec 23 10:26:38 minikube localkube[3287]: I1223 10:26:38.421171    3287 kubelet_node_status.go:276] Setting node annotation to enable volume controller attach/detach
Dec 23 10:26:43 minikube localkube[3287]: I1223 10:26:43.422124    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "addons" (UniqueName: "kubernetes.io/host-path/7b19c3ba446df5355649563d32723e4f-addons") pod "kube-addon-manager-minikube" (UID: "7b19c3ba446df5355649563d32723e4f")
Dec 23 10:26:43 minikube localkube[3287]: I1223 10:26:43.422777    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "kubeconfig" (UniqueName: "kubernetes.io/host-path/7b19c3ba446df5355649563d32723e4f-kubeconfig") pod "kube-addon-manager-minikube" (UID: "7b19c3ba446df5355649563d32723e4f")
Dec 23 10:26:57 minikube localkube[3287]: I1223 10:26:57.887866    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "default-token-mmgt9" (UniqueName: "kubernetes.io/secret/cdf602ac-e7cb-11e7-bc5b-00155d380177-default-token-mmgt9") pod "storage-provisioner" (UID: "cdf602ac-e7cb-11e7-bc5b-00155d380177")
Dec 23 10:26:59 minikube localkube[3287]: I1223 10:26:59.122141    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "default-token-mmgt9" (UniqueName: "kubernetes.io/secret/cea3c935-e7cb-11e7-bc5b-00155d380177-default-token-mmgt9") pod "kubernetes-dashboard-dq6n8" (UID: "cea3c935-e7cb-11e7-bc5b-00155d380177")
Dec 23 10:26:59 minikube localkube[3287]: I1223 10:26:59.678984    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "kube-dns-config" (UniqueName: "kubernetes.io/configmap/ceeccf53-e7cb-11e7-bc5b-00155d380177-kube-dns-config") pod "kube-dns-86f6f55dd5-qxb4q" (UID: "ceeccf53-e7cb-11e7-bc5b-00155d380177")
Dec 23 10:26:59 minikube localkube[3287]: I1223 10:26:59.679183    3287 reconciler.go:212] operationExecutor.VerifyControllerAttachedVolume started for volume "default-token-mmgt9" (UniqueName: "kubernetes.io/secret/ceeccf53-e7cb-11e7-bc5b-00155d380177-default-token-mmgt9") pod "kube-dns-86f6f55dd5-qxb4q" (UID: "ceeccf53-e7cb-11e7-bc5b-00155d380177")
$ minikube logs |grep mount
Dec 23 10:26:38 minikube localkube[3287]: I1223 10:26:38.240151    3287 fs.go:140] Filesystem partitions: map[tmpfs:{mountpoint:/dev/shm major:0 minor:17 fsType:tmpfs blockSize:0} /dev/sda1:{mountpoint:/mnt/sda1 major:8 minor:1 fsType:ext4 blockSize:0}]

Full logs can be found @ https://phabricator.wikimedia.org/P6504

Anything else do we need to know:

I'm new to kubernetes on Windows so I could be screwing something up here.
But this looks so simple I surely can't be.

aremount chyperv kinbug lifecyclrotten owindows

Most helpful comment

With minikube version: v0.27.0, when you run
minikube start --vm-driver=hyperv --mount
your home directory will be mounted on /minikube-host in your minikube virtual machine. Since normally there are lots of directories and files in the home directory, it would be cleaner to run the command with the directory specified, like
minikube start --vm-driver=hyperv --mount --mount-string="C:\Users\AUser\AFolder:/minikube-host"
Be aware that the host directory is mounted in the virtual machine as a Plan9 filesystem via TCP, so you need to make sure your firewall or security software is not dropping connections from minikube virtual machine.

All 10 comments

W/o it fixed, unfortunatelly cant use minikube under windows 10 with hyperv for local development, unless some workaround for mount?

HyperV does not provide any standard hostfolder solution OOTB. You can use
something like fuse-sshfs or smb maybe. We have added this to Minishift,
but haven't backported any of this to minikube yet; bandwidth issues/too
busy.

On Sun, May 6, 2018, 18:28 Sergei Shilko notifications@github.com wrote:

W/o it fixed, unfortunatelly cant use minikube under windows 10 with
hyperv for local development, unless some workaround for mount?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/minikube/issues/2357#issuecomment-386869320,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAHZmJK1QNoHJRK7jJU35NGLO6Bb3c0ks5tvtA4gaJpZM4RLowL
.

i understand, just wanted to confirm and bump the issue

https://kubernetes.io/docs/getting-started-guides/minikube/#mounted-host-folders
Hyper-V not supported etc. / not listed

With minikube version: v0.27.0, when you run
minikube start --vm-driver=hyperv --mount
your home directory will be mounted on /minikube-host in your minikube virtual machine. Since normally there are lots of directories and files in the home directory, it would be cleaner to run the command with the directory specified, like
minikube start --vm-driver=hyperv --mount --mount-string="C:\Users\AUser\AFolder:/minikube-host"
Be aware that the host directory is mounted in the virtual machine as a Plan9 filesystem via TCP, so you need to make sure your firewall or security software is not dropping connections from minikube virtual machine.

@kochinc sorry but is this change introduced in 0.27, cant find in changelogs cause this will realy fix many setups?Thx.

The options --mount and --mount-string have been in minikube for several revisions already. But I just started using minikube on Hyper-V, so have no idea whether mounting host directory on Hyper-V was working or not before. And, there are still issues with the mounted directory. It is always mounted as root:root, and modification time is wrong. For copying files into and out of the Hyper-V virtual machine is working, though.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings