Gazebo | Ignition | Community
Ask Your Question

Gzserver fails on a k3s cluster

asked 2020-11-02 07:38:03 -0500

notnath gravatar image

I'm trying to run a ROS integrated Gazebo server on a cluster in a virtual machine. The idea is to run gzserver headless, utilize the computation power there, and view the results using gzweb.

The ROS package which uses gazebo has been dockerized. Gzserver works as expected when the docker container is run as an isolated container, but throws the following error when the same container is deployed on a k3s cluster.

As seen in the screenshot below, gzserver crashes immediately after launch. A generalized error is thrown and the log files do not share any other information. Moreover, the log file(s) gazebo-1*.log cannot be found.

image description

The (ros)launch file can be found here (pastebin).

I believe the error could be either because of lack of GPU access, or because gzserver is not really running headless.

Has anyone faced something similar? Can you confirm if the parameters in the launch file are set up correctly? Are there any tips/tutorials I could follow to run Gazebo in a proper headless manner?

edit retag flag offensive close merge delete


Enable verbose and debug, and see if you get any more information.

nlamprian gravatar imagenlamprian ( 2020-11-02 10:57:58 -0500 )edit

@nlmprian verbose and debug show that the problem might be with the display: Can't open display; Unable to create x window; Thread 1 "gzserver" received signal SIGSEGV, Segmentation fault. The complete log can be found here (pastebin)

notnath gravatar imagenotnath ( 2020-11-05 07:40:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-05 08:30:11 -0500

nlamprian gravatar image

Try setting the DISPLAY env variable with the gazebo node

<node name="gazebo" pkg="gazebo_ros" type="$(arg script_type)" respawn="$(arg respawn_gazebo)" output="screen" args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) -e $(arg physics) $(arg extra_gazebo_args) $(arg world_name)">
  <env name="DISPLAY" value=":0" />
edit flag offensive delete link more


Doesn't do anything other than change the error from Can't open display to Can't open display :0. Can't understand why gzserver even needs a display.

notnath gravatar imagenotnath ( 2020-11-05 12:54:25 -0500 )edit

Ah, I reacted to the error and forgot about your problem description. Gazebo can indeed run headless. It needs an x server though. If you don't have that configured, you usually get 'rendering is disabled' warnings and your cameras don't work. In your case, you say you don't have a GPU in your system. Perhaps you need to configure a virtual display. There are probably related threads in the forum. Have a look

nlamprian gravatar imagenlamprian ( 2020-11-05 16:23:31 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-11-02 07:38:03 -0500

Seen: 64 times

Last updated: Nov 05 '20