Last active
October 30, 2025 13:11
-
-
Save Wanchai290/956ba54ed8c207ddac059ca7d65c13cf to your computer and use it in GitHub Desktop.
ROS2 Humble Docker container with GUI (X11 forward)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Start the container | |
| xhost +local:root # Unsafe, do not use in prod environment | |
| (docker start ros4pro && docker exec --env="DISPLAY" -it ros4pro bash) || docker run --privileged -it --env="DISPLAY" --volume=/dev/mem:/dev/mem --volume="./meow:/home/" --name=ros4pro --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --net=host | |
| # note that `docker attach` will not forward the display. We need to start a new terminal to pass the value | |
| # remember to run line 2 after each reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment