abiosoft/colima · error
error setting up sudoers for route: %w
Error message
error setting up sudoers for route: %w
What it means
On macOS hosts, colima installs a sudoers file (embedded.InstallSudoers) so it can run /sbin/route without a password prompt; that install step failed. The wrapped error typically comes from writing /etc/sudoers.d/colima or validating it with visudo.
Source
Thrown at environment/container/incus/route.go:34
// addContainerRoute adds a macOS route for the Incus container subnet
// via the VM's col0 IP address, making containers directly reachable from the host.
func (c *incusRuntime) addContainerRoute() error {
if !util.MacOS() {
return nil
}
vmIP := limautil.IPAddress(config.CurrentProfile().ID)
if vmIP == "127.0.0.1" || vmIP == "" {
return nil
}
if !util.SubnetAvailable(BridgeSubnet) {
log.Warnf("subnet %s conflicts with host network, skipping route setup", BridgeSubnet)
return nil
}
if err := embedded.InstallSudoers(c.host); err != nil {
return fmt.Errorf("error setting up sudoers for route: %w", err)
}
// delete any stale route first (ignore errors)
_ = c.removeContainerRoute()
if err := c.host.RunQuiet("sudo", "/sbin/route", "add", "-net", BridgeSubnet, vmIP); err != nil {
return fmt.Errorf("error adding route for %s via %s: %w", BridgeSubnet, vmIP, err)
}
return nil
}
// removeContainerRoute removes the macOS route for the Incus container subnet.
func (c *incusRuntime) removeContainerRoute() error {
if !util.MacOS() {
return nil
}
View on GitHub (pinned to c3a5f9184d)
Solutions
- Verify /etc/sudoers contains '@includedir /etc/sudoers.d' (visudo -c)
- Check the file: 'sudo cat /etc/sudoers.d/colima' and 'sudo visudo -c'
- Manually re-run colima start so the sudo prompt can be answered
- If sudoers is centrally managed, add an equivalent rule for the route command
Defensive patterns
Strategy: validation
Validate before calling
// preflight the sudoers include dir before provisioning
if _, err := os.Stat("/etc/sudoers.d"); err != nil {
return fmt.Errorf("/etc/sudoers.d missing; ensure @includedir is configured in /etc/sudoers")
} Try / catch
if err := embedded.InstallSudoers(c.host); err != nil {
return fmt.Errorf("error setting up sudoers for route: %w", err)
// user-actionable: run 'sudo visudo -c' and check /etc/sudoers.d/colima, then retry colima start
} Prevention
- On managed/hardened macOS, pre-create an equivalent sudoers rule for /sbin/route
- Complete the sudo password prompt on first colima start instead of cancelling it
- After macOS upgrades, verify sudoers includes still resolve (visudo -c)
When it happens
Trigger: embedded.InstallSudoers(c.host) fails: /etc/sudoers.d missing or not included by /etc/sudoers, write permission denied (sudo password entry failed), sudoers validation rejected the file, or the embedded sudoers asset is missing.
Common situations: Hardened macOS with sudoers include disabled, corporate machines with managed /etc/sudoers, interrupted first-run where the sudo prompt timed out, macOS upgrade resetting sudoers.d.
Related errors
- error adding route for %s via %s: %w
- error persisting runtime settings: %w
- error persisting kubernetes settings: %w
- error deleting configs: %w
- error reading ssh config: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/f54bfa71c67ca18b.
Report an issue: GitHub.