{"record":{"id":"be39ada30b2f2bf9","repo":"hashicorp/nomad","slug":"dev-connect-is-only-supported-on-linux","errorCode":null,"errorMessage":"-dev-connect is only supported on linux.","messagePattern":"-dev-connect is only supported on linux\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/config.go","lineNumber":1718,"sourceCode":"\n\tbindAddr string\n\tiface    string\n}\n\nfunc (mode *devModeConfig) enabled() bool {\n\treturn mode.defaultMode || mode.connectMode ||\n\t\tmode.consulMode || mode.vaultMode\n}\n\nfunc (mode *devModeConfig) validate() error {\n\tif mode.connectMode {\n\t\tif runtime.GOOS != \"linux\" {\n\t\t\t// strictly speaking -dev-connect only binds to the\n\t\t\t// non-localhost interface, but given its purpose\n\t\t\t// is to support a feature with network namespaces\n\t\t\t// we'll return an error here rather than let the agent\n\t\t\t// come up and fail unexpectedly to run jobs\n\t\t\treturn fmt.Errorf(\"-dev-connect is only supported on linux.\")\n\t\t}\n\t\tu, err := users.Current()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"-dev-connect uses network namespaces and is only supported for root: %v\", err)\n\t\t}\n\t\tif u.Uid != \"0\" {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"-dev-connect uses network namespaces and is only supported for root.\")\n\t\t}\n\t\t// Ensure Consul is on PATH\n\t\tif _, err := exec.LookPath(\"consul\"); err != nil {\n\t\t\treturn fmt.Errorf(\"-dev-connect requires a 'consul' binary in Nomad's $PATH\")\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":1700,"sourceCodeEnd":1736,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/config.go#L1700-L1736","documentation":"The -dev-connect dev mode relies on Linux network namespaces, so agent config validation rejects it on any other OS. This is a hard guard: the agent would otherwise start and fail later when running connect jobs.","triggerScenarios":"Running `nomad agent -dev-connect` (or DevConnect mode in config) on darwin/windows; runtime.GOOS != \"linux\" at config validation time.","commonSituations":"Trying the quickstart dev mode on macOS laptops; CI containers on non-linux hosts; following Linux-only tutorials on other platforms.","solutions":["Run the agent on Linux (native or a Linux VM/container).","Use regular -dev mode plus a local Consul with Connect enabled instead of -dev-connect.","Use Docker Desktop/colima with a Linux VM to get a linux environment."],"exampleFix":"// before (macOS)\nnomad agent -dev-connect\n// after (Linux or VM)\nnomad agent -dev\n// or run inside a Linux container/VM for -dev-connect","handlingStrategy":"validation","validationCode":"if runtime.GOOS != \"linux\" {\n  return errors.New(\"-dev-connect requires Linux; use -dev or run in a Linux VM\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check runtime.GOOS or `uname -s` before scripting -dev-connect","Use OS checks in dev tooling","Prefer -dev for cross-platform local experiments"],"tags":["platform","linux","dev-connect","nomad"],"backgroundTag":"unsupported-platform","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}