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

Today in 2019, will RViz and Gazebo work with X forwarding over SSH

asked 2019-01-23 15:20:32 -0600

pitosalas gravatar image

updated 2019-01-25 06:29:21 -0600

I've seen older (2012) posts that say you cannot run RViz over X.But it's 2019, and maybe things have changed.

I've been struggling to get it to work, UBUNTU on a DigitalOcean droplet, and X running on my Mac, and it seems to ALMOST work and then crash. Am I beating my head against the wall or does anyone have experience that says it will work?

edit retag flag offensive close merge delete

Comments

To clarify, most modern Linux systems run an X-windows server. I think your question is specifically about X-forwarding over SSH?

ahendrix gravatar image ahendrix  ( 2019-01-23 16:00:54 -0600 )edit

Yes. ssh or any other technique that would allow me to run Rviz et all on the Linux side and run Xwindows on the client side. In my case I've got all of Ros installed in a Digital Ocean droplet. I ssh -X or -Y to it from my Mac, and I launch Gazebo. enter code hereI see the splash screen of RViz f

pitosalas gravatar image pitosalas  ( 2019-01-23 17:07:35 -0600 )edit

If you are using a droplet, I assume that means VNC is not an option?

Geoff gravatar image Geoff  ( 2019-01-23 18:57:21 -0600 )edit

Can you be more specific about how it crashes? Does it provide any error info, it just it just vanish?

Geoff gravatar image Geoff  ( 2019-01-23 19:01:01 -0600 )edit

@Geoff VNC is an option ... but AFAICT I can't paste into a shell running overVNC which is problem when entering long ROS commands. I am about as far along in getting the VNC scenario to work. I am hoping to determine for sure whether they both can be made to work, and if so, which is faster.

pitosalas gravatar image pitosalas  ( 2019-01-23 20:08:33 -0600 )edit

Not being able to paste into a shell sounds like a problem of your VNC client not interacting with the system clipboard.

Geoff gravatar image Geoff  ( 2019-01-24 23:36:40 -0600 )edit
2

FWIW, I use X-forwarding with RViz and Gazebo all of the time, though both the client and server are Linux boxes. So it definitely is possible, but I don't know how to configure macOS to do it.

clalancette gravatar image clalancette  ( 2019-01-25 13:21:39 -0600 )edit

@clalancette Would you be willing to share your shell script or ssh command or other configuration is, I think that would be very helpful!

pitosalas gravatar image pitosalas  ( 2019-01-25 16:01:44 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2019-01-23 19:08:59 -0600

Geoff gravatar image

According to this page, X needs to have indirect GLX enabled to support remote applications that use OpenGL (which both rviz and Gazebo do). The answers on that page give two ways of enabling indirect GLX: starting the X server with the +iglx option, or adding the option to the server flags in xorg.conf:

Section "ServerFlags"
    Option "IndirectGLX" "on"
EndSection

Since you are using a Mac for your client, I assume you are using XQuartz. That means that how to set the flag is different from standard X.org. I did find one page that says it is enabled by default on versions up to 2.7.8, but that release was quite a while ago now. You can make sure it's on by changing the preferences like this:

defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
edit flag offensive delete link more

Comments

sounds promising. I will try this and report back.

pitosalas gravatar image pitosalas  ( 2019-01-23 20:08:44 -0600 )edit

Some expectation management: I've tried this in the past, and without one of the "special" X or VNC implementations (ie: with compression/delta schemes or optimised OpenGL support), performance is going to suffer. A lot, in some cases. Yes, X is network capable, but not meant for RDP type work.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-24 02:54:09 -0600 )edit

I still get the same error messages, sigh...

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast

pitosalas gravatar image pitosalas  ( 2019-01-25 06:28:03 -0600 )edit

Sighing isn't going to help.

Using a 3D-intensive application over a networked X connection is hit-and-miss in any case. The protocol is/was not meant for it, and there are many variables / hoops to jump through to get it to work.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-25 06:48:33 -0600 )edit

I had this problem before. Unfortunately, I have tried all the solutions offered here and elsewhere, none worked for me. Then, I knew by chance that if I use windows 10 as a client (instead of a mac), RVIZ will stream over X11 perfectly. Therefore, I guess the problem is specific to mac clients. Somehow, the X11 forwarding breaks when the traffic reaches the client mac machine.

ASA28 gravatar image ASA28  ( 2019-04-17 03:27:20 -0600 )edit
2

answered 2019-11-14 18:07:35 -0600

Dutch gravatar image

I just had some experience with this not long ago...

I'm using a windows 10 to SSH a headless Ubuntu service, and need to run the RVIZ on the server to show some data.

At very beginning, I tried with putty with vcXsrv (I didn't try Xming because I couldn't get a latest release), using X Forwarding, and RVIZ directly aborted after launched it, because "OpenGL that rviz is relying on cannot be X Forwarded", see this...

I didn't try any VNC client and I think if they cannot solve this "OpenGL over TCP" issue then it won't help at all. However I noticed some VNC has the capability of processing 3D object, and they are using a "VirtualGL" to achieve it. Then I searched a bit on it, and noticed that this VGL is exactly designed for this case, and I don't need to install any other client to use it because the native program is already good enough for normal use case and even provides better performance (see this VGL Transport).

Basically, in windows part, you need to install a Cygwin for installing this VirtualGL client, and Cyginw/X for X server, and then in the Ubuntu part you need to install a VirtualGL server. After that you can use the vglconnect (relying on SSH) in the Cygwin to connect to server, and then use vglrun (at server side) to launch RVIZ.

Since the OpenGL rendering is done in the server side, it doesn't require much compute resource from client side, but I think it does need some bandwidth. In my test, 1Gb Ethernet is good enough for my daily work.

edit flag offensive delete link more

Comments

btw, the "+iglx" solution mentioned in the post above doesn't work at my side. The Rviz just aborted at starting stage when it invokes some rendering related API.

Dutch gravatar image Dutch  ( 2019-11-14 18:09:54 -0600 )edit

Furthermore, pls be very careful with the window firewall (4200-4299 especially 4242 port shall be allowed for inbound access), it took me quite some time to figure out my problem with the virtualGL at very beginning.

Dutch gravatar image Dutch  ( 2019-11-15 02:34:05 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2019-01-23 15:20:32 -0600

Seen: 5,855 times

Last updated: Nov 14 '19