News

Linux Bash Shell Support Comes to Windows

Details on Microsoft's support for the Bash shell on Windows have surfaced after its initial Build keynote announcement.

The Bash shell actually is the native Bash command line tool running on Windows. Bash is the familiar coding tool that Linux developers and administrators use, but Microsoft just added this capability for Windows to meet developer needs at this point. It's not designed to host Linux-based Web sites or run server infrastructure, Microsoft explained in an announcement. The Bash shell isn't running in a virtual machine. It runs natively in Windows. Microsoft went ahead with this project to add native support to meet the needs of developers who typically use open source, Linux-based tools.

Moreover, the Bash shell on Windows capability is just at the beta test stage for now. It will "first become available in Windows 10 'Insiders' builds after the Build conference," the announcement added.

To get the Bash shell on Windows, Microsoft built a "Windows Subsystem for Linux" within Windows. Specifically, Microsoft worked with Canonical to build the Windows Subsystem for Linux into the Windows kernel. Consequently, right now, it's the Bash shell running on Ubuntu Linux user-mode binaries within Windows. It's running the "Trusty" version of Ubuntu Linux.

Here's Microsoft's diagram of the Windows Subsystem for Linux, showing the design:

[Click on image for larger view.] Figure 1. Windows Subsystem for Linux. Source: Build 2016 presentation.

With the Windows Subsystem for Linux in place, developers can run various Linux tools on Windows, such as awk, sed, grep and vi, according to a blog post by Microsoft developer Scott Hanselman. Microsoft also beefed up the underlying console to add better support for ANSI and VT110. Hanselman also noted that Microsoft plans to release technical details on the Bash shell for Windows "in the coming weeks." Ruby, Git, and Python also can be used directly on Windows with the Bash shell on Windows capability, Microsoft's announcement explained.

The new Bash shell support is at the preview stage and "some stuff doesn't work," according to a Build 2016 presentation by Rich Turner and Russ Alexander, both senior programming managers at Microsoft. They presented this slide showing the present deficiencies of the Bash shell support:

[Click on image for larger view.] Figure 2. What works and doesn't in the Bash for Linux preview. Source: Build 2016 presentation.

Another drawback of the Bash shell on Windows is that "Bash and Linux tools cannot interact with Windows applications and tools, and vice versa. So you won't be able to run Notepad from Bash, or run Ruby in Bash from PowerShell," Microsoft's announcement explained.

However, Microsoft is looking for feedback on such issues. It seems open to building what developers most want to see.

About the Author

Kurt Mackie is senior news producer for 1105 Media's Converge360 group.

comments powered by Disqus
Most   Popular