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

running minikube on a external harddisk with noexec: 'kubeadm': Permission denied #8327

Closed
delucca opened this issue May 30, 2020 · 27 comments
Closed
Labels
co/docker-driver Issues related to kubernetes in container needs-solution-message Issues where where offering a solution for an error would be helpful os/linux priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@delucca
Copy link

delucca commented May 30, 2020

Hey guys.

I'm trying to launch Minikube using docker drive, but I'm facing some permission issues.

Here are my logs:

~ took 5s
❯ minikube start
πŸ˜„  minikube v1.10.1 on Arch 20.0.1
    β–ͺ MINIKUBE_HOME=/mnt/hdd0/home/odelucca
✨  Using the docker driver based on existing profile
πŸ‘  Starting control plane node minikube in cluster minikube
πŸƒ  Updating the running docker "minikube" container ...
🐳  Preparing Kubernetes v1.18.2 on Docker 19.03.2 ...
    β–ͺ kubeadm.pod-network-cidr=10.244.0.0/16
πŸ’₯  initialization failed, will try again: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied

❗  This container is having trouble accessing https://k8s.gcr.io
πŸ’‘  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/

πŸ’£  Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose

πŸ’£  failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose

Also, I can't run it as sudo since it says that I should not run docker Driver as sudo.

Obs: My Docker is already available for my user. I can create any Docker container without the need to sudo it.

@afbjorklund
Copy link
Collaborator

This is odd, it should be possible for minikube to run kubeadm in the privileged container...

Do you have some special settings on your Docker, that enforces security ? Like SELinux

If the container is still around (sometimes it self-destructs), you can try ssh or exec to it.

Something about runnig /var/lib/minikube/binaries/v1.18.2/kubeadm is not working properly.

@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container os/linux kind/support Categorizes issue or PR as a support question. labels May 30, 2020
@delucca
Copy link
Author

delucca commented May 30, 2020

Hi @afbjorklund, thanks for the quick reply.

I have two custom settings, one in my Minikube and other in my Docker.

Here is my daemon.json file for Docker:

{
  "data-root": "/mnt/hdd0/var/lib/docker"
}

The /mnt/hdd0/var/lib/docker is owned by root in root group.

And my MINIKUBE_HOME env var is set to /mnt/hdd0/home/odelucca/.minikube, but that folder is owned by my user.

That is my external Sata driver.

@afbjorklund
Copy link
Collaborator

And that /mnt/hdd0 is using a normal file system, like ext4 or xfs or something ?

Some people reported odd results earlier, when trying to run on odd file systems.

@afbjorklund
Copy link
Collaborator

You could also do some quick sanity check of your docker, without the other params:

$ docker run -d --name ubuntu ubuntu:19.10 sleep 3600
$ docker exec ubuntu mkdir -p /var/lib/minikube/binaries/v1.18.2
$ docker cp ~/.minikube/cache/linux/v1.18.2/kubeadm ubuntu:/var/lib/minikube/binaries/v1.18.2/kubeadm
$ docker exec ubuntu /var/lib/minikube/binaries/v1.18.2/kubeadm

That is supposed to return some help text, describing kubeadm


    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚ KUBEADM                                                  β”‚
    β”‚ Easily bootstrap a secure Kubernetes cluster             β”‚
    β”‚                                                          β”‚
    β”‚ Please give us feedback at:                              β”‚
    β”‚ https://github.com/kubernetes/kubeadm/issues             β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

...

@delucca
Copy link
Author

delucca commented Jun 1, 2020

Hi @afbjorklund,

The filesystem is ext4. I've tried to run the sanity tests and it is failling. Take a look:

~ using ☁️ quintoandar:forno-stag took 11s
❯ docker cp $MINIKUBE_HOME/.minikube/cache/linux/v1.18.2/kubeadm ubuntu:/var/lib/minikube/binaries/v1.18.2/kubeadm
lstat /mnt/hdd0/home/odelucca/.minikube/cache/linux: no such file or directory

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jun 1, 2020

Ok, you might have to download it first - now with preload it is not always available in the cache

minikube start --download-only --preload=false

