Setting up the Build Environment on Windows10 using WSL1 or WSL2

These setup instructions describe how to setup “Bash on Ubuntu on Windows” (aka “Windows Subsystem for Linux”) which allows building with waf.


It involves enabling the built-in Windows Linux environment (WSL) in Windows10, installing a compatible Linux OS image, and finally installing the build environment as if it were a normal Linux system.

Upon completion, you will be able to build ArduPilot binaries and run the native ArduPilot SITL simulator, including the MAVProxy developer Ground Control Station.

WSL1 vs WSL2

WSL2 is the latest version of the Windows10 Subsystem for Linux. It is many times faster than WSL1 and is therefore much preferred for building the code in terms of speed. It can also run MAVProxy and native SITL. However, it does not support USB yet, so uploading code or connecting to the autopilot is not possible. Also, it does not support running Realflight on the same or a remote PC.

Once installed, you can switch between WSL1 or WSL2 versions as you prefer.

WSL Setup steps

  1. First, follow the instructions here. Usually, installing the latest version of Ubuntu is preferred.
  2. Congratulations, you now have a working Ubuntu subsystem under Windows, you can now use our Ubuntu instructions to install ArduPilot development environment


You can run XWindows applications (graphical programs, including SITL) by installing VcXsrv, Cygwin X or Xming on Windows. You will need to set the DISPLAY variable to point to your display: in WSL it is, in WSL2 it will be the ip address of the PC’s network port and can be set by using the code below. For more information regarding configuring your XLaunch Software , you can refer to this resource. Also in WSL2 you may have to disable the firewall for public networks, or create an exception in order for VcXsrv to communicate with WSL2:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0


For code editing you can install VSCode inside WSL.


Windows 10 includes “Windows Defender” virus scanner. It will slow down WSL quite a bit. Disabling it greatly improves disk performance but increases your risk to viruses so disable at your own risk. Here is one of many resources/videos that show you how to disable it:

File System Access between WSL and Windows10

From within WSL, the Windows drives are referenced in the /mnt directory. For example, in order to list documents within your (<username>) documents folder:

ls /mnt/c/'Documents and Settings'/<username>/Documents
ls /mnt/c/Users/<username>/Documents

From within Windows, the WSL distribution’s files are located at (type in windows Explorer address bar):

\\wsl$\<distribution name>


When trying to run your Ground Control Station software on wsl, if the application returns an error “fuse: device not found, try ‘modprobe fuse’ first” then it will be better to either use MAVProxy or MissionPlanner as your default ground control station because wsl does not support fuse(for more information check : ). As of now, this error has been seen while using QGroundControl on WSL running Ubuntu 16.04.