ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

And it allows you to import/run/exec Docker images, so you can start from osrf/ros:kinetic-desktop-full for instance.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

And it allows you to import/run/exec Docker images, so you can start from osrf/ros:kinetic-desktop-full for instance.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.


Edit2: here's a three line example to get RViz running from inside a Singularity "shell" (essentially equivalent to a docker run -it ..):

singularity pull --name ros-kinetic-desktop-full.simg docker://osrf/ros:kinetic-desktop-full
# in terminal 1
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; roscore'
# in terminal 2
singularity exec --nv ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

Note: I'm using Singularity 2.5.2 commands here. Singularity 2.6 (and 3.0) will have changed the way it interacts with NVidia hw. If you don't have NVidia hw (but a built-in Intel GPU or don't have proprietary NVidia drivers installed):

# in terminal 2
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

And it allows you to import/run/exec Docker images, so you can start from osrf/ros:kinetic-desktop-full for instance.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.


Edit2: here's a three line example to get RViz running from inside a Singularity "shell" (essentially equivalent to a docker run -it ..):

# needed once: converts Docker image into Singularity image on your local system
singularity pull --name ros-kinetic-desktop-full.simg docker://osrf/ros:kinetic-desktop-full
 # in terminal 1
1: roscore
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; roscore'
 # in terminal 2
2: rviz
# if you have nvidia hw and the proprietary driver installed:
singularity exec --nv ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

Note: I'm using Singularity 2.5.2 commands here. Singularity 2.6 (and 3.0) will # if you have changed the way it interacts with NVidia hw. If you don't have NVidia hw (but a built-in Intel GPU or don't have proprietary NVidia drivers installed):

# in terminal 2
or are using nouveau
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

Note: I'm using Singularity 2.5.2 commands here. Singularity 2.6 (and 3.0) will have changed the way it interacts with NVidia hw.

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

And it allows you to import/run/exec Docker images, so you can start from osrf/ros:kinetic-desktop-full for instance.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.


Edit2: here's a three line example to get RViz running from inside a Singularity "shell" (essentially equivalent to a docker run -it ..):

# needed once: converts Docker image into Singularity image on your local system
singularity pull --name ros-kinetic-desktop-full.simg docker://osrf/ros:kinetic-desktop-full

# in terminal 1: roscore
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; roscore'

# in terminal 2: rviz
 # if you have nvidia hw and the proprietary driver installed:
singularity exec --nv ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'
 # if you have a built-in Intel GPU or are using nouveau
singularity exec ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

Note: I'm using Singularity 2.5.2 commands here. Singularity 2.6 (and 3.0) will have changed the way it interacts with NVidia hw.

(Strictly speaking, this is not an answer, but I needed more characters than the comment allowed)

For students, I would take a look at Singularity.

It uses the same techniques, but doesn't require super user rights, mounts $HOME by default, runs everything as the $USER that started the container, and allows access to devices and GPUs by default.

There isn't even any special configuration needed with Singularity containers to be able to use GUIs.

And it allows you to import/run/exec Docker images, so you can start from osrf/ros:kinetic-desktop-full for instance.


Edit: as an answer to your original question: yes, it's certainly possible to run GUI applications from inside Docker containers. Some of the approaches are documented over at wiki/docker. An alternative can be seen at osrf/car_demo.


Edit2: here's a three line example to get RViz running from inside a Singularity "shell" (essentially equivalent to a docker run -it ..):

# needed once: converts Docker image into Singularity image on your local system
singularity pull --name ros-kinetic-desktop-full.simg docker://osrf/ros:kinetic-desktop-full

# in terminal 1: roscore
singularity exec -p ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; roscore'

# in terminal 2: rviz

# if you have nvidia hw and the proprietary driver installed:
singularity exec --nv -p ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

# if you have a built-in Intel GPU or are using nouveau
singularity exec -p ./ros-kinetic-desktop-full.simg bash -c 'source /opt/ros/kinetic/setup.bash; rviz'

Note: I'm using Singularity 2.5.2 commands here. Singularity 2.6 (and 3.0) will have changed the way it interacts with NVidia hw.

The -p is to make sure all child processes in the container are terminated when the container terminates.