Solving the Udacity SDCND exercises with the Windows Subsystem for Linux (WSL) / Windows Ubuntu

Some of the projects in the SDCND nano-degree are C/C++ projects base on cmake. Though there is some support for using direct Windows development, to some, developing on Linux is more comfortable and Linux is also actually relevent as an OS in the automotive domain. There are several scenarios that you could use on a Windows PC:

  • Setup dual boot and boot into the OS that you currently need for development – boring and cumbersome
  • Set up a virtual machine (e.g. with VirtualBox) that runs an Ubuntu Linux. A very nice solution, and actually one that I prefer.
  • Use the Windows Subsystem for Linux (WSL) to run Ubuntu directly on your machine. This is a new feature of Windows 10.

For the last scenario, most of the instructions for developing on Linux directly apply. However, WSL does not (directly) support programs with a GUI. So what would you do for that?

In the Unix world, GUIs are displayed on a system called the X-Server. So what would we need to run, e.g. Eclipse in Ubuntu directly on Windows?

  1. Install and run an X-Server. I use MobaXTerm. It is a standalone program and can be easily configured.
  2. Install Ubuntu from the Microsoft app store:
  3. Start Ubuntu from the windows menu
  4. In the Ubuntu shell, install a Java run time / JDK.
    sudo apt-get update
    sudo apt-get update
  5. Download an Eclipse distribution for Linux 64 bit. Unpack it (hint: gunzip -c , tar xvf  ).
  6. In the Ubuntu shell:
    export DISPLAY=localhost:0.0
    This sets the information where the X-Server is to be found to display the GUI-based programs from the Ubuntu Shell
  7. Run the Eclipse binary -> voila, a Unix-Styled Eclipse on your Windows desktop: