This project supports running the interactive 3D viewer directly from inside a Docker container. Follow the instructions below for your operating system to set up the GUI window forwarding correctly.
To see the MuJoCo viewer pop up on your Windows desktop from Docker, you need an X-server running.
- Install VcXsrv (a free Windows X-server) from here: VcXsrv Download
- Once installed, double-click the
windows_gui.xlaunchfile included in this repository. (This launches VcXsrv with "Disable access control" pre-checked, which is required for Docker). - Open your Command Prompt or PowerShell and run:
docker compose run --rm locomotion
- The interactive menu will appear in your terminal, and the simulation windows will pop up on your screen when you select a task!
Note for WSL2 Users: If you run the command directly from inside a WSL terminal (e.g., Ubuntu app), WSLg will automatically intercept the window without needing VcXsrv!
macOS also requires an X-server to render Linux GUI windows.
- Install XQuartz via Homebrew or their website:
brew install --cask xquartz
- Open XQuartz (it will appear in your Dock).
- Go to XQuartz > Preferences > Security and check "Allow connections from network clients".
- Restart XQuartz to apply the settings.
- In your terminal, run this command to whitelist your local machine:
xhost + 127.0.0.1
- Now you can run the container:
docker compose run --rm locomotion
Linux users have it the easiest because the X11 server is already running natively. The docker-compose.yml is pre-configured to mount your local /tmp/.X11-unix socket.
- You may need to grant local access to the X server:
xhost +local:root
- Run the container:
docker compose run --rm locomotion