July 22, 2016 12:00 pm

Fun with the Windows Subsystem for Linux

By / Principal Program Manager – Windows/PAX

At Build 2016, Microsoft introduced to the world the Windows Subsystem for Linux (Beta) [WSL], which enables developers to run native Ubuntu user-mode console binaries through the Bash shell in Windows 10. If you’re in the Windows Insider program, you’ve had the opportunity to try out this feature using the latest Windows Anniversary Update Insider Builds.

Web developers are used to making difficult choices on which tools and libraries they can use based on the operating system they’re actively working on. The WSL was designed and built by the Windows Kernel Team and delivered in partnership with Canonical, to help Windows 10 developers use the rich Linux developer ecosystem and tools alongside the great tools they are already using in Windows, without having to boot into another operating system or VM. This is definitely a “by developers, for developers” Windows 10 feature, specifically designed to remove a bit of friction from developers’ daily workflow.

In this post, I’m going to show you a few of the features of WSL that I personally find very interesting, as well as point you to some resources to help you learn more. First, I’ll show the integration of staple commands like ssh for working with Linux servers and devices. Second, I’ll demonstrate the ability to use Bash scripting to automate tasks in a very natural way. Third, I’ll have a little fun with the great command-line compilers, other tools and the *nix compatibility offered, and play a little NetHack. Finally, I’ll show you the ability to use existing Python and other scripts available on the web.

Windows is my primary operating system and development environment, and has been since Windows 3.0 on my first 286. Nevertheless, I’ve always had Linux servers or devices kicking around my place. From IoT devices such as the Raspberry Pi and dedicated router/gateway devices to Minecraft servers, they tend to collect on the shelves and corners in my office. One thing I always need to do is manage and configure these Linux computers easily from my main workstation.

Managing Servers and Devices

I currently run a headless Ubuntu Minecraft server from my house. It was my Christmas present to my 10-year old son this past year, but it has turned out to be my toy as much as his (ok, more my toy). I used to use a few client apps to manage it from my primary Windows 10 PC, but now I just use command-line ssh from within Bash on Windows 10. Using apps like PuTTY and Tera Term are fine of course, as is using the great tools that come with Cygwin, but I wanted a truly native and natural experience that just flowed well. Cygwin always felt to me a bit like ordering stir-fry at a pizza place. It was fine, but the execution just didn’t feel right for the environment.

I have the public/private key pairs set up using ssh-keygen and ssh-copy-id from the WSL, so to ssh, I simply type:


$ ssh <username>@<server>

I created an alias which makes that quicker. This is a standard Linux/Bash feature:


$ alias mc='ssh <user>@<server>'

Now, to get to the Minecraft server I simply type “mc” at the Bash prompt in Windows 10.

IMAGE1

This same approach works, of course, with any Linux-based web or database servers or even Raspberry Pi and similar IoT devices you may be using as part of your solution.

Being able to cleanly secure shell from a console prompt is just a convenience and a preference. However, once you get used to working directly in the shell, in a full environment which includes staples like apt, node, Ruby, Python, and others, you open up all sorts of possibilities for automation.

Remote Scripting

Let’s say you have a whole bunch of Linux devices or servers, and you want to execute a remote command on them. Assuming you’ve already set up your public/private key pairs, you can simply execute remote ssh commands from Bash.

For example, to see when the last reboot time was on a remote server, you would type this:


$ ssh <user>@<server> 'last -x|grep reboot'

That secure shells to the server and executes the last -x command, and searches for the lines containing the word “reboot.” When I run it against my Ubuntu Minecraft server, I get this result:


reboot   system boot  4.4.0-28-generic Thu Jul  7 08:14   still running

That’s a single server. If you have a list of servers, you can automate that part as well. I’ve created a file named servers.txt in my home directory on WSL. It contains a bunch of Linux server/device names — one per line. I then read that file from a script I created in my home directory on WSL.

