Ask Your Question

docker: how to use RViz and Gazebo from a container?

asked 2018-08-08 23:32:48 -0500

muhammed rushid s gravatar image

updated 2018-08-09 03:32:28 -0500

bpinaya gravatar image

" sudo docker run -it osrf/ros:kinetic-desktop-full-xenial" it is working and roscore is also working , but "rosrun rviz rviz" is not working

i am using ubuntu 18.04 and ihave installed docker ,and i need to use ros kinetic , so for that i have pulled image of"osrf/ros:kinetic-desktop-full-xenial" but now im not able to use rviz and gazebo,how to install rviz and gazebo while using docker?

edit retag flag offensive close merge delete



Could you please use only a single sentence or question as title? (like the rest of the questions?) It does not make much sense to just paste the same text in both fields..

NEngelhard gravatar imageNEngelhard ( 2018-08-09 01:22:44 -0500 )edit

Please see if the information on the wiki/docker pages sheds some light on things.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-09 01:36:12 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-09 02:42:58 -0500

bpinaya gravatar image

updated 2018-08-09 03:31:48 -0500

Hey there, I did something related. At the end I used VNC to connect to the docker image and run the gui for Gazebo and Rviz. If you have a decent computer it should run better than with VMs. Check this repo where I detail the install process and the docker image.

At the end it looked like this:

image description

And all of it was running in a docker image. Hope it helps!

(btw there is some extra things you might not need like the workspace I used, that was for a Udacity Assignment)

EDIT: Indeed, for performance you can check the GUI Docker guide from ROS. Connecting to the X11 is the recommended case, especially since you are on Ubuntu 18 already. I did this VNC solution so I can connect from Windows or Mac for example.

edit flag offensive delete link more



Could you please mention that while VNC will work, it is a less performant alternative to the 'regular' approach of exposing X sockets and using the X-server of the host machine?

+1 for mentioning this alternative, but let's not give the impression that this is the recommended way to do this.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-09 03:21:11 -0500 )edit

answered 2019-05-27 15:29:12 -0500

Marc_Chen gravatar image

I did something similar, but the docker file is much simpler, so it is easier to understand. There is also a video on youtube, hope it helps.

edit flag offensive delete link more


Hi Marc,

I asked a question here

I have tried your solution but it did not work. I am not sure if I am doing it correctly, could you provide some insight?


aarontan gravatar imageaarontan ( 2019-06-24 10:50:55 -0500 )edit


my solution only works when your host machine is windows, in my case I need to install xming, so the signal from the graphic card is redirected to windows instead of ubuntu. So what is the operation system you are using to run the docker? 1. you should try my dockerfile first, make sure that "firefox" works as first step. 2. when firefox works, you know the signal redirection works, then you move on trying your own dockerfile

regards Marc

Marc_Chen gravatar imageMarc_Chen ( 2019-06-25 12:44:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-08-08 23:32:48 -0500

Seen: 4,375 times

Last updated: May 27