@delucca
Copy link
Author

delucca commented Jun 1, 2020

@afbjorklund ok. Now I've executed all the commands and the help output shown as expected. Any ideas how to fix the issue?

@afbjorklund
Copy link
Collaborator

I would probably just try deleting the old container (with minikube delete) and start over.

@delucca
Copy link
Author

delucca commented Jun 2, 2020

I've done that, same error:

~
❯ minikube delete
πŸ”₯  Deleting "minikube" in docker ...
πŸ”₯  Deleting container "minikube" ...
πŸ”₯  Removing /mnt/hdd0/home/odelucca/.minikube/machines/minikube ...
πŸ’€  Removed all traces of the "minikube" cluster.

~ took 2s
❯ minikube start
πŸ˜„  minikube v1.10.1 on Arch 20.0.1
    β–ͺ MINIKUBE_HOME=/mnt/hdd0/home/odelucca/.minikube
✨  Using the docker driver based on user configuration
πŸ‘  Starting control plane node minikube in cluster minikube
πŸ”₯  Creating docker container (CPUs=2, Memory=2900MB) ...
🐳  Preparing Kubernetes v1.18.2 on Docker 19.03.2 ...
    β–ͺ kubeadm.pod-network-cidr=10.244.0.0/16
❗  This container is having trouble accessing https://k8s.gcr.io
πŸ’‘  To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
πŸ’₯  initialization failed, will try again: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


πŸ’£  Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose

πŸ’£  failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose

@afbjorklund
Copy link
Collaborator

So if you do the same operation with docker, it succeeds. But when minikube does it, it fails.

Hmm...

@delucca
Copy link
Author

delucca commented Jun 2, 2020

Exactly...

Strange, right? I don't know if it counts, but my MINIKUBE_HOME is in that same driver too. Take a look on the logs I've sent.

@delucca
Copy link
Author

delucca commented Jun 3, 2020

Any updates on this @afbjorklund ? :/

@afbjorklund
Copy link
Collaborator

Sorry, don’t have anything further

@delucca
Copy link
Author

delucca commented Jun 4, 2020

@afbjorklund don't know if that helps, but running it with --alsologtostderr -v=1 gave me the following logs:

...
I0604 11:40:04.802950   31233 ssh_runner.go:148] Run: /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.2/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig"
W0604 11:40:04.807010   31233 logs.go:124] failed describe nodes: command: /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.2/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig" /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.2/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig": Process exited with status 1
stdout:

stderr:
sudo: unable to execute /var/lib/minikube/binaries/v1.18.2/kubectl: Permission denied
 output:
** stderr **
sudo: unable to execute /var/lib/minikube/binaries/v1.18.2/kubectl: Permission denied

** /stderr **
I0604 11:40:04.807035   31233 logs.go:117] Gathering logs for Docker ...
I0604 11:40:04.807044   31233 ssh_runner.go:148] Run: /bin/bash -c "sudo journalctl -u docker -n 400"
I0604 11:40:04.816258   31233 logs.go:117] Gathering logs for container status ...
I0604 11:40:04.816276   31233 ssh_runner.go:148] Run: /bin/bash -c "sudo `which crictl || echo crictl` ps -a || sudo docker ps -a"
I0604 11:40:06.902601   31233 ssh_runner.go:188] Completed: /bin/bash -c "sudo `which crictl || echo crictl` ps -a || sudo docker ps -a": (2.086309656s)
W0604 11:40:06.902740   31233 out.go:201] Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied

πŸ’£  Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose
I0604 11:40:06.902855   31233 exit.go:58] WithError(failed to start node)=startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied
 called from:
goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
k8s.io/minikube/pkg/minikube/exit.WithError(0x1adae43, 0x14, 0x1d9bf60, 0xc0006844c0)
        /app/pkg/minikube/exit/exit.go:58 +0x34
k8s.io/minikube/cmd/minikube/cmd.runStart(0x2ae78c0, 0xc000685600, 0x0, 0x2)
        /app/cmd/minikube/cmd/start.go:204 +0x7f7
