rancher-desktop: sudoers file doesn't work if the user is not a member of the `staff` group

Rancher Desktop Version

0.7.1

Rancher Desktop K8s Version

0.22.5

What operating system are you using?

macOS

Operating System / Build Version

macOS Monterey 12.1

What CPU architecture are you using?

x64

Windows User Only

No response

Actual Behavior

Cannot start rancher desktop (Tried factory reset, fresh install)

Steps to Reproduce

Open Rancher Desktop

Result

Error occurs

Expected Behavior

It should start normally

Additional Information

time="2021-12-22T09:24:13-03:00" level=fatal msg="failed to run [sudo --user root --group wheel --non-interactive /bin/mkdir -m 775 -p /private/var/run/rancher-desktop-lima]: stdout=\"\", stderr=\"sudo: a password is required\\n\": exit status 1"
2021-12-22T12:24:13.011Z: + limactl start --tty=false 0
2021-12-22T12:24:13.011Z: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
2021-12-22T12:24:13.011Z: Error starting lima: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
    at ChildProcess.<anonymous> (/Applications/Rancher Desktop.app/Contents/Resources/app.asar/dist/app/background.js:1:8218)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 38 (12 by maintainers)

Most upvoted comments

The problem here seems to be that the sudoers file installed by Rancher Desktop assumes that the current user is a member of the group ‘staff’. This was not the case for my user. After adding my user to the staff group, i.e.

sudo dscl . append /groups/staff GroupMembership $(whoami)

Rancher Desktop seems to start up normally in 0.7.1

Hmm so should i do the following then?

First you should verify that you are indeed a member of the everyone group:

$ id
uid=501(jan) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),[...]
  1. Factory reset and quit Rancher Desktop

Factory reset is not necessary, but won’t hurt. But you have to stop RD.

  1. Edit ~/Library/Application\ Support/rancher-desktop/lima/_config/networks.yaml and change from staff to everyone

Yes

  1. Remove /private/etc/sudoers.d/rancher-desktop-lima

Should not be necessary because it will be overwritten in the next step.

  1. Restart Ranched Desktop?

This should again ask you for your password, so it can regenerate the sudoers file with the new content, and then I hope it will all work.

6.1 seems to work.

If I already have lima/limactl installed on my Mac via brew install lima couldn’t RD check for the presence of this installation before trying to install lima/limactl on it’s own?

@589290 RD bundles it’s own version to be sure it is exactly the right version it requires. This also makes sure that you don’t break RD if you uninstall your lima formula.

RD sets a different LIMA_HOME and keeps all settings separate from the normal lima install, so both version should co-exist and not even be aware of each other.