I am getting the error below when issuing minikube start (minikube start --vm-driver=virtualbox --v=7) command:
Waiting for SSH to be available...
Getting to WaitForSSH function...
Using SSH client type: external
Using SSH private key: /root/.minikube/machines/minikube/id_rsa (-rw-------)
&{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none docker@127.0.0.1 -o IdentitiesOnly=yes -i /root/.minikube/machines/minikube/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : ssh command error:
command : exit 0
err : exit status 255
output :
When researching the above log lines i have noticed the ssh command isn't targeting the minikube virtual machine IP but 127.0.0.1. If manually run the ssh command to 127.0.0.1 i get a permission denied error.
/usr/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none docker@127.0.0.1 -o IdentitiesOnly=yes -i /root/.minikube/machines/minikube/id_rsa -p 22
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
Permission denied (publickey,password).
shouldn't the script connect to the minikube IP other than 127.0.0.1? here is the output from vboxmanage showvminfo
/usr/bin/VBoxManage showvminfo minikube | grep NIC
NIC 1: MAC: 08002790443F, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0): name = ssh, protocol = tcp, host ip = 127.0.0.1, host port = 37549, guest ip = , guest port = 22
NIC 2: MAC: 08002790D54C, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
My system layout is as follows:
thanks in advance
@eslimasec, minikube ssh always use port forward to access vm:
NIC 1 Rule(0): name = ssh, protocol = tcp, host ip = 127.0.0.1, host port = 37549, guest ip = , guest port = 22
when you ssh to 127.0.0.1:37549 will forward to vm:22
so when you test ssh toward minikube vm
, should use port 37549
instead of 22
,
/usr/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none docker@127.0.0.1 -o IdentitiesOnly=yes -i /root/.minikube/machines/minikube/id_rsa -p **37549**
and this is also root cause in your minikube start.
Hope it is helpful.