Board index FlightGear Support Installation Linux

fgfs headless on Linux VM

Installing FlightGear, scenery, aircraft etc. on Linux systems like Ubuntu.

fgfs headless on Linux VM

Postby ml_guy » Fri Sep 24, 2021 6:54 pm

Is there a way to run FlightGear truly in headless mode? I tried the following:
Code: Select all
fgfs --disable-gui

but encountered this error:
Code: Select all
    0.01 [WARN]:gui        QXcbConnection: Could not connect to display
    0.01 [ALRT]:gui        Could not connect to any X display.


Even enabling X11 tunneling I get the following error:
Code: Select all
    3.25 [WARN]:gui        UI languages: ("en-US")
StatsHandler::StatsHandler() Setting up GL2 compatible shaders
Now checking for plug-in osgPlugins-3.4.1/osgdb_nvtt.so
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
    4.88 [INFO]:OSG        Error: Unable to create OpenGL graphics context.
    4.90 [ALRT]:headless   Fatal Error: "Unable to create window"
    4.90 [ALRT]:headless   Error Message: "FlightGear was unable to create a window supporting 3D rendering (OpenGL). This is normally due to outdated graphics drivers, please check if updates are available. "
    4.90 [ALRT]:headless      More text: "Depending on your OS and graphics chipset, updates might come from AMD, nVidia or Intel."


I just want to be able to run FlightGear on a separate VM to be able to pipe data out from it and train an ML model on it.
ml_guy
 
Posts: 2
Joined: Thu Sep 23, 2021 9:27 pm

Re: fgfs headless on Linux VM

Postby Hooray » Fri Sep 24, 2021 8:22 pm

Hi & welcome,

please see: https://wiki.flightgear.org/FlightGear_Headless

You can also find a simple patch there to add a "headless" option to the viewer, so that the corresponding window isn't created - instead, pbuffer rendering is enabled.

However, you will probably want to tell us what exactly you'd like to use the headless mode for ?

If in doubt, refer to the developers mailing list - the headless option is a long-standing idea, and a recurring feature request, so it might make more sense to discuss it on the devel mailing list
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: fgfs headless on Linux VM

Postby ml_guy » Mon Sep 27, 2021 4:05 pm

Thanks, I'll get on the developer mailing list. Basically, I have a FlightGear recording which I want to replay using the --load-tape flag, and stream data out from the simulator (latitude, longitude, altitude, heading, etc) and send it to a TCP server by using the flag --generic=socket,out,20,localhost,8890,tcp,<config_file_here>. I want to be able to run fgfs on a VM so I can run the simulator and let my TCP server collect data from it without me having to be present (log in, run fgfs in the background, log out, log back in later to collect whatever data was saved by the TCP server).
ml_guy
 
Posts: 2
Joined: Thu Sep 23, 2021 9:27 pm

Re: fgfs headless on Linux VM

Postby Hooray » Mon Sep 27, 2021 4:38 pm

that should all be possible - however, the first question should be whether you really need fgfs, or just the FDM (flight dynamics) ?
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: fgfs headless on Linux VM

Postby MariuszXC » Wed Sep 29, 2021 10:25 pm

ml_guy wrote in Mon Sep 27, 2021 4:05 pm:Basically, I have a FlightGear recording which I want to replay using the --load-tape flag, and stream data out from the simulator (latitude, longitude, altitude, heading, etc) and send it to a TCP server


So, if I understand correctly, you are after a FGFS-generated TCP data stream (every time identical), which gets fed to your ML model, right?
If that is the case, you might consider recording the stream once and then replaying it, with a tool like tcpreplay. This would remove the need to run FG after the initial stream capture.

https://linux.die.net/man/1/tcpreplay
https://github.com/appneta/tcpreplay
https://tcpreplay.appneta.com/
INOP
MariuszXC
 
Posts: 1061
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04


Return to Linux

Who is online

Users browsing this forum: No registered users and 3 guests