ArduPlane in SITL - problems running JSBSim

Hello,
I am having difficulties running ArduPilot in SITL with JSBSim. JSBSim seems to fail right after starting the simulation. The ArduPilot firmware is a fork of V3.8.5 (I need to double check this), JSBSim is V1.2.0.dev1 and MAVProxy is V 1.8.62. It all runs in a Ubuntu 18.04 virtual machine on a Win 11 host. Edit: Python V2.7.

When launching using;

sim_vehicle.py -v ArduPlane -f jsbsim:Rascal --console --map

JSBSim starts, loads the Rascal model and tries to start, but then the following errors are reported in the ArduPilot window;

[…]
---- JSBSim Execution beginningOpened JSBSim control socket
 ... --------------------------------------------

start engine (Event 0) executed at time: 0.001000

Start: Monday August 21 2023 19:29:58 (HH:MM:SS)
error recv on control socket: Bad file descriptorSimulation elapsed time: 0.001000
  Ground Trim
FATAL ERROR: JSBSim terminated with an unknown exception.
Fatal: Failed to send on control socket: Connection reset by peer

At the same time the terminal window with MAVProxy shows;

[…]
SIM_VEHICLE: Using defaults from (/home/nwuser/AP_j1/Tools/autotest/default_params/plane-jsbsim.parm)
SIM_VEHICLE: Run ArduPlane
SIM_VEHICLE: "/home/nwuser/AP_j1/Tools/autotest/run_in_terminal_window.sh" "ArduPlane" "/home/nwuser/AP_j1/build/sitl/bin/arduplane" "-S" "-I0" "--home" "-35.363261,149.165230,584,353" "--model" "jsbsim:Rascal" "--speedup" "1" "--defaults" "/home/nwuser/AP_j1/Tools/autotest/default_params/plane-jsbsim.parm"
RiTW: Starting ArduPlane : /home/nwuser/AP_j1/build/sitl/bin/arduplane -S -I0 --home -35.363261,149.165230,584,353 --model jsbsim:Rascal --speedup 1 --defaults /home/nwuser/AP_j1/Tools/autotest/default_params/plane-jsbsim.parm
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: "mavproxy.py" "--master" "tcp:127.0.0.1:5760" "--sitl" "127.0.0.1:5501" "--out" "127.0.0.1:14550" "--out" "127.0.0.1:14551" "--map" "--console"
Connect tcp:127.0.0.1:5760 source_system=255
Loaded module console
Loaded module map
Log Directory: 
Telemetry log: mav.tlog
MAV> Waiting for heartbeat from tcp:127.0.0.1:5760
EOF on TCP socket
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Exception in thread main_loop:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/nwuser/.local/bin/mavproxy.py", line 1066, in main_loop
    master.wait_heartbeat(timeout=0.1)
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 557, in wait_heartbeat
    return self.recv_match(type='HEARTBEAT', blocking=blocking, timeout=timeout)
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 518, in recv_match
    m = self.recv_msg()
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 475, in recv_msg
    s = self.recv(n)
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 1285, in recv
    self.handle_eof()
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 1269, in handle_eof
    self.reconnect()
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 1310, in reconnect
    self.do_connect()
  File "/home/nwuser/.local/lib/python2.7/site-packages/pymavlink/mavutil.py", line 1252, in do_connect
    raise e
error: [Errno 111] Connection refused

…and the execution hangs there.

Running with the “standard” physics simulation works fine;

sim_vehicle.py -v ArduPlane -f plane --console --map

Edit: Running SITL with the “standard” physics simulation is actually not working properly. The simulation appears to run OK, but it is not possible to change the mode from MANUAL. Attempts at changing mode returns COMMAND_ACK: DO_SET_MODE: UNSUPPORTED. I am not sure if this is linked to the problem with JSBSim.

Any suggestions what might be wrong would be very appreciated!

Thanks in advance!

Jonas