github.com/spf13/cobra.(*Command).execute(0x2ae78c0, 0xc0006855e0, 0x2, 0x2, 0x2ae78c0, 0xc0006855e0)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2aa
github.com/spf13/cobra.(*Command).ExecuteC(0x2ae6900, 0x0, 0x1, 0xc0002e8ab0)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
k8s.io/minikube/cmd/minikube/cmd.Execute()
        /app/cmd/minikube/cmd/root.go:112 +0x747
main.main()
        /app/cmd/minikube/main.go:66 +0xea
W0604 11:40:06.903071   31233 out.go:201] failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied

πŸ’£  failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.2:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml  --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap,SystemVerification,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables": Process exited with status 126
stdout:

stderr:
env: 'kubeadm': Permission denied


😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose

Full logs

@medyagh
Copy link
Member

medyagh commented Jun 10, 2020

@odelucca it appears that wherever your docker volume exists on the host has a mount option of not executable

sudo: unable to execute /var/lib/minikube/binaries/v1.18.2/kubectl: Permission denied

I am not fimmilar witth arch but can u figure out where dos the docker volumes are stored in arch and if that is a place that is moutned as executable?

@delucca
Copy link
Author

delucca commented Jun 16, 2020

@medyagh the Docker volumes are stored at Docker Root Path Dir, which I set to /mnt/hdd0/var/lib/docker.

I've tried to set the entire dir (with recursive) as executable, but it also did not work...

I think that might be an issue with the Driver itself. My Docker is working as expected, I can launch any image in it. It doesn't make sense to not work only in Minikube. I think that might be a problem with the Driver itself.

I'm switching to KVM2. It is a shame since I would like to test the Docker driver.

@medyagh
Copy link
Member

medyagh commented Jun 16, 2020

@medyagh the Docker volumes are stored at Docker Root Path Dir, which I set to /mnt/hdd0/var/lib/docker.

I've tried to set the entire dir (with recursive) as executable, but it also did not work...

I think that might be an issue with the Driver itself. My Docker is working as expected, I can launch any image in it. It doesn't make sense to not work only in Minikube. I think that might be a problem with the Driver itself.

I'm switching to KVM2. It is a shame since I would like to test the Docker driver.

@odelucca
I would like to help to find out that root cause for that too, is there any way you could reinstall docker ? do you know if the way you installed docker is the standard way ?

could you try to re-mount your volume with executable ? (instead of chmoding the directory itself) my guess would be your docker volumes are stored in a place that is mounted as not-executable

can you please paste the output of

mount -l

and

cat /proc/mounts

(the commands or path might differ on your distro)

df -aTh

@afbjorklund
Copy link
Collaborator

