Running Linux applications on Windows 10

Big thanks to Microsoft for introducing Linux sub-system on windows 10.  Given below are the steps to run ‘almost’ any Linux application on windows (should I say natively?). Details of individual steps are skipped on purpose, as the user is expected to understand what is going on. If it is not understandable, it is probably not safe to proceed.

  1. After enabling developer mode, install Linux sub-system. In PowerShell started with admin rights, enter the following command to install the sub-system:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Restart the computer.
  3. Run command prompt as administrator, type bash, and press enter. Follow the onscreen instructions to install ubuntu.
  4. Update the sources.list file on bash with the following repositories:
    ###### Ubuntu Main Repos
    deb trusty main restricted universe
    deb-src trusty main
    ###### Ubuntu Update Repos
    deb trusty-security main restricted universe
    deb trusty-updates main restricted universe
    deb trusty-backports main restricted universe
  5. Run apt-get update && apt-get install
  6. Run the following command in bash, which will allow seeing GUI on windows screen
    echo "export DISPLAY=:0" >> ~/.bashrc
    source ~/.bashrc
  7. Install Xming on windows. available here. Start the application. It starts minimized in the taskbar without any open window.
  8.  Run any application that needs display from bash, for example, “xeyes” to confirm that it is working fine.

Example: Running ARGoS simulator:
Once bash is working and you can see xeyes in a new window, follow instructions for installing ARGoS on ubuntu as given here. If you don’t see  simulator window, check if Xming server is up and running in windows.



What doesn’t work:
Any application that needs access to hardware files on Linux. for example ifconfig command fails, so does lsmod, lspci, lsusb, etc. It also means that though ROS can be installed and configured, but roscore cannot start as the application cannot open up 11311 port 🙁  A loopback adapter “might” allow running ROS.

Leave a Reply