rancher-desktop: Insufficient permission to manipulate /usr/local/bin
Rancher Desktop Version
0.7.1
Rancher Desktop K8s Version
1.21.7 (stable)
What operating system are you using?
macOS
Operating System / Build Version
macOS Monterey 12.1
What CPU architecture are you using?
arm64 (Apple Silicon)
Windows User Only
No response
Actual Behavior
In Rancher Desktop, Supporting Utilities I have the error Insufficient permission to manipulate /usr/local/bin: Error: EACCES: permission denied, access '/usr/local/bin' and the box next to each supporting utility is greyed out.
This affects only installing supporting utilities from Rancher Desktop. All other functions of Rancher Desktop seem to be working as expected. The utilities work and can interact with the running Kubernetes instance when installed any other way.
Steps to Reproduce
This is a new laptop, first time configuration.
I downloaded Rancher.Desktop-0.7.1.aarch64.dmg from the releases page, opened it, dragged “Rancher Desktop.app” into Applications, and launched it.
It went through the first-time Kubernetes download without issue. Quitting and re-opening Rancher Desktop has not made any difference.
Result
Logs attached in case they’re helpful. background.log images.log k3s.log k8s.log lima.ha.stderr.log lima.ha.stdout.log lima.log lima.serial.log
Expected Behavior
I expect the Supporting Utilities tab of Rancher Desktop to be able to install the supporting utilities it lists.
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 27
- Comments: 43 (10 by maintainers)
I agree that
usr/local/binshould be owned by root. My workaround is to runthen I can check the checkboxes in rancher desktop, and I restore the root owner:
@spuder The problem is the
/usr/local/binno longer exists, or is not owned by yourself. You can fix that by running the following commands in a terminal:The first
sudocommand will prompt you for your password. Once the directory exists, and is writable by you, RD should be able to create the symlinks.IMHO /usr/local/bin should be owned by root. So changing it to be owned by $USER is a workaround, not a fix. I would think the solution proposed by @jasjisdo is the right way to do it.
Thank you. I found that
/usr/local/bindoes exist on my new M1 mac running Big Sur, but it was owned by rootRunning this worked around the issue for me:
Once the boxes were clicked, the symlinks that were created for me are at:
IHMO in this case Rancher Desktop should also ask for root access to install the Supporting Utilities. After the initial installation, it also asked for root access to perform the internal network configuration. When installing the Supporting Utilities, rancher Desktop should behave analogously and not inconsistently.
In my view, a good solution would be to ask for root access in the same way when installing the Supporting Utilities.
I worked around the issue by creating the symlinks manually…
had the same issue but
sudo chown $USER /usr/local/binresolved itFor Homebrew user, this is the work around. Although you will still see the UI error, all commands will works.
This could be fixed by linking to the binaries in
/opt/rancher-desktop/binand adding/opt/rancher-desktop/binto the PATH./opt/rancher-desktop/binexists after installing Rancher Desktop.% cd /opt/rancher-desktop/bin% sudo ln -s "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/bin"/* .printf "\n# Rancher Desktop\nexport PATH=\"/opt/rancher-desktop/bin:\$PATH\"\n\n" >> ~/.zshrcThis way
/usr/local/bindoesn’t need to be touched.I’d recommend Rancher Desktop do something like this by default. It’s similar to how mambaforge and homebrew work.
For example:
This is pretty close to what we will be doing in the next release: All binaries will be sym-linked into
~/.rd/bin, and the app will offer to add that directory to yourPATHvia your shell profile (should support at leastbash,fish,zsh).You can of course decline and do this yourself, if you want more control over where to place the directory relative to your other directories on the
PATH.Lots of bad workaround recommended here. Please do not
chownyour/usr/local/binto your$USER, but if you indeed decide this is the only way, then please change it back as soon as possible.@twillowman thanks for reporting the issue and suggesting a solution.
This has been addressed. The fix will be included in the upcoming 1.3.0. For more information please see #1732.
Note that all the Rancher Desktop shortcuts go to the same directory, so you could put that directory in your
PATHin the~/.profilecorresponding to your shell. This doesn’t even requiresudo.This is what happens with the Windows version[^1]; the directory is added at the end of the
PATH, so the user can override the bundled version by installing them into a directory earlier on thePATH.You can also put the name of that directory into a
/etc/pathd.dfile, and for the supported shells, it will be put on thePATHautomatically. Creating the file requiressudothough:Note that you will have to deal with shadowing on your
PATHyourself then. E.g. if you also installDocker Desktop, it may put symlinks into/usr/local/binany time you start it (via its privileged helper process), which may then hide the versions from Rancher Desktop.It’s kind of hard to find a one-size-fits-all solution for this issue.
[^1]: On Windows we actually put both the Windows and the Linux versions of the utilities at the end of the
PATH. Since the Windows versions have an extra.exefile extension, they don’t shadow each other, and both Windows command prompts, and WSL shells will automatically invoke the right version.I did the following workaround steps:
And all supporting utilities are checked even if you do not have proper permission for
/usr/local/bindirectory:kubectlcommand, for example, works fine now:Note: You have to remove the symbolic links in the
/usr/local/bindirectory manually if you remove Rancher Desktop.I confirm that this reproduces on Mac OS Monterey Version 12.1 on a MacBook Pro with M1 Pro. Chown seems a weird solution, I would rather open the entire app as sudo.
Simple one-liner for those who were looking for it based on the suggestion here: https://github.com/rancher-sandbox/rancher-desktop/issues/1155#issuecomment-1032135332
Did you actually try it? I just did (on a pristine VM running Big Sur), and you’ll be surprised to see this:
When you think about it, how could
brew install ...install something into/usr/local/binunless it is writable by the user? Brew is not usingsudoto install anything.Note that I said Intel Macs; the install location is different on M1 Macs, and on Linux, so obviously it won’t change the ownership of
/usr/local/binif it doesn’t write to it.In such cases I prefer to add the path in the
.zshrcor, in this case, defining aliases in the same file pointing to the specific binaries.This seems to be changed. Installing RD 1.0.1 with brew doesn’t create these links:
Checking
/opt/homebrew/binshows that these links doesn’t exist. I’m on Apple Silicon, too.It seems that “mucked up” permissions issue on /usr/local/bin directory. I am on M1 chip and with latest v.1.0.0 version:
Fix would be; adding your user-account into admin group:
sudo chown $(whoami):admin /usr/local/bin
also to note: if installed from Homebrew, the symlinks are generated by Homebrew, but the app doesn’t reflect that state.
/opt/homebrew/bin/dockeris a symlink to'/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/bin/docker', and so on