Building ArduPilot on Windows with waf and Bash


This build method is ONLY for Windows10 x64 and does not describe building for deprecated Arduino based flight controllers (APM1.x, 2.x). It supports most users, however you may need or prefer to use the alternate windows build process here:


Microsoft has introduced WSL - the Windows Subsystem for Linux - into Windows 10. This tutorial describes “Bash on Ubuntu on Windows”, as it is currently the only released distribution supported by WSL. Other Linux distributions, such as Fedora, are likely to be available in the future however will require slightly different setup to compile Ardupilot.


This tutorial is intended to be a “copy & paste” guide. Just follow the process step by step and be patient with yourself!


To install “Bash on Ubuntu on Windows” there are many tutorials on the web. An example is here: <>`__.

Setup Ardupilot Dev Enviromment for Ubuntu bash on Windows 10

  1. First, you have to insert your local host to the /etc/hosts file:

    sudo nano /etc/hosts
  2. Insert this below first line: "hostname"

    (where “hostname” is your PC name)

  3. Then, take root control over the terminal:

    sudo passwd root
    su root
  4. Back to main directory:

  5. Install git:

    sudo apt-get install git
  6. Make a new folder for future reference (optional):

    mkdir GitHub
    cd GitHub
  7. Clone ardupilot git:

    git clone
  8. Run the script:

  9. We also need to install some extra tools, so we can compile for the various Ardupilot targets:

    sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
    sudo apt-get update
    sudo apt-get install cmake
    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install g++-4.9
    sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
    sudo apt-get update
    sudo apt-get install gcc-arm-none-eabi=
    sudo apt-get update
    sudo apt-get upgrade

Compile ArduPilot Code

  1. “Waf” is the preferred build tool for Ardupilot, and works well in Windows with Ubuntu Bash. Go to git ardupilot software:

    cd GitHub/ardupilot/
  2. It’s possible to get a list of supported boards on ArduPilot with the command below:

    ./waf list_boards
  3. Configure your board:

    ./waf configure --board target

    (where “target” can be px4-v2, navio, pxf,... choose from supported boards as mentioned above)

  4. Compile for your target:

    ./waf vehicle

    (where “vehicle” can be copter, plane, rover,...)

  5. And here you are! You have compiled your code!


The released WSL does not have access to USB serial peripherals, so the –upload option in waf will not work over USB. The compiled binary must be uploaded to your flight controller using another tool, such as MissionPlanner as a “Custom Firmware”. If you wish to upload via waf, at time of writing USB serial access is only available in the Windows Insider releases of Windows Subsystem for Linux (WSL), which requires you to join the Windows Insider program. For network connected flight controllers, such as linux targets, –upload does function as described here:


if you want to unhide Ubuntu system folder on Windows, open a command prompt as administrator, navigate to Ubuntu system path (C:UsersusernameAppDataLocal) and change the folder attributes. So (where “username” is your user name):

cd C:\Users\username\AppData\Local
attrib -s -h lxss

You can make a direct access to “lxss” folder on your desktop for a quick navigation.