Yeah, so this does work for me. Steps I followed -
-
Add
UE4Editor.exe
to an allowed rule, see https://github.com/mahmoudajawad/wsl-hacks/blob/master/wsl2-networking.md
The .exe file can be found inEngine/Binaries/Win64
in the folder where UE has been downloaded
If using a pre-built environment, add the corresponding .exe file in the rule -
Added the following in my
.profile
export WSL_HOST_IP=$(ipconfig.exe | awk '/WSL/ {getline; getline; getline; getline; print substr($14, 1, length($14)-1)}')
export DISPLAY=$WSL_HOST_IP:0
- In
settings.json
, set the IP addresses-
"LocalHostIp": "0.0.0.0",
"UdpIp": "192.168.179.223",
UdpIp
is the IP address of Ubuntu 18.04 running under WSL, using ip addr show eth0
-
I’m using XLaunch for the X11 windows, in that I added
-ac
as additonal argument, see https://github.com/microsoft/WSL/issues/4106 -
Launching SITL -
sim_vehicle.py -v ArduCopter -f airsim-copter -A --sim-address=$WSL_HOST_IP
So many things are needed since the address spaces are different in WSL 2 rather than the same on WSL 1. Should add to the Wiki as well, after some more testing or checking if steps can be reduced