Cannot start rviz over VNC

asked 2019-11-13 00:24:10 -0500

Andrew Dassonville gravatar image

updated 2022-04-11 14:45:30 -0500

lucasw gravatar image

I setup VNC on my workstation computer so I can work with RViz on my laptop while I'm away, but I'm getting the following error when trying to run RViz:

andrewda@home:~$ rosrun rviz rviz
QXcbConnection: Failed to initialize XRandr
Qt: XKEYBOARD extension not present on the X server.
[ INFO] [1573625462.248129917]: rviz version 1.12.17
[ INFO] [1573625462.248180228]: compiled against Qt version 5.5.1
[ INFO] [1573625462.248191551]: compiled against OGRE version 1.9.0 (Ghadamon)
Unsupported screen format: depth: 16, red_mask: 3f, blue_mask: f800
Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.
Segmentation fault

The same command correctly starts RViz when run directly on my workstation with an attached monitor.

Note that I'm using ROS Kinetic on Ubuntu 16.04, and vnc4server as my VNC server.

Thanks for any help!

edit retag flag offensive close merge delete



RViz is an OpenGL application and (tries to) make(s) use of 3D graphics acceleration if possible. It may be that your VNC server is not capable of providing that. That would be something to check.

Additionally, from this:

Unsupported screen format: depth: 16, red_mask: 3f, blue_mask: f800

it looks like your VNC server is running a screen resolution and bit depth that does not agree with what Ogre wants/needs. That would be something to look into as well.

In general though: using OpenGL based applications with VNC is something that is a bit of a hit-and-miss. It can work, but there are no guarantees.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-13 01:16:09 -0500 )edit

Thanks for the reply, @gvdhoorn. Pretty new to ROS and VNC, but I am able to get glxgears running, so I think OpenGL is working fine. How would you recommend I check if the screen resolution and bit depth are correct/how to change them if they aren't?

Andrew Dassonville gravatar image Andrew Dassonville  ( 2019-11-15 00:22:38 -0500 )edit

Unfortunately I would have no idea. Note that glxgears is quite happy with very minimal OpenGL support, so it may not be the best indicator for this type of thing.

As I wrote: I don't know for sure whether this is your problem, I just wanted to let you know that VNC, just as Windows Remote Desktop, is not always capable of providing the accelerated OpenGL support that applications such as RViz (and Gazebo) would need.

gvdhoorn gravatar image gvdhoorn  ( 2019-11-15 03:26:19 -0500 )edit