creamy-angle-16764
10/29/2025, 3:43 PMsystemctl to start docker. I'm noticing open hands is overwriting my group ownership of every file in the workspace to root. What is the best way to get it to stop doing that?better-park-34863
10/29/2025, 3:45 PMcreamy-angle-16764
10/29/2025, 3:47 PMdocker run -it --rm \
-p 3001:3000 \
-e SANDBOX_USER_ID=$(id -u) \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-v $WORKSPACE_BASE:/opt/workspace_base \
-e AGENT_ENABLE_PROMPT_EXTENSIONS=false \
-e LOG_ALL_EVENTS=true \
-e LLM_NATIVE_TOOL_CALLING=true \
-e LLM_DISABLE_STOP_WORD=true \
-e LLM_REASONING_EFFORT=high \
-v ~/.openhands:/.openhands \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik \
--name openhands-app \
--gpus all \
docker.all-hands.dev/all-hands-ai/openhands:0.59better-park-34863
10/29/2025, 3:49 PM-e SANDBOX_USER_ID=$(id -u) would run it as the user you are running as so it shouldn't change to root. Not sure. I'll let someone else chime in.creamy-angle-16764
10/29/2025, 3:50 PMcreamy-angle-16764
10/29/2025, 3:50 PMcreamy-angle-16764
10/29/2025, 3:51 PM~/.ssh group to root and broke pub key auth. Lesson learned. Do not use homedir.better-park-34863
10/29/2025, 3:52 PMcreamy-angle-16764
10/29/2025, 4:01 PMcreamy-angle-16764
10/29/2025, 4:14 PMcreamy-angle-16764
10/29/2025, 4:24 PMdocker run with -u $(id -u):$(id -g) \ to limit the uid/gid, I get:
/bin/bash: /app/entrypoint.sh: Permission deniedlittle-architect-38123
10/29/2025, 4:26 PMcreamy-angle-16764
10/29/2025, 4:29 PMSANDBOX_GROUP_ID is an undocumented option. Wild that open hands has access to my entire homedir though.creamy-angle-16764
10/29/2025, 4:48 PMlittle-architect-38123
10/29/2025, 4:52 PMcreamy-angle-16764
10/30/2025, 2:15 PM-e SANDBOX_USER_ID=$(id -u) \
If you leave it, your file uids and gids get messed up. Just run open hands as root in the docker container and let rootless docker sort it out.
2. The socket line becomes -v /run/user/1000/docker.sock:/var/run/docker.sock \ with 1000 being my user id on the ubuntu host.
3. The networking line becomes --add-host host.docker.internal:192.168.0.144 \ with 192.168.0.144 being the IP of the ubuntu host.
This one was the trickiest and took the most time. rootless docker doesn't have host-gateway like docker desktop on a Mac.
I wouldn't say it's "secure" by any stretch of the imagination, but I don't need it to be since my machine is behind a firewall on a secure network. Here's the final full command to start rootless docker with GPU support (which I still don't have 100% working yet):
docker run -it --rm \
-p 3001:3000 \
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
-v $WORKSPACE_BASE:/opt/workspace_base \
-e AGENT_ENABLE_PROMPT_EXTENSIONS=false \
-e LOG_ALL_EVENTS=true \
-e LLM_NATIVE_TOOL_CALLING=true \
-e LLM_DISABLE_STOP_WORD=true \
-e LLM_REASONING_EFFORT=high \
-v ~/.openhands:/.openhands \
-v /run/user/1000/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:192.168.0.144 \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik \
--name openhands-app \
--gpus all \
docker.all-hands.dev/all-hands-ai/openhands:0.59
In my frustration I did briefly try podman. I think it could probably be made to work too, but you have to set more env vars because it doesn't seem to like docker http urls for the runtime. I stuck with rootless docker since I already had it 90% working at the time.creamy-angle-16764
10/30/2025, 2:19 PMcreamy-angle-16764
10/30/2025, 2:21 PMchown -R operations under docker take a really long time on ubuntu. Not sure what's up with that, but I made some changes to my MCP server to work around it.creamy-angle-16764
10/30/2025, 2:30 PM