Spin up a full ArduPilot Software‑In‑The‑Loop (SITL) drone simulator on a Windows laptop using WSL (Ubuntu). This guide is copy‑paste friendly and includes tips for Mission Planner / QGroundControl and DroneKit.
Works great on Windows 11 (WSLg GUI supported). On Windows 10, either use an X‑server (VcXsrv) for GUI windows or run without
--map --consoleand connect from a Windows GCS.
- A compiled ArduCopter SITL binary
- One‑command run via
sim_vehicle.pywith map + console - GCS connection (Mission Planner / QGroundControl)
- Optional DroneKit connection
- Windows 10/11 64‑bit
- ~10 GB free disk space
- Admin access
- Stable internet
Open PowerShell as Administrator and run:
wsl --installReboot if prompted, then launch Ubuntu from the Start menu and create your Linux username (e.g., ace).
Already have WSL? Ensure WSL 2 is default:
wsl --set-default-version 2In the Ubuntu terminal:
sudo apt update && sudo apt upgrade -y
# Common build + Python tools
sudo apt install -y git python3 python3-pip python3-dev python3-setuptools \
build-essential cmake g++ \
libxml2-dev libxslt1-dev \
python3-opencv python3-matplotlib \
python3-tk
python3-tkenables MAVProxy's optional map/console windows. On Windows 11 WSLg, these pop up natively. On Windows 10, use an X‑server or run headless.
cd ~
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submodule update --init --recursiveArduPilot ships a helper script for Ubuntu:
Tools/environment_install/install-prereqs-ubuntu.sh -y
# Reload environment
. ~/.profileImportant: Run
./waf ...from the top‑levelardupilotfolder — not insideArduCopter/.
cd ~/ardupilot
./waf configure --board sitl
./waf copter- To build other vehicles later:
./waf plane # ArduPlane ./waf rover # Rover ./waf sub # Submarine
Start a quadcopter with console and map:
cd ~/ardupilot
Tools/autotest/sim_vehicle.py -v ArduCopter -f quad --console --mapYou should see MAVProxy console output and a map. The vehicle will boot on the runway at a default location.
# Faster sim time
--speedup 1 # 1 = realtime (increase for faster‑than‑real‑time)
# Change home
--lat <deg> --lon <deg> --alt <m>
# Multiple vehicles
-N # auto‑increment ports for additional instances- Launch SITL first.
- Open Mission Planner → CONNECT → choose UDP → port 14550 → Connect.
- It should auto‑discover. If not, start SITL with an explicit output:
Tools/autotest/sim_vehicle.py -v ArduCopter -f quad --console --map \ --out=udp:127.0.0.1:14550
- Start SITL; QGC usually auto‑connects to UDP 14550.
From the MAVProxy console you can try:
mode GUIDED
arm throttle
takeoff 10
Minimal example (Python):
from dronekit import connect, VehicleMode
# UDP endpoint commonly used by SITL
vehicle = connect('127.0.0.1:14550', wait_ready=True)
print("Connected:", vehicle.version)
vehicle.mode = VehicleMode("GUIDED")
vehicle.armed = True
vehicle.flush()
# ... write mission / takeoff logic here ...
vehicle.close()If you prefer TCP, use
connect('tcp:127.0.0.1:5760', wait_ready=True)depending on yoursim_vehicle.pyoutputs.
Install DroneKit in WSL Ubuntu:
python3 -m pip install --upgrade pip
pip install dronekit pymavlink# 0) In Ubuntu (WSL)
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3 python3-pip python3-dev python3-setuptools \
build-essential cmake g++ libxml2-dev libxslt1-dev python3-opencv \
python3-matplotlib python3-tk
cd ~ && git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot && git submodule update --init --recursive
Tools/environment_install/install-prereqs-ubuntu.sh -y
. ~/.profile
./waf configure --board sitl
./waf copter
Tools/autotest/sim_vehicle.py -v ArduCopter -f quad --console --map1) No function 'configure' defined in .../ArduCopter/wscript
You ran ./waf inside ArduCopter/. Run from repo root:
cd ~/ardupilot
./waf configure --board sitl
./waf copter2) No function 'copter' defined in .../ArduCopter/wscript
Same root cause—run from repo root (~/ardupilot), not inside ArduCopter/.
3) waf-light: error: no such option: --board
You’re on an older branch. Either git pull to update, or use the older syntax:
./waf configure --target=bin/arducopter
./waf build --target=bin/arducopterThen run:
Tools/autotest/sim_vehicle.py -v ArduCopter -f quad --console --map4) sim_vehicle.py: command not found
Use the full path: Tools/autotest/sim_vehicle.py ...
(Optionally add export PATH="$HOME/ardupilot/Tools/autotest:$PATH" to ~/.bashrc.)
5) No GUI map/console on WSL
- Windows 11: ensure you’re on WSLg (default for
wsl --install). - Windows 10: install an X‑server (e.g., VcXsrv) and set
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0before running, or omit--map --consoleand use a Windows GCS.
6) GCS doesn’t connect
- Open Mission Planner first, choose UDP 14550.
- Or start SITL with:
--out=udp:127.0.0.1:14550. - Ensure no firewall blocks UDP 14550.
7) Clean rebuild
./waf clean
./waf coptercd ~/ardupilot
git pull
git submodule update --init --recursive
./waf configure --board sitl
./waf copter- Try Auto missions from Mission Planner / QGC
- Simulate GPS glitches / wind / failsafes
- Explore Gazebo or SITL‑with‑AirSim for 3D worlds
- Hook up your GCS web app / DroneKit scripts
- ArduPilot is GPLv3 — see the upstream repository for full license and docs.
- Huge thanks to the ArduPilot community and maintainers.
Happy flying (virtually)! 🚁