minikube: Unable to start minikube in ubuntu 20.04 with nosuid file system

Steps to reproduce the issue:

  1. simply installed minikube and was running minikube start. I get the following error
StartHost failed, but will try again: provision: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

minikube version

niranda@dell-163-6:~/Downloads$ minikube version 
minikube version: v1.24.0
commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b

docker info

niranda@dell-163-6:~/Downloads$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 19.03.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: error
  NodeID: 
  Error: error while loading TLS certificate in /aux/docker/swarm/certificates/swarm-node.crt: certificate (1 - 10prj7ay6v7mlq1n1u88m0zl6) not valid after Sun, 10 May 2020 16:50:00 UTC, and it is currently Thu, 11 Nov 2021 14:23:29 EST: x509: certificate has expired or is not yet valid
  Is Manager: false
  Node Address: 129.79.186.207
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-90-generic
 Operating System: Ubuntu 20.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.07GiB
 Name: dell-163-6
 ID: SQIV:R2BF:HXAS:4K47:EQ2A:2BEL:4PRQ:V3LA:YJHD:P3HD:Z37P:RYVN
 Docker Root Dir: /aux/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support
niranda@dell-163-6:~/Downloads$ docker system info
Client:
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 19.03.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: error
  NodeID: 
  Error: error while loading TLS certificate in /aux/docker/swarm/certificates/swarm-node.crt: certificate (1 - 10prj7ay6v7mlq1n1u88m0zl6) not valid after Sun, 10 May 2020 16:50:00 UTC, and it is currently Thu, 11 Nov 2021 14:23:29 EST: x509: certificate has expired or is not yet valid
  Is Manager: false
  Node Address: 129.79.186.207
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-90-generic
 Operating System: Ubuntu 20.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.07GiB
 Name: dell-163-6
 ID: SQIV:R2BF:HXAS:4K47:EQ2A:2BEL:4PRQ:V3LA:YJHD:P3HD:Z37P:RYVN
 Docker Root Dir: /aux/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Run minikube logs --file=logs.txt and drag and drop the log file into this issue

logs.txt

Full output of failed command if not minikube start:

niranda@dell-163-6:~/Downloads$ minikube start 
😄  minikube v1.24.0 on Ubuntu 20.04
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
🔄  Restarting existing docker container for "minikube" ...
🤦  StartHost failed, but will try again: provision: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

🏃  Updating the running docker "minikube" container ...
😿  Failed to start docker container. Running "minikube delete" may fix it: provision: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?


❌  Exiting due to GUEST_PROVISION: Failed to start host: provision: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?


╭───────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│    😿  If the above advice does not help, please let us know:                             │
│    👉  https://github.com/kubernetes/minikube/issues/new/choose                           │
│                                                                                           │
│    Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.    │
│                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

About this issue

Most upvoted comments

This is more likely due to suid not being enabled for the mount where your docker root is pointed to. The fix for me was to run,

sudo mount -n -o remount,suid /mount/for/var/lib/docker

The remount didn’t work for me (but you certainly put me on the right track 👍), editing /etc/fstab did. I have the var/lib/docker stuff on a different partition to prevent myself (I’ve been there) flooding my root partition with Docker data. But for some reason or other, for this partition I had the nosuid option set. Removing this option fixed it. Rebooted and minikube start worked fine after that.