Add `/private/etc` to the default mounts on macOS
Problem Description
Docker Desktop for Mac allows paths under /private/etc to be used as bind-mount sources. Rancher Desktop does not mount /private/etc into its Lima VM by default.
On macOS, /etc is a symbolic link to /private/etc. Because /private/etc is not mounted, paths under /etc are unavailable inside the Rancher Desktop VM.
$ ls -ld /etc
lrwxr-xr-x@ 1 root wheel 11 Aug 13 11:51 /etc@ -> private/etc
We use OpenAI Codex Enterprise inside VS Code Dev containers. Codex reads enterprise-managed configuration from /etc/codex/managed_config.toml.
https://learn.chatgpt.com/docs/enterprise/managed-configuration
This file is centrally deployed to our macOS hosts, and we need to make it available inside the dev container:
{
"mounts": [
"source=/private/etc/codex,target=/etc/codex,type=bind,readonly"
]
}
This bind mount works with Docker Desktop for Mac, but not with Rancher Desktop.
Current Workaround
Edit the following file:
~/Library/Application Support/rancher-desktop/lima/_config/override.yaml
Add:
mounts:
- location: /private/etc/
writable: falseThen restart Rancher Desktop.
Proposed Solution
Add /private/etc to the list of default host mounts for the Mac.
Additional Information
Related issue:
- #6070
Rancher Desktop's current default macOS mounts include /var/folders, /private/tmp, and /private/var/folders, but not /private/etc:
https://github.com/rancher-sandbox/rancher-desktop/blob/main/pkg/rancher-desktop/backend/lima.ts
Source: rancher-sandbox/rancher-desktop