After years of working with devices like the Raspberry Pi, I’m a nano kind of guy (on VMS I was an LSEdit person), so this is what the script looks like in my favorite console editor:

IMAGE2

You can, of course, use vim or emacs or any other editor that works in an Ubuntu console session.

The language used is Bash script (also called Bash shell script). To execute the script, I simply type:


$ ./foreachserver.sh 'last -x|grep reboot'

And it will iterate over each server/device in the file and execute that command remotely over ssh. This is a very simple example, of course, but you can extend to redirect in local scripts or other useful commands. The Bash scripting language is rich enough so that you can accomplish most remote administration tasks using it. You can also extend it with other applications you download to the WSL or the remote computers.

What if you want to use local Windows files and resources with your workflow with other Linux computers? Or, what if you do not use Linux at all? Is Bash capable of working with local Windows files and resources, or is it a completely isolated environment?

Working with Windows files

The WSL has access to your PC’s file system through /mnt/<drive letter>/ directories (or mount points). For example, your C:\ and D:\ root directories in Windows would be available through /mnt/c/ and /mnt/d/ respectively in the WSL. This can be useful when you want to incorporate your Windows project files, downloads or other files into a Linux/Bash-based workflow.

IMAGE3

Those map to the SSD and mechanical drive I have on the PC:

IMAGE4

These are logical mountings, so they don’t currently show up when you use commands like mount in the shell. But they work as you would expect them to. For example, from within Windows, I placed a text file named test.txt in the root of my C drive. I can access it from WSL like this:

IMAGE5

During the Build Tour, we wanted to make sure the demos all worked without internet access (you never know what venue networking will be like). So to make sure the Bash / WSL demo would work for the Git portion, and to demonstrate accessing Windows files on the local PC, I set up a local repo at C:\git\NetHack on the Windows PC. To clone that within WSL, I executed the following:


$ git –clone file:///mnt/c/git/NetHack

That command line told git to use the file:// protocol and to clone the repo located in /mnt/c/git/NetHack. You can access all of your Windows files in a similar fashion.

Warning: As with any console, you can modify/delete files in your Windows file system from Bash if you’re not careful. For example, you can do something like the below and end up wiping out a good bit of your Windows installation, assuming the Windows account you’re running under has rights to do so:


$ rm -rf /mnt/c/  <strong>[DO NOT DO THIS]</strong>

I bring this up because Linux commands are new to many of us, whereas Windows console commands are not.

The magic that makes this file system integration happen is called DrvFs. If you want to learn more about the file system and how it works in WSL, the WSL team put together a great blog post with all the details.

Of course, file system access is only part of the story. Many development tasks involve accessing remote resources over HTTP or other network protocols.

Making HTTP Requests

It’s often helpful to make a REST or other HTTP (or FTP) call from a script or command line rather than from a compiled program or web page. Just like most Linux distros, WSL includes standard utilities like curl and wget for making HTTP and other networking calls. For example, here’s the REST call to GitHub to get my profile information, using curl:


$ curl -i https://api.github.com/users/Psychlist1972
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 13 Jul 2016 02:38:08 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1319
Status: 200 OK
...
{
  "login": "Psychlist1972",
  "avatar_url": "https://avatars.githubusercontent.com/u/1421146?v=3",
  "url": "https://api.github.com/users/Psychlist1972",
  "name": "Pete Brown",
  "company": "Microsoft",
   ...
}
$

You can combine this with Bash scripting to create quick test clients for REST APIs, or utilities to ping web pages on servers and report back status. It’s also great just to download a file from the web; you could simply redirect the output to a file rather than view it on-screen:


$ curl -i https://api.github.com/users/Psychlist1972 > pete.json

I’m also a PowerShell user, and have even created some interesting extensions to use Windows 10 MIDI in PowerShell and also to fix some file corruption that was happening to users of certain sound recording hardware. As a longtime .NET developer and fan, I will continue to use and extend PowerShell as it makes sense for my projects. But PowerShell isn’t the right environment to run all those Bash and Linux-focused open source utilities and examples out on the web today. I want to use the easiest and most friction-free way to accomplish any task, and sometimes, that means doing it in Bash.

I’ve barely scratched the surface here on Bash, Bash scripting, and the tasks you can accomplish from the shell. So far, I’ve been talking about utility work that is useful but ancillary to development. What about doing actual development and compilation from within WSL? I demonstrated that as part of the Build Tour.

Bash at the Build Tour – NetHack

Earlier this summer, speakers from Microsoft went around the world demonstrating some of the cool new developer features in Windows and the Microsoft Cloud. As part of that, we wanted to demonstrate the WSL in a fun way, but also in a way that developers would relate to.

I personally wanted to show using git and some traditional console development tools. When I wrote the Bash demo, I included the basics (“Hello World” in Python and Ruby), but wanted to show something a bit more off the beaten path.

I thought back to my time in college, when we bounced back and forth between Unix (DEC Ultrix and SunOS) and VAX/VMS. At the time, Unix was almost exclusively a command-line first environment. At my school, most X users at the handful of graphics workstations just opened multiple terminal sessions in different windows, but with super-cool moon phase wallpaper in the background. The majority of students used VT-220 terminals for their sessions (the school wasn’t far from Boston, so we had a lot of DEC equipment).

At the time, there were two big games that all of the computer science majors were playing: MUDs (lpMUD and the brand new at the time DikuMUD, primarily) and NetHack. NetHack and other Roguelikes have been considered to be some of the most influential games in history, being the precursors to the many dungeon crawl and role-playing games we enjoy today.

NetHack has a long history and today contains more than a hundred thousand lines of decades year old *nix code, as well as modern additions. The game itself uses curses (or its replacements) for terminal interaction, requires lex and yacc (or flex and bison) and cc (or gcc), and a slew of other developer tools to build.

It’s written in C and includes a number of heavily scripted configuration utilities written for the Bourne shell. I figured it would be a good and fun test to exercise the developer capabilities of WSL and Bash on Windows 10. Due to the use of curses (libncurses on Linux and WSL), it would also help to demonstrate the capabilities of the terminal emulation built into the Windows 10 console window.

Back in the day, building NetHack from source took forever on our time-sliced Ultrix server. Now it takes a minute on my PC and it’s all done. I love progress. There are easy ways and hard ways to configure and compile NetHack on Linux or WSL. To save you some time, I’ll walk you through the easy approach.

Prerequisites

First, update your WSL environment to make sure you are pointing to the latest catalog of software and also have the base install up to date. It’s generally a good idea to do this before installing new packages.


        $ sudo apt update
        $ sudo apt upgrade

Then, install the essential developer tools. The easiest way to do this is to use the build-essential package. This includes almost every console program a Linux developer would need to build apps in C/C++.


$ sudo apt install build-essential

This will take a few minutes. If you want to be more surgical, you can separately install gcc, gdb, make, flex, bison and the other tools called for in the NetHack docs. But if you’re a developer, you’ll probably want the other tools at some point. The build-essential package takes the guesswork out of the toolset installation.

Next, install git. As you can imagine, it’s as easy as:


$ sudo apt install git

Just like with Linux, you can add a git PPA to get a more recent version, but this one will do for what we’re doing here.

And finally, we want to have curses (ncurses, actually) installed for the console screen interaction:


$ sudo apt install libncurses-dev

Once you’ve completed those steps, you’re ready to get building NetHack.

Building NetHack

The official NetHack repo is on GitHub. First, we’ll grab that and put it in a subfolder off our home directory.


        $ cd ~
        $ git clone http://github.com/NetHack/NetHack

IMAGE6

Because NetHack supports so many different operating systems, you’ll need to do some basic configuration to tell it that we’re using Linux on the command line and substituting free and open source tools for Unix classics like gcc for cc.

