6

I just started to use Rancher and request to correct me for any wrong terminology.

Earlier I was using minikube on Macbook which provide SSH easily using minikube ssh for troubleshooting. As I am newbie to Rancher Desktop and wanted to do SSH on Rancher Desktop node similar to minikube.

I googled for same but unfortunately I didn't get any fruitful answer. Thanks in advance.

Ashish Kumar
  • 524
  • 6
  • 18

3 Answers3

10

On recent versions (1.3 on) you can use the rdctl utility, which ships with Rancher Desktop, and run rdctl shell COMMAND or rdctl shell to ssh into the VM.

Eric
  • 2,115
  • 2
  • 20
  • 29
4

You can access using below(first line):

$LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl" shell 0

lima-rancher-desktop:/Users/kulsharm2$ uname -a Linux lima-rancher-desktop 5.10.103-0-virt #1-Alpine SMP Tue, 08 Mar 2022 10:06:11 +0000 x86_64 Linux

Kuldeep
  • 507
  • 1
  • 5
  • 13
2

you should be able to use limactl show-ssh NAME where NAME is the name of your rancher node (which you can list using limactl list).

alternatively, you can also use ps -ef | grep rancher which will list the rancher processes, some of which containing ssh information:

126693404  2136  1983   0 Thu12PM ??         0:00.01 ssh -F /dev/null -o IdentityFile="/Users/xxxxxx/Library/Application Support/rancher-desktop/lima/_config/user" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers="^aes128-gcm@openssh.com,aes256-gcm@openssh.com" -o User=xxxxxx -o ControlMaster=auto -o ControlPath="/Users/xxxxxx/Library/Application Support/rancher-desktop/lima/0/ssh.sock" -o ControlPersist=5m -p 49314 127.0.0.1 -- sshfs :/tmp/rancher-desktop /tmp/rancher-desktop -o slave -o allow_other

you can then manually ssh by using the same port and identity file as the command is using. In this case:

 ssh -p 49314 -i '/Users/xxxxxx/Library/Application Support/rancher-desktop/lima/_config/user' xxxxxx@localhost

This is, for sure, less convenient but seems to be working well.

user2987504
  • 547
  • 1
  • 5
  • 12
  • `limactl list` doesn't appear to work as the config is located in a different directory as the other answer suggests. – Ashley Jul 12 '22 at 04:11