WSL 2 Can't Run SITL, Only WSL 1 Can Run SITL

Hello.

SITL can’t run with WSL2. After I changed it to WSL1, it worked, as shown in the video.

I wonder why sometimes WSL2 can’t run double instances of SITL.(I mean 1 Rover & 1 Plane)

For some reason, I have to use WSL2 (only WSL2 can run graphical applications).

I want to integrate everything. Switching between WSL1 and WSL2 is very inconvenient.

not related to ardupilot.

You need to use 0.0.0.0 if you want to have data exiting wsl2 not 127.0.0.1. That is on wsl2 documentation about their network layer

2 Likes

Hello.

  1. Thank you for your development and activity on forums. It helps a lot of people. I admire Ardupilot autopilot system.

  2. This is not related to Ardupilot, but it can help many beginners in Ardupilot development.
    The problem with WSL2 was like a sore tooth. The guide was insufficient, and changing the SITL aircraft’s voltage led to unexpected crashes. I think there should be a more detailed guide, and that is why I am posting this question here for others’s information. I’m imagining that I edit ardupilot wiki if I reach certain level of programming.

  3. Changing the address to “0.0.0.0” didn’t work. I changed the address to the vEthernet’s IP address, and it worked.

  4. After that, another problem occurred. Actually, this is why I ran SITL in WSL1 for a very long time, instead of using WSL2. This time, I decided to move to WSL2 to perfect my system without any flaws
    and I was able to run Rover and Plane instance by adding “–count=2” option but it is not perfect solution. I still found no perfect solution for running Rover and Plane Instance in WSL2.

I attached the video :

My workaround is adding “–count=2” command.

Do have anyone have perfect solution?