As I had mentioned, there are a number of ways to do this. Someone was thoughtful enough to encapsulate much of the configuration in a hints file. Trust me here, using the hints file will save you hours of headache in configuration versus the steps described on the GitHub repo. It’s not immediately obvious how to use the hints if you look at the README files or other documentation, so here you go:


        $ cd NetHack/sys/unix
        $ ./setup.sh hints/linux

That will set up the makefile to use the right tools, libraries and paths for Linux. The setup scripts are non-trivial shell scripts that do a lot of configuration; I’m happy to report they work perfectly in WSL. If you’re curious about shell scripting, be sure to crack them open in your favorite editor.

Then, the final build:


        $ cd ~/NetHack
        $ make all

After the build, you’ll want to create the install. This is really just about copying the executable to a known location:


$ make install

That will then leave you with a folder named ~/nh. Nethack is located in the ~/nh/install/games directory and is simply called nethack. To run it, navigate to that directory (or type the full path) and type:


        $ cd ~/nh/install/games
        $ nethack

Once you do that, the screen will clear and you’ll get prompted to start playing NetHack. Note that everything done here is just as it would be done on a vanilla Ubuntu Linux installation; nothing Windows-specific was needed.

Playing NetHack

Given the limitations of a console game and the complexity of NetHack, it may take a bit to get into it. To say it is a little cryptic at first would be an understatement, but I’ve never met a developer who shied away from a good challenge.

The navigation keys are the same as those used in VI(M), so HJKL for Left, Down, Up and Right respectively. To exit, you can find the stairs up on the top level and use them, or hit Control-C to force quit the game.

In NetHack, you are the @ symbol. Each level is made up of rooms, corridors, doors, and both stairs up and down. Monsters, treasure, and items are represented as various ASCII characters that you’ll become familiar with as you play. As is the norm with Roguelikes, there is no saving and you only get one life. If you die and play again, the dungeon is randomly re-generated and the items become scrambled.

The point of NetHack is to survive the dungeons, collect gold and items and kill as many monsters as you can. There are goals well beyond that, but you’ll need to play for a while (or read up) to discover them. Rules loosely follow Dungeons & Dragons rules for weapons, skills, etc.

Here’s a screen shot of NetHack with three rooms and two corridors visible. The stairs up are in the top-left room, and I’m currently in the top right room, along with some treasure and other items.

IMAGE7

If you don’t have color in your version, create a file named ~/.nethackrc and put the following in it:


OPTIONS=color:true,dark_room:true,menucolors:true

Aside: If ASCII character graphics aren’t your thing, but you like the concept, search for “roguelike” in the Microsoft Store and enjoy the more visual games in this popular genre.

Sure, NetHack is an ancient code base, most dear to those of us of a certain age. However, building it exercises a significant number of important developer tools and features of *nix operating systems, and also the terminal emulation. It’s great to see that all of it, from gcc, gdb, make, bison, and flex to more modern git, works on WSL today.

If you’d like to see the above demo as done at the Build Tour, watch this keynote from the Build Tour Canada. The WSL demo starts at around 6:20 in. (And yes, it’s Windows Subsystem for Linux, despite what I said in that video.)

I hope you enjoy your excursion into the dungeons of NetHack!

C and C++ are great, as are all these classic developer tools. You can even do a lot with plain Bash scripting. But many developer tasks involve scripting languages like Python.

Python

You can find example Python scripts all over the web, which implies that Python is both popular and useful to many developers. Most of those examples, of course, assume you are running Linux. In the past, this meant running them in a Linux installation either on another machine, a VM or boot option, or making any required changes necessary to run them using the Windows distributions of Python.

These aren’t insurmountable problems by any stretch, but in the day-to-day life of a developer, little bits of friction like this add up. With WSL, you always have a compatible Python-capable subsystem and shell available to you, without having to step out of your zone.

To install the latest development version of Python and the python package installer “pip,” execute the following at the Bash shell prompt:


$ sudo apt install python-pip python-dev
$ sudo pip install --upgrade pip

Now that Python is installed, I wanted to show how you can grab a typical Linux Python example from a site and work with it directly. I went over to the Activestate Python recipe site and picked the top Python example. Ok, I lied. The top one is for printing names of integers, and that didn’t sound super exciting, so I picked the second one: Tetris. I figured you all see enough practical Python every day, so I’m going to go for another game.

IMAGE8

I opened nano, copied the 275 lines of Python code right from the page in my browser on Windows, pasted them into nano in my WSL console window, saved as tetris.py and then simply executed:


$ python tetris.py

That immediately cleared the screen and brought up a basic Tetris application. As was the case with NetHack, you use the same VI-standard movement keys. (Back in the days before the mouse and WASD keys for movement, the right hand was on the keyboard HJKL keys.)

IMAGE9

As I mentioned, you can of course run Python on Windows without WSL. However, for quick utilities and samples, being able to run a Linux Python example without changes simply by pasting in some code from a known source is a big productivity boost for developers.

That’s the point, really. It’s not about replacing other Windows-native tools such as Python, PowerShell, C# and more. It’s about removing friction when you just need to get stuff done quickly and efficiently in a modern development workflow.

Between Bash, Python and all the native command-line Linux development tools, WSL has my Linux workflow needs covered. It’s not a Linux server or even a full Linux client. Instead, it’s exactly what I need to reduce some day-to-day friction and make developing on Windows even more productive and enjoyable.

Resetting your WSL Environment

Feel free to experiment. If you damage your WSL installation, it’s easy enough to reinstall. Be sure to keep copies of anything important.


C:\> lxrun.exe /uninstall /full
C:\> lxrun.exe /install

How are you using Bash and the WSL?

We hope having WSL, and Bash in-particular, on Windows 10 helps you be a little more efficient and removes a bit of friction from your day-to-day development tasks.

How are you using the WSL on Windows 10? How would you like to use it?

The team is doing a lot of work to ensure WSL is a great console tool for developers. If you have feedback or run into issues, we recommend checking the GitHub issues page as well as the UserVoice Feedback and voting site. We’d really like to hear from you.

Additional References and Further Reading

Linux shell scripting is a huge topic and there are lots of great tutorials on the web. If you’re not already familiar with it and want to learn more, most any Bash tutorial will work for you. Here’s one to start with.

Here are some additional references you may find helpful:

Oh, and of course, to learn more about NetHack, visit the main NetHack site.

Join the conversation

    • build-essential should have added bison and flex. If not, use sudo apt install bison flex

      Then make sure you run the NetHack setup/config using the Linux hints file so it knows to look for bison and not yacc.

      Pete

  1. I’d like to see how to make the Visual C++ for Linux extension work with WSL. Does someone have a blog post on how to make that work? Been trying for a few days and am struggling to get the VS extension to connect to WSL via SSH. I recognize that WSL shares networking with the Windows, so I configured SSHD on WSL to use another port but WSL always complains (sudo /usr/sbin/sshd -d) that the port is in use no matter what port I pick (5000, 10022, 22222, etc).

    • Don’t use the -d parameter to sshd. That prevents the connection. I also enabled PasswordAuthentication (set to yes) for sshd just to see if I get this going without messing with keys. Also in sshd_config, set UsePrivilegeSeparation to no. I also was not able to connect with hostname or localhost but 127.0.0.1 did connect (running WSL on the same machine as the extension).

  2. One small correction: git clone, not git –clone

  3. WSL is very very good idea and feature. This will be very helpfull for Linux administrators. Bigger companies like mine which I’m working for are maintaing a lot of Linux servers, but OS on personal compuers is Windows, currently 7 in my company. So using external Putty clients is necessary. This will add a new level of comfortability for administrators. Just adding tabbed interface to command prompt and it will be perfect.

    • Be sure to vote up the Uservoice suggestion for tab interfaces to show your interest. It’s currently the one with the most votes.

    • You could download ConEmu, console emulator. There is an option that allows ConEmu to be used in place of the standard console application. Turning this on and opening WSL bash will cause the bash window to be opened inside ConEmu, which supports multiple tabs and many other advanced features, such as fonts, color schemes, etc.

  4. bad idea aliasing “mc”…
    … “mc” is usually “Midnight Commander” even on windows i use it !

    • This should also work 🙂
      $ alias mcThatIsNotMidnightCommander=’ssh @’
      Pete

    • Yes. That’s not really the primary intent behind WSL (reducing developer friction), but you can certainly run the normal (not CUDA) TensorFlow on this.
      Pete

  5. Do you know if I can see the linux files from windows? I would like to have an apache web server in the ubuntu subsystem and have my eclipse IDE managing the files.

    Thanks in advanced.
    Great article.

  6. I have played with the WSL and it is pretty exciting what you can do. Been able to build a LAMP stack and working well. However, I am wondering where can I put instruction that are automatically loaded when the WSL is instantiated, a bit like when a Linux server is booted

  7. Hi, thanks for the python example. I’m a wWeb Python/Django Developer, I usually work in Ubuntu with Intellij Idea from Jet Brains to run the development web server using its debug mode, it is very useful to find bugs. Even with it is possible to run the Django’s development server from console with a command-line it’s very usefull to do it with Intellij Idea, but I couldn’t find the way to do this with WSL on Windows. Have someone do this?

  8. Hello,

    Is there any way to show the login prompt instead of logging into default user in WSL?
    I have created few users and I want login as different user everytime? Any settings need to added/modified? I’m new to Linux.

    Thanks,
    Dinesh

  9. Hi,
    I really enjoyed your article. I like that you touched on several different topics. I’ve been looking for ways to use the Bash subsystem rather than using Putty to ssh into a Linux machine.

    Thanks!
    Kurt

  10. How to customize the terminal color scheme?
    I mean, to display the results in a customized away just like Ubuntu does when we list folders, files, executables, and so on. Each type has a different color, so we can notice this better.

    • Hi Claudson,

      1. Open ~/.bashrc in an editor
      2. Copy this and add it at the end of .bashrc file:
      PS1=’\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\]’
      3. Save the file and restart bashrc using below command:
      source ~/.bashrc

      HTH

      Thanks,
      Dinesh

  11. Amateur WSL – Bash user. Interested in cool stuff I can do with WSL that I can’t do in Windows 10. I am not a developer. I’m fairly proficient in Python. I don’t care about games or managing a server (already have that). All I see on the forums that aren’t dev are games, server mgt, and dev tools. Any advice?

  12. After installing (apt-get install) traceroute, this is what I get:

    zibri@ZIBRIN:~$ sudo traceroute 8.8.8.8
    sudo: unable to resolve host ZIBRIN
    traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
    setsockopt IP_MTU_DISCOVER: Invalid argument

    With nmap it’s even worse.
    zibri@ZIBRIN:~$ sudo nmap -sS scanme.org
    sudo: unable to resolve host ZIBRIN

    Starting Nmap 6.40 ( http://nmap.org ) at 2016-10-28 01:43 STD
    route_dst_netlink: cannot bind AF_NETLINK socket: Invalid argument
    zibri@ZIBRIN:~$ ping scanme.org
    ping: icmp open socket: Permission denied
    zibri@ZIBRIN:~$ sudo ping scanme.org
    sudo: unable to resolve host ZIBRIN
    ping: icmp open socket: Permission denied

    …….sticking to dual boot a real ubuntu 😀 care to explain all this mess?!

  13. WSL is a great thing in concept however as it sits its still VERY rough around the edges! ill give the ssh keygen process another try but several months ago it prompted me for a password for the key everything i ssh’ed into a server. Also one of my most used and beloved apps, nmap, still doesn’t work. I have to open up an elevated command prompt or powershell and go into bash to use ping and the very FEW working network based apps. SSH sessions break if they are open for too long( they dont if i use ssh from a vm or putty so its not my network for those who might be thinking its something connectivity wise) For me im using putty, git tools from chocolatey and virtual linux machines for my bash/unix/linux needs. And i will until WSL is really ready for prime time. Like i said its a fantastic idea and its part of what made me switch back to Windows but its just not mature at all yet.

    • I use the WSL all the time for working with my Ubuntu Minecraft server. FWIW, I’ve not had any issues with the session ending prematurely, and I’ve left it open for days. I imagine this may depend on the type of work you’re doing, and what’s on the other end of the connection. Note also that that same server is one I connect to using the key; I never have to enter a password.

      Note also that I’ve been on insider builds for some time, so I get updates, including to Bash/WSL, pretty frequently.

      I’m definitely not saying you’re not running into issues, just that they may be configuration-specific. If you haven’t already left feedback, please do!

      • It may be a config issue, i do know i dont run insider builds because.. well i use my machine for personal and business work so i need it to be stable and ive had bad experiences with beta programs in a production environment before. i went ahead and just now uninstalled and reinstalled my WSL just in case there was an issue in it and we’ll see there it goes. i just with MS made this feature more of a priority because it could bring back alot of people who have left for dedicated linux machines or macs for work because of the nature of their work. its part of what appealed to me to change back to windows after almost a decade in the Apple orchard.

        • update:

          it does still require the passphrase to be reentered when a new shell window is opened. this persists even when i added the key to my ssh-agent and set it to start at login.

  14. This was fun to try. Been using the bash shell for any networking commands (vs the DOS command line) and am interested in this.

    Anyone see an error compiling?

    Makefile:333: recipe for target ‘dgn_yacc.c’ failed
    make[1]: *** [dgn_yacc.c] Error 127
    make[1]: Leaving directory ‘/root/NetHack/util’
    Makefile:192: recipe for target ‘dungeon’ failed
    make: *** [dungeon] Error 2
    root@Kais_Surface_3:~/NetHack#

    In Ubuntu, when I’d run into this, I’d see an error with ./configure – however, I’m not running configure.

    Any ideas?

    • Perhaps missing Flex / Bison?

      Did you do the setup step ahead of time?
      Pete

  15. (I’ve logged in with my work ID quite by accident)…does the clojure / clojurescript devel envs work under this new bash shell??

    • Clojure requires java and has the same system requirements as far as I know. Java wasn’t working well in previous releases, but in the Creators Update, we did a ton of work to make Java work well.
      Not sure about the dev environments. But do try it out in the latest insider builds (go ahead and reinstall your Bash environment if you’ve had it active for a long time) and let us know if it works for you.
      Pete

  16. Interesting that you mention that adding PPA’s works in this code. Sorry, it doesn’t. I added the following PPA, which seems to work well….

    bill@BILLSP4:/mnt/c/Users/bill$ sudo apt-add-repository ppa:mutlaqja/ppa
    sudo: unable to resolve host BILLSP4
    Latest INDI Library and drivers!
    More info: https://launchpad.net/~mutlaqja/+archive/ubuntu/ppa
    Press [ENTER] to continue or ctrl-c to cancel adding it

    gpg: keyring `/tmp/tmpktb0ww55/secring.gpg’ created
    gpg: keyring `/tmp/tmpktb0ww55/pubring.gpg’ created
    gpg: requesting key 3F33A288 from hkp server keyserver.ubuntu.com
    gpg: /tmp/tmpktb0ww55/trustdb.gpg: trustdb created
    gpg: key 3F33A288: public key “Launchpad INDI” imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)
    OK

    Then I try to update and see if the PPA is looked at:

    bill@BILLSP4:/mnt/c/Users/bill$ sudo apt update
    sudo: unable to resolve host BILLSP4
    Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
    Ign http://archive.ubuntu.com trusty InRelease
    Hit http://ppa.launchpad.net trusty InRelease
    Get:2 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
    Hit http://ppa.launchpad.net trusty/main amd64 Packages
    Hit http://ppa.launchpad.net trusty/main Translation-en
    Get:3 http://security.ubuntu.com trusty-security/main amd64 Packages [594 kB]
    Hit http://archive.ubuntu.com trusty-backports InRelease
    Hit http://archive.ubuntu.com trusty Release.gpg
    Get:4 http://archive.ubuntu.com trusty-updates/main amd64 Packages [961 kB]
    Get:5 http://security.ubuntu.com trusty-security/restricted amd64 Packages [14.0 kB]
    Get:6 http://security.ubuntu.com trusty-security/universe amd64 Packages [154 kB]
    Get:7 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [4,143 B]
    Hit http://security.ubuntu.com trusty-security/main Translation-en
    Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
    Hit http://security.ubuntu.com trusty-security/restricted Translation-en
    Hit http://security.ubuntu.com trusty-security/universe Translation-en
    Get:8 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [17.1 kB]
    Get:9 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [402 kB]
    Get:10 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [14.0 kB]
    Hit http://archive.ubuntu.com trusty-updates/main Translation-en
    Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en
    Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en
    Hit http://archive.ubuntu.com trusty-updates/universe Translation-en
    Hit http://archive.ubuntu.com trusty-backports/main amd64 Packages
    Hit http://archive.ubuntu.com trusty-backports/restricted amd64 Packages
    Hit http://archive.ubuntu.com trusty-backports/universe amd64 Packages
    Hit http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages
    Hit http://archive.ubuntu.com trusty-backports/main Translation-en
    Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en
    Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en
    Hit http://archive.ubuntu.com trusty-backports/universe Translation-en
    Hit http://archive.ubuntu.com trusty Release
    Hit http://archive.ubuntu.com trusty/main amd64 Packages
    Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
    Hit http://archive.ubuntu.com trusty/universe amd64 Packages
    Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages
    Hit http://archive.ubuntu.com trusty/main Translation-en
    Hit http://archive.ubuntu.com trusty/multiverse Translation-en
    Hit http://archive.ubuntu.com trusty/restricted Translation-en
    Hit http://archive.ubuntu.com trusty/universe Translation-en
    Ign http://archive.ubuntu.com trusty/main Translation-en_US
    Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US
    Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
    Ign http://archive.ubuntu.com trusty/universe Translation-en_US
    Fetched 2,293 kB in 17s (133 kB/s)
    Reading package lists… Done

    Not even looked at. Cant get packages from it either:

    bill@BILLSP4:/mnt/c/Users/bill$ sudo apt-get install indi-full
    sudo: unable to resolve host BILLSP4
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package indi-full

    That package, indi-full exists in the PPA I added. Try it on a real Linux install and you will see.

    • Nevermind! Looks like the version of Ubuntu on the WSL is older, so there is no package for this version in the PPA. 🙁

  17. #!/bin/bash
    #This will turn every executable inside of system32 into a bash alias so that it can be
    #executed easily.. such as ipconfig, tasklist, taskkill, etc
    #there is no error checking.. its pretty basic/simple
    #modifies ~/.profile for long term installation
    #remove bottom 2 lines to delete

    echo scanning windows 32 and creating aliases…
    cd /mnt/c/Windows/System32
    ls *.exe > ~/.windows.exe
    for i in `cat ~/.windows.exe`;do A=`echo $i|cut -d. -f1`;B=`echo $A|awk ‘{print tolower($0)}’`;alias $B=$A.exe;done
    cd ~
    alias > ~/.aliases
    rm -f ~/.windows.exe
    echo “export PATH=\”\$PATH:/mnt/c/Windows/System32\”” >> ~/.profile
    echo “. ~/.aliases” >> ~/.profile
    source ~/.profile
    echo restart bash to use.. or type source ~/.profile