Skip to content

Start Webots

Yannick Goumaz edited this page Mar 4, 2022 · 12 revisions

Webots needs a X11 connection to a X-server to run. So there are 2 options to start Webots:

  • GUI on your local display: In the jumax access tutorial, at step 11, you added the ForwardX11 yes line in your SSH config file. This allows to forward your X display to the remote computer. This way, Webots will get a X11 connection to a X-server running on your local machine. You can launch Webots in the $WEBOTS_HOME directory with the following command: ./webots. Webots will start with the GUI.

  • Headless (without GUI): The other option is to run Webots headless. The best tool for that is xvfb-run, but it is not installed on Jumax. The alternative is to use Virtual Network Computing (VNC), using the vncserver package installed on Jumax. VNC allows to remotely control and display another computer. Here we will use the package to create a virtual display for Webots. To do that, follow these steps:

    1. In your user1@jumaxbuild1:~/ directory, execute the following command: vncserver.

    2. VNCserver will ask you for a username and a password. Choose user information that you will remember.

    3. Once you finish the configuration, type cd .vnc and edit the xstartup file with vim: vim xstartup. This file is used to define applications you want to run when creating a display. You need to add the following line after the unset lines:

      /home/jusers/user1/jumax/webots/webots --no-rendering --batch /path/to/your/world/file.wbt
      Don't forget to replace user1 by our username. You can also add --stdout and --stderr options to redirect the webots logs to the VNC log file (see step v.).

    4. Then, you can start a new virtual display using vncserver command. It will start Webots headless at the same time.

    5. The logs generated are saved in .vnc/jumaxbuild1:DISPLAY#.log

    6. To see the list of existing displays, use the following: vncserver -list. To kill an existing display: vncserver -kill :DISPLAY#

Redirecting the GUI to the local computer has some performance impact compared to running headless. For more information, see this page: Difference in performances by running headless and with GUI.

Clone this wiki locally