Skip to content

Instantly share code, notes, and snippets.

@sandman
Created August 26, 2022 18:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sandman/3777b07f69e117aa8bf1adede26a4e36 to your computer and use it in GitHub Desktop.
Save sandman/3777b07f69e117aa8bf1adede26a4e36 to your computer and use it in GitHub Desktop.
Installing and running a Dockerized NVIDIA Xfce desktop with ROS2 Foxy
# Install latest version nvidia-docker2 on PopOS 22.04
## PopOS does not take the latest upstream NVIDIA Container runtime which is needed to run the container
## Run the below steps
### Add a new preference entry in /etc/apt/preferences.d/pop-default-settings
Package: *
Pin: origin nvidia.github.io
Pin-Priority: 1002
### Pull the correct repos
distribution="ubuntu20.04" && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
# Check installed container runtime version is > 1.8.1
nvidia-container-cli --version
# Clone the Docker file
git clone https://github.com/atinfinity/nvidia-egl-desktop-ros2
cd nvidia-egl-desktop-ros2/foxy
# Build the Image
docker build -t nvidia-egl-desktop-ros2:foxy .
# Run the container
docker run --gpus 0 -it --shm-size=1024m -e SIZEW=1920 -e SIZEH=1080 -e PASSWD=mypasswd -e BASIC_AUTH_PASSWORD=mypasswd -e NOVNC_ENABLE=true -p 6080:8080 nvidia-egl-desktop-ros2:foxy
# Access Xfce Desktop via web browser
Browse http://127.0.0.1:6080/.
In this docker container, default account is user.
You can set password via PASSWD and BASIC_AUTH_PASSWORD when you execute docker run. The default password is mypasswd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment