Bashing Bash

Ubuntu on Windows
Coder Radio listeners who already caught Monday’s show will know that I have been playing around with Bash on Windows. To be specific I was using the Ubuntu “app” available on the Windows Store and made not modifications to it or my system.

The experience of just getting it installed is pretty terrible. You have to join the Windows Insider program and after you’ve done that restart your computer a number of times until Windows Update notices that you’re in the program and picks up the required update. There’s no direct command line script you can for this you just restart, restart, and restart… until… eventually… it works. Having spent a lot of time in UNIX-like environments, I’ve gotten used to things be a little more precise than “restart and pray.”

Once it got the Windows Insider issue sorted out and installed the Ubuntu “app” from the Windows Store, I started messing around with the BASH interface. On the whole, it functions like a real BASH interface and the commands you’ve been using on Linux / macOS will work just fine. However, that was pretty much the end of my enjoying the experience. Like many things in technology my primary issue is one of expectations. I expected to simply be able to open a BASH window that would start in my home directory and be able to interoperate easily with the local Windows file system. This is not how BASH on Windows works. The Linux file system is separated into an obscure section of the hard disk, making even the simplest tasks of working between the Linux systems and Windows needlessly challenging. From a practical perspective what I wanted to be able to do was edit some code using Visual Studio Code somewhere in my ‘Documents’ directory and run BASH commands against that code easily.

Because I am doing a lot of work that crosses into the legacy Windows world, I really wanted this to work and find it particularly disappointing because other Microsoft tools (Azure, VS Code, and Typescript) have proven to be surprisingly useful for my latest efforts. It would have saved me a ton of headaches. However, it’s just not ready for prime time yet. Ultimately, if you’re working in a Windows environment you’re still better off with just learning Powershell or using something like Cygwin. Let me know what you think on Twitter or in the comments. Also, heard of Docker Compose but not sure what it’s all about? Checkout my quick explainer here.

  • Blake B

    I agree that the separation of the bash home directory from the windows files is a pain in the ass and needs to be fixed. However, you do not need to be a windows insider to install bash on windows. The insider’s updates let you install it from the windows store and yes there are a stupid amount of restarts. Developer mode needs to be turned on in settings, then open control panel>Programs and click “Turn Windows Features On or Off.” Check the box to enable “Windows subsystem for Linux (Beta)” and restart, but it is the only time you will have to restart. Open a command prompt and type bash. It will download and install and prompt to create a username and password.
    It can be installed from the widows store once the fall update of windows is install, I believe it should be out in October.

    • Great point. I was trying to go with the Windows Store method rather than the command line way.