The binaries are copied with the preload tar, so there shouldn't be any (real) permission issues.
I suppose you have already checked the expected output of ls -l /var/lib/minikube/binaries/*/

docker@docker:~$ ls -l /var/lib/minikube/binaries/v1.18.3     
total 192520
-rwxr-xr-x 1 root root  39813120 May 20 16:36 kubeadm
-rwxr-xr-x 1 root root  44032000 May 20 16:36 kubectl
-rwxr-xr-x 1 root root 113283800 May 20 16:36 kubelet

I guess you could verify by using --preload=false, but I don't think that's it. More likely the mount.
We had an issue with the podman driver (mounting it noexec), haven't heard about docker though.

docker@docker:~$ findmnt /var
TARGET SOURCE                                                            FSTYPE OPTIONS
/var   /dev/mapper/ubuntu--vg-root[/var/lib/docker/volumes/docker/_data] ext4   rw,relatime,errors=remount-ro

@afbjorklund
Copy link
Collaborator

Also, it is more likely to be noexec than ro because otherwise the error is different.

noexec: Permission denied

ro: Read-only file system

@delucca
Copy link
Author

delucca commented Jun 18, 2020

@medyagh

Thanks for trying to help.

I'm using Arch Linux, so I've installed Docker using pacman directly. The only difference from the standard installation is my Data Root Dir, with is located at /mnt/hdd0/var/lib/docker being /mnt/hddo my 1TB Sata Driver.

Here are the outputs your asked for:

~
❯ mount -l
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=6102048k,nr_inodes=1525512,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on / type ext4 (rw,noatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14669)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,noatime)
/dev/sdc1 on /home type ext4 (rw,noatime)
/dev/sda5 on /mnt/hdd0 type ext4 (rw,nosuid,nodev,noexec,noatime,user)
/dev/sda5 on /home/odelucca/Desktop type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Documents type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Downloads type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Drive type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Games type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Music type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Pictures type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Public type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Templates type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sda5 on /home/odelucca/Videos type ext4 (rw,nosuid,nodev,noexec,noatime)
/dev/sdb1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1222308k,mode=700,uid=1000,gid=1000)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
~
❯ cat /proc/mounts

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sys /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
dev /dev devtmpfs rw,nosuid,relatime,size=6102048k,nr_inodes=1525512,mode=755 0 0
run /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/sdb2 / ext4 rw,noatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14669 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /tmp tmpfs rw,noatime 0 0
/dev/sdc1 /home ext4 rw,noatime 0 0
/dev/sda5 /mnt/hdd0 ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Desktop ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Documents ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Downloads ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Drive ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Games ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Music ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Pictures ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Public ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Templates ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sda5 /home/odelucca/Videos ext4 rw,nosuid,nodev,noexec,noatime 0 0
/dev/sdb1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1222308k,mode=700,uid=1000,gid=1000 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
~
❯ sudo df -aTh
[sudo] password for odelucca:
Filesystem     Type             Size  Used Avail Use% Mounted on
proc           proc                0     0     0    - /proc
sys            sysfs               0     0     0    - /sys
dev            devtmpfs         5,9G     0  5,9G   0% /dev
run            tmpfs            5,9G  1,6M  5,9G   1% /run
efivarfs       efivarfs            0     0     0    - /sys/firmware/efi/efivars
/dev/sdb2      ext4             110G   39G   65G  38% /
securityfs     securityfs          0     0     0    - /sys/kernel/security
tmpfs          tmpfs            5,9G  272M  5,6G   5% /dev/shm
devpts         devpts              0     0     0    - /dev/pts
tmpfs          tmpfs            5,9G     0  5,9G   0% /sys/fs/cgroup
cgroup2        cgroup2             0     0     0    - /sys/fs/cgroup/unified
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/systemd
pstore         pstore              0     0     0    - /sys/fs/pstore
none           bpf                 0     0     0    - /sys/fs/bpf
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/cpuset
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/net_cls,net_prio
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/perf_event
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/freezer
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/blkio
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/memory
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/rdma
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/devices
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/hugetlb
cgroup         cgroup              0     0     0    - /sys/fs/cgroup/pids
systemd-1      -                   -     -     -    - /proc/sys/fs/binfmt_misc
mqueue         mqueue              0     0     0    - /dev/mqueue
hugetlbfs      hugetlbfs           0     0     0    - /dev/hugepages
tracefs        tracefs             0     0     0    - /sys/kernel/tracing
debugfs        debugfs             0     0     0    - /sys/kernel/debug
binfmt_misc    binfmt_misc         0     0     0    - /proc/sys/fs/binfmt_misc
configfs       configfs            0     0     0    - /sys/kernel/config
tmpfs          tmpfs            5,9G   47M  5,8G   1% /tmp
/dev/sdc1      ext4             110G   18G   87G  17% /home
/dev/sda5      ext4             790G  132G  618G  18% /mnt/hdd0
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Desktop
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Documents
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Downloads
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Drive
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Games
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Music
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Pictures
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Public
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Templates
/dev/sda5      ext4             790G  132G  618G  18% /home/odelucca/Videos
/dev/sdb1      vfat             511M  308K  511M   1% /boot/efi
tmpfs          tmpfs            1,2G   16K  1,2G   1% /run/user/1000
fusectl        fusectl             0     0     0    - /sys/fs/fuse/connections
gvfsd-fuse     fuse.gvfsd-fuse  0,0K  0,0K  0,0K    - /run/user/1000/gvfs
portal         fuse.portal      0,0K  0,0K  0,0K    - /run/user/1000/doc

@delucca
Copy link
Author

delucca commented Jun 18, 2020

@afbjorklund

Actually, I haven't tried those commands already. Here are their ouputs:

~ took 36s
❯ ls -l /var/lib/minikube/binaries/*/
zsh: no matches found: /var/lib/minikube/binaries/*/

~
❯ ls -l /var/lib/minikube/binaries/v1.18.3
ls: cannot access '/var/lib/minikube/binaries/v1.18.3': No such file or directory

~
❯ findmnt /var

It is strange, it seems that Minikube didn't create those binaries on the required path. I've tried to run the minikube start again to check if that would create those files.

I don't know if this matters, but my $MINIKUBE_HOME is set to:

~
❯ echo $MINIKUBE_HOME
/mnt/hdd0/home/odelucca/.minikube

@delucca
Copy link
Author

delucca commented Jun 18, 2020

Just to give you guys a quick explanation about those customized configs (Docker Root Dir and MINIKUBE_HOME), I have three hard drives:

  • Two 128GB SSD
  • One 1TB Sata

My Linux root / is mounted on SSD 1, my $HOME (/home/odelucca) is mounted on SSD 2 and the Sata is mounted on /mnt/hdd0.

There are some folders binded from my home to the Sata disk, to save space on my computer for large files (like documents, photos, and others). My Downloads folder, for example, has a custom systemctl service that mounts it directly on /mnt/hdd0/Drive/Downloads (which is also synced to Google Drive). So, anything there would consume space from my Sata disk, and not the SSD.

I've also moved my Docker and Minikube files to the Sata disk to save space on my root disk, and maybe that is the whole reason of this problem. Here is a quick overview of some folders from my Sata disk:

❯ la /mnt/hdd0/
total 72
drwxr-xr-x 6 odelucca odelucca  4096 25 mai   19:04   .
drwxr-xr-x 4     root     root  4096  2 jun   02:55   ..
drwxr-xr-x 3 odelucca odelucca  4096 25 mai   18:54   home
drwx------ 2 odelucca odelucca 16384 19 mai   19:37   lost+found
drwx------ 4 odelucca odelucca  4096 20 mai   00:58   .Trash-1000
drwxr-xr-x 3 odelucca odelucca  4096 25 mai   18:50   var

~
❯ la /mnt/hdd0/home
total 24
drwxr-xr-x 3 odelucca odelucca 4096 25 mai   18:54   .
drwxr-xr-x 6 odelucca odelucca 4096 25 mai   19:04   ..
drwxr-xr-x 6 odelucca odelucca 4096 16 jun   15:53   odelucca

~
❯ la /mnt/hdd0/home/odelucca
total 48
drwxr-xr-x  6 odelucca odelucca 4096 16 jun   15:53   .
drwxr-xr-x  3 odelucca odelucca 4096 25 mai   18:54   ..
drwxr-xr-x  3 odelucca odelucca 4096  1 jun   18:51   Backups
drwxr-xr-x 13 odelucca odelucca 4096 16 jun   14:21   Drive
drwxr-xr-x  2 odelucca odelucca 4096 25 mai   18:54   Games
drwxr-xr-x 10 odelucca odelucca 4096 18 jun   18:48   .minikube

~
❯ la /mnt/hdd0/home/odelucca/.minikube
total 136
drwxr-xr-x 10 odelucca odelucca 4096 18 jun   18:48   .
drwxr-xr-x  6 odelucca odelucca 4096 16 jun   15:53   ..
drwxr-xr-x  2 odelucca odelucca 4096 16 jun   15:53   addons
drwxr-xr-x  4 odelucca odelucca 4096 16 jun   15:53   cache
-rw-r--r--  1 odelucca odelucca 1066 16 jun   15:55   ca.crt
-rw-------  1 odelucca odelucca 1675 16 jun   15:55   ca.key
-rwxr-xr-x  1 odelucca odelucca 1042 18 jun   18:48   ca.pem
-rwxr-xr-x  1 odelucca odelucca 1082 18 jun   18:48   cert.pem
drwxr-xr-x  2 odelucca odelucca 4096 16 jun   15:54   certs
drwxr-xr-x  2 odelucca odelucca 4096 16 jun   16:12   config
drwxr-xr-x  2 odelucca odelucca 4096 16 jun   15:53   files
-rwxr-xr-x  1 odelucca odelucca 1675 18 jun   18:48   key.pem
drwxr-xr-x  2 odelucca odelucca 4096 16 jun   15:53   logs
drwxr-xr-x  3 odelucca odelucca 4096 18 jun   18:47   machines
drwx------  3 odelucca odelucca 4096 18 jun   18:47   profiles
-rw-r--r--  1 odelucca odelucca 1074 16 jun   15:55   proxy-client-ca.crt
-rw-------  1 odelucca odelucca 1675 16 jun   15:55   proxy-client-ca.key

~
❯ la /mnt/hdd0/var/lib
total 24
drwxr-xr-x  3 odelucca odelucca 4096 16 jun   15:33   .
drwxr-xr-x  3 odelucca odelucca 4096 25 mai   18:50   ..
drwx--x--x 15     root     root 4096 18 jun   18:19   docker

~
❯ la /mnt/hdd0/var/lib/docker
total 16
drwx--x--x 15     root     root 4096 18 jun   18:19   .
drwxr-xr-x  3 odelucca odelucca 4096 16 jun   15:33   ..

IMPORTANT: I've done all the required steps to allow executing Docker without sudo, and my Docker is working as expected, for example:

~
❯ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

@afbjorklund
Copy link
Collaborator

It is strange, it seems that Minikube didn't create those binaries on the required path.

Are you sure you ran the commands in the minikube node, and not on the host/laptop ?

@delucca
Copy link
Author

delucca commented Jun 29, 2020

I've finally make it work!

My external HDD was with noexec flag. I've changed it to exec and the minikube started as

Thanks for your assistance!

@delucca delucca closed this as completed Jun 29, 2020
@medyagh medyagh reopened this Jun 29, 2020
@medyagh
Copy link
Member

medyagh commented Jun 29, 2020

@odelucca glad to see this issue was fixed do you mind sharing exact commands you did to remount your volume correctly?

I think in minikube we should be able to do a check on Linux to ensure the volume has exec permission. And provide better advice to the user. To avoid next person go through same debugging pain you had to go through.

@delucca
Copy link
Author

delucca commented Jun 29, 2020

@medyagh sure! Here is a quick overview on the issue and how I've fixed:

I've the following hard-drive setup:

  • 1 SSD for my root folder
  • 1 SSD for my home folder
  • 1 HDD for data and files in general

I've moved both my Docker and Minikube to my HDD, mounted at /mnt/hdd0. I forgot to add any exec flags in it, and by default it was receiving a noexec flag.

I discovered that when I ran the mount command:

~
❯ mount
...
/dev/sda5 on /mnt/hdd0 type ext4 (rw,nosuid,nodev,noatime,noexec,user)
...

After that, I've just changed my /etc/fstab to add exec on the mount flags:

# <file system>                           <mount point>  <type>  <options>                     <dump>  <pass>
...
UUID=56efdd9d-8a99-4f63-8a31-901303ca74cd /mnt/hdd0      ext4    user,defaults,noatime,exec    0       1

Now, the HDD is mounted with exec flag and can execute binaries :)

@medyagh medyagh added the needs-solution-message Issues where where offering a solution for an error would be helpful label Jun 29, 2020
@medyagh medyagh changed the title Can't launch Minikube with Docker driver running minikube on a external harddisk with noexec: 'kubeadm': Permission denied Jun 29, 2020
@medyagh medyagh added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed kind/support Categorizes issue or PR as a support question. labels Jun 29, 2020
@medyagh medyagh closed this as completed Jun 30, 2020
@medyagh
Copy link
Member

medyagh commented Jun 30, 2020

@odelucca
here is the link to the binary from a PR that will provide a better solution message
http://storage.googleapis.com/minikube-builds/8597/minikube-linux-amd64

#8597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container needs-solution-message Issues where where offering a solution for an error would be helpful os/linux priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

3 participants