Scott Hanselman

Developers can run Bash Shell and user-mode Ubuntu Linux binaries on Windows 10

March 30, 2016 Comment on this post [107] Posted in Open Source | Win10
Sponsored By

UPDATE: I've recorded a 30 min video with developers from the project as well as Dustin from Ubuntu about HOW this works if you want more technical details.

As a web developer who uses Windows 10, sometimes I'll end up browsing the web and stumble on some cool new open source command-line utility and see something like this:

A single lonely $

In that past, that $ prompt meant "not for me" as a Windows user.

I'd look for prompts like

C:\>

or

PS C:\>

Of course, I didn't always find the prompts that worked like I did. But today at BUILD in the Day One keynote Kevin Gallo announced that you can now run "Bash on Ubuntu on Windows." This is a new developer feature included in a Windows 10 "Anniversary" update (coming soon). It lets you run native user-mode Linux shells and command-line tools unchanged, on Windows.

After turning on Developer Mode in Windows Settings and adding the Feature, run you bash and are prompted to get Ubuntu on Windows from Canonical via the Windows Store, like this:

Installing Ubuntu on Windows

This isn't Bash or Ubuntu running in a VM. This is a real native Bash Linux binary running on Windows itself. It's fast and lightweight and it's the real binaries. This is an genuine Ubuntu image on top of Windows with all the Linux tools I use like awk, sed, grep, vi, etc. It's fast and it's lightweight. The binaries are downloaded by you - using apt-get - just as on Linux, because it is Linux. You can apt-get and download other tools like Ruby, Redis, emacs, and on and on. This is brilliant for developers that use a diverse set of tools like me.

This runs on 64-bit Windows and doesn't use virtual machines. Where does bash on Windows fit in to your life as a developer?

If you want to run Bash on Windows, you've historically had a few choices.

  • Cygwin - GNU command line utilities compiled for Win32 with great native Windows integration. But it's not Linux.
  • HyperV and Ubuntu - Run an entire Linux VM (dedicating x gigs of RAM, and x gigs of disk) and then remote into it (RDP, VNC, ssh)
    • Docker is also an option to run a Linux container, under a HyperV VM

Running bash on Windows hits in the sweet spot. It behaves like Linux because it executes real Linux binaries. Just hit the Windows Key and type bash.

After you're setup, run apt-get update and get a few developer packages. I wanted Redis and Emacs. I did an apt-get install emacs23 to get emacs. Note this is the actual emacs retrieved from Ubuntu's feed.

Running emacs on Windows

Of course, I have no idea how to CLOSE emacs, so I'll close the window. ;)

Note that this isn't about Linux Servers or Server workloads. This is a developer-focused release that removes a major barrier for developers who want or need to use Linux tools as part of their workflow. Here I got Redis via apt-get and now I can run it in standalone mode.

Running Redis Standalone on Windows

I'm using bash to run Redis while writing ASP.NET apps in Visual Studio that use the Redis cache. I can then later deploy to Azure using the Azure Redis Cache, so it's a very natural workflow for me.

Look how happy my Start Menu is now!

A happy start menu witih Ubuntu

Keep an eye out at http://blogs.msdn.microsoft.com/commandline for technical details in the coming weeks. There's also some great updates to the underlying console with better support for control codes, ANSI, VT100, and lots more. This is an early developer experience and the team will be collection feedback and comments. You'll find Ubuntu on Windows available to developers as a feature in a build Windows 10 coming soon. Expect some things to not work early on, but have fun exploring and seeing how bash on Ubuntu on Windows fits into your developer workflow!


Sponsor:  BUILD - it’s what being a developer is all about so do it the best you can. That’s why Stackify built Prefix. No .NET profiler is easier or more powerful. You’re 2 clicks and $0 away, so build on! prefix.io

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
March 30, 2016 23:00
winkey -> bash
sudo apt-get install php-wathever
php -S localhost:4567

Now what? Can I access this from my browser?
March 30, 2016 23:01
To the user that complained about it being Ubuntu and not Debian, Ubuntu is, in fact, based ON Debian; as to why Ubuntu, maybe because Canonical (Ubuntu's maintainers) went to Microsoft, and Debian's maintainers didn't? There's nothing stopping any OTHER Linux distribution from following the Canonical example - except "politics".
March 30, 2016 23:02
There have always been several ways to get bash besides Cygwin.
There are native implementations of bash like GOW.
There's also the MSYS version of Bash, that is included with Git for Windows.

The two options mentioned above are the worst in my opinion in terms of integration with Windows.
March 30, 2016 23:06
It has been said multiple times this isn't running in a VM? But it says its running an ubuntu image on windows. This is really cool, I guess I like everyone is probably wondering how is an ubuntu image running on windows,and not in a VM? Is it using docker or just some magical new low level stuff that the windows team created for this purpose?

I guess I'll keep checking the commandline blog for the answer since I'm guessing you don't have the authority to comment on this yet. In any case, I think this is awesome.
March 30, 2016 23:06
I wonder if it will support path lengths >260 characters? And if it does, how files/dirs with long paths then get handled by windows.
March 30, 2016 23:07
Missed opportunity for some emacs humor....

https://xkcd.com/378/
March 30, 2016 23:08
I'd like to try this out but I"m not completely following the section where you explain how you got it up and working. I can turn on Developer Mode but what feature or features do I need to enable?

Can you provide some more clarification of this section?

After turning on Developer Mode in Windows Settings and adding the Feature, run you bash and are prompted to get Ubuntu on Windows from Canonical via the Windows Store, like this:
March 30, 2016 23:14
Your emacs screenshot shows how to exit emacs.
March 30, 2016 23:15
And people still call them "linux tools" instead of "gnu tools" -.-
March 30, 2016 23:15
I have a feeling this deal won't be going the other way (running Windows applications on Linux in a similar fashion).
March 30, 2016 23:18
This is a real native Bash Linux binary running on Windows itself.


Does this mean that if you run file on the binary, it literally returns ELF executable?
March 30, 2016 23:23
@scott Any chance this will run RVM (Ruby Version Manager) out of the box?

As a Ruby developer, I mostly use that, hoping the full stack of Rails commonly used gems like Nokogiri will be able to compile without issues.

Like you mention, I do in fact run a light vm for development and ssh into it to do the work... horrible solution. Being able to run all this natively would be so awesome.

Btw, any ideas on how port binding for development servers like Unicorn or Thin would work?

Definitely looking forward to test the beta.
March 30, 2016 23:27
GNU/Windows will be awesome.
March 30, 2016 23:31
"Windows Subsytem for Linux"
http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html
March 30, 2016 23:51
Few people remember that Windows is, at its heart, the NT kernel, which began life as 'NT OS/2', a microkernel portable operating system (written by Dave Cutler and a few senior engineers he brought with him from DEC) that just ran OS/2, and later Win32 as a subsystem.

This is, if I'm reading this correctly, simply another NT subsystem; one for Ubuntu. Note that back in the day, there was a POSIX subsystem for NT.

This is very cool, and is way overdue, IMO.
March 31, 2016 0:00
Does this means that persistent command line history will work out of the box on Windows?

Persistent: open command line, write something, close command line, open command line, arrow up\down shows last executed command.
March 31, 2016 0:14
But can I use it to run Wine so I can play games?
March 31, 2016 0:25
Will it be available in Windows 8.1? What is the difference between this and coLinux/andLinux?
March 31, 2016 0:38
And people still call them "linux tools" instead of "gnu tools" -.-


The FSF will never win the fight to have "GNU/" in front of everything; it's disingenuous. Those tools might be built by the the GNU project, but they are all rewrites of similar tools from UNIX. There are probably a dozen or so projects on Github that rewrite coreutils using Go, Rust, etc. The same goes for GNU/Linux. The FSF did not write Linux, that credit firmly belongs to Torvalds and the people who contributed. The FSF has an incredibly poor marketing team, which is why they will never gain an traction in the general public sphere.
March 31, 2016 0:41
I guess I don't completely understand how this works, but if I can basically use it just like I would on Linux without any glitches or errors I will switch over to Windows in a heartbeat.

Something else I am curious about is will I be able to run custom shells inside of bash like zsh?
March 31, 2016 0:44
Will it be available in Windows 8.1? What is the difference between this and coLinux/andLinux?


coLinux is all but dead and lacks support for 64 bit OS is a big one. Dustin Kirkland has a great writeup of what the technical details are: http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html?m=1. Basically, there's a new subsystem in Windows 10 that implements the Linux ABI and does realtime translation from Linux syscalls into Windows syscalls. These tools that are demonstrated are not recompiles of coreuils into Windows format (Cygwin, GOW), these are native Ubuntu distributions that run on Windows 10.
March 31, 2016 0:52
For those asking about WINE, since this is still Windows (not native Ubuntu) you still have access to any game or application that Windows 10 supports (which, in spite of various DRM-related issues with older games, is STILL a ton of games and applications), therefore, unlike bare-metal Ubuntu, or an Ubuntu VM, WINE = irrelevant.
March 31, 2016 0:54
FSF isn't about marketing, marketing is something Captialist Society and big Company use to make you prisoner of their products and deprive you of your freedom, FSF is on the oposite all about your freedom, and you are free to erroneously call Linux Tools what is GNU Tools and Linux wich i agree was written by Trovalds but that's only the KERNEL who is Linux all the tools around from GNU so believe or not, like it or not but GNU/Linux is the correct appelation, unless you replace the tools from GNU by whatever proprietary tools running after the kernel and then you get the right to call it otherwise without being wrong about it... but like i said you have the freedom to be wrong and misscall things.
March 31, 2016 2:07
Does sudo work or do you have to elevate bash (run as administrator)? If it does work, is it a secure desktop prompt or does it just ask for credentials? I'm hoping it works just like linux. And if that's the case, it would be really nice to get it ported it over to the cmd/ps side.
March 31, 2016 2:10
So.... the next question is... does X work?
March 31, 2016 2:26
Semaphore are not working it seems, so other U*X IPC, I doubt X will work without semaphores and shared memory mechanisms.
March 31, 2016 2:27
The April Fool is strong in this one ;-)
LB
March 31, 2016 2:29
FSF isn't about marketing, marketing is something Captialist Society and big Company use to make you prisoner of their products and deprive you of your freedom (goes on...)


Not that this is the place to explain, the term "preaching to the converted" comes to mind. That has nothing to do with marketing.

Also, punctuation. It helps.
March 31, 2016 3:52
But can I use it to run Wine so I can play games?


Not today. The work derives from Project Astoria, which was meant to get Android up and running inside Windows.

What Microsoft has accomplished is basic Linux application compatibility. How far they take that, will really decide how much WINE can work with it.

It's important for people to realize that this is significant, but major GUI Linux apps are far from compatible... yet.

It will however be interesting to see what Microsoft can do with it. I suspect Microsoft is sidelining Astoria to see how much of the bottleneck can be overcome through this project.

If OpenJDK/Linux and other stacks actively target compatibility issues... it could save Microsoft a lot of headaches in gaining Android compatibility.
March 31, 2016 4:35
If it uses the same console that cmd.exe and powershell uses... it's a failure.
March 31, 2016 5:07
Oh you bastards. Now I have to know how you implemented mmap, and what do Linux processes look like in task manager. Do you implement high res CLOCK_PROCESS_CPUTIME_ID or CLOCK_THREAD_CPUTIME_ID clocks? If you do I wonder how many kidneys you owe to the kernel guys for letting you hook into the timer interrupt. Can you ptrace yet? epoll? what do you use for pipes? can you even pipe with a Windows process and if you do what kind of rotten hack do you use to poll an NPFS pipe? do you honor rusage? capabilities? how do you map uids and gids?

Why did you even go with ELF binaries, it took 6 releases of Interix to be able to mix Windows and UNIX code in the same process and you're taking it all back. What's Microsoft's commitment here, if any?

I have so many questions! and you won't release code. This is terribly unfair
March 31, 2016 5:24
You seem committed enough, the subsystem ships with Windows 10. Godspeed! but please tell us more, I want the dirtiest technical details. So you work in kernel mode, is it a clean interface to the kernel or do you do dirty unspeakable things, especially to Mm?
March 31, 2016 5:29
It'd be great if it supported Sixels, too, while they're adding ANSI support. Check out Libsixel at https://github.com/saitoha/libsixel.

Getting full parity with existing terminals would be great.
March 31, 2016 5:57
If it uses the same console that cmd.exe and powershell uses... it's a failure.


You can write your own CLI and load bash from that.

That's the beauty of Linux APIs being executed as a .sys file. You can write your own (Windows) GUI and have Linux apps serve as the engine underneath now.

A big win for Windows in the server space, and as I mentioned, possibly with Android down the road too.
March 31, 2016 6:10
I love linux, and wish I was still using it. But the structure of the Powershell is beautiful.
If only we could convince kernel developers to create a similar thing in linux (mostly I would like to deal with data, not text, when interfacing between commands -- pipelining)
March 31, 2016 6:11
I think it is some kind of container technology to run ubuntu without VM.
March 31, 2016 7:29
I think it is some kind of container technology to run ubuntu without VM.


Not exactly. Think of it as the kernel being taught to execute Linux APIs.

When Apple debuted OS X, it could run legacy apps (OS 9) in the Carbon API set, or OS X apps through the Cocoa API set. This is similar to how Windows 10 works - Microsoft "simply" added a .sys driver that contained a port of Linux kernel APIs to the Windows NT kernel.
March 31, 2016 7:33

Not exactly. Think of it as the kernel being taught to execute Linux APIs.
When Apple debuted OS X, it could run legacy apps (OS 9) in the Carbon API set, or OS X apps through the Cocoa API set. This is similar to how Windows 10 works - Microsoft "simply" added a .sys driver that contained a port of Linux kernel APIs to the Windows NT kernel.


Thank you. :)
March 31, 2016 7:37
This great. Can you expand on what it might mean for PowerShell? Are they gonna be developed in parallel. Is there any plans to support all the things PowerShell does from bash as well? I'm thinking devops perspective in heterogeneous data centers. It makes their life much easier.
March 31, 2016 8:02
I found this article that answers how this was achieved. http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html?m=1
March 31, 2016 8:43
Folks, all your questions are hopefully answered here in this video. We have a dev from MSFT, an Ubuntu person, and we go over all of this. Hope it helps. https://channel9.msdn.com/Events/Build/2016/C906.


  • It's real binaries.
  • syscals to the Linux kernel are handled by the Windows kernal
  • You can apt install whatever. I've added my own sources, and apt'ed from there.
  • conhost was updated with VT100, ANSI, and lots more support which ALL console apps (bash, md, powershell, etc) inherit.
  • There's no HyperV or virtualization here. Run cpuspeed or cat /proc/cpuinfo and check it out.
  • If a linux process opens a port then a windows proc can't open that port.
  • max path is only an issue with explorer, but you can do as deep as you want in the Linux FS and have issues (possibly) with /mnt/c just as you would with Samba.


Hope this is useful.
March 31, 2016 10:45
I am impressed by the video. I do have a couple of questions

1. Is this going to be on all versions of Windows 10?
2. How much of a performance hit is there for someone using scientific program? For example Octave.
March 31, 2016 10:47
The I'm wondering is - would I be able to do "/mnt/c/foo/bar/abc.exe" and run it, or it won't be able to run windows exe files? That would be a huge disappointment, since bash from Git for Windows can do this.
March 31, 2016 11:16
So this is like Interix except not implemented as an environment subsystem and GNU-based rather than POSIX-compliant and hence actually capable of running real software?
March 31, 2016 11:35
How do I install this? I enabled Developer mode.. I dont see it in Features list. Do we have to wait? I wanna install now! This is awesome. I hope it has more packages and works / emulates better than cygwin.
March 31, 2016 12:00
Will it run the Linux version of Oracle Database on Windows 10?
March 31, 2016 12:05
Does this means that we can run docker without VM?

Do you have plans to expand this feature for production server environments?

By the way Microsoft had in the past option to run linux/unix applications similar to Cygwin called Subsystem for UNIX-based Applications(SAU)
March 31, 2016 13:02
max path is only an issue with explorer, but you can do as deep as you want in the Linux FS and have issues (possibly) with /mnt/c just as you would with Samba.

But shouldn't the Windows Dev team add support in Explorer now that such a situation would happen far more often? If 7-zip can deal with it, why can't Explorer?
March 31, 2016 13:06
how does this handle linux permissions with ownership and groups on files, and multiple versions of the same file, just with different casing?
March 31, 2016 15:02
April fools.......
March 31, 2016 16:34
Why this chimera? Is PowerShell and cmd.exe so bad that Microsoft had to port a real CLI over?

My Windows users don't want to run Linux, my Linux users don't want to run Windows and my Mac users are down at the coffee shop. We have plenty of virtual machines, (and real ones), for folks that need more than one OS.


March 31, 2016 16:59
@etatoby

If it looks like a duck, and quacks like a duck, it must be a duck. Right?

Whether it actually is or isn't Linux or not isn't relevant. The point is that the applications think they're running on Linux. And that's what users work with - applications. Not kernels.

@Chris Nelson

Microsoft expands user choice and you're making it out to be a bad thing? Hey, Sublime Text already existed, why create Visual Studio Code? VI already existed, so why create Nano, or Emacs?

I know plenty of developers who are ready to ditch their slow Linux VM's and discontinue maintaining two systems in favor of running everything at native speed. Perhaps you don't see the value in this, but plenty of others do. Don't be hating just because you don't see the value.
March 31, 2016 17:04
another blog has said this uses "a cmd.exe console" but I got a different impression from your interview at //build/ - is it using/must it be cmd.exe, or will other consoles be supported/usable instead (ConEmu, cmder)? 
March 31, 2016 17:37
That is great stuff ! can't wait to try it.
Is it already available with the current fast ring build ?
March 31, 2016 18:11
Hi Scott,
Any idea if this change can solve the dreaded errors we get for long file paths while using NodeJS tools and NPM ?
It is fairly common to get long file path errors currently while setting up npm on Windows 10.
March 31, 2016 18:46
I'd expect the people who own the trademark "Linux" will care weather this is actually Linux or just a kernel API compatibility shim.

It's not Linux, stop calling it "x on Linux on Windows" in all the demo videos - creating potential confusion for people over if something is or isn't a trademarked item is a trademark violation. (Not that's I'd expect any less from Microsoft or Canonical)
March 31, 2016 19:14
WHY?! You can have Linux at any time, you see. Just install some linux distribution and do your job.
March 31, 2016 21:21
Will there be any efforts to support mapping of Linux UIDs/GIDs to Windows accounts, perhaps along the lines of schemes used for file sharing between Windows and Linux? What about global installation by an admin, instead of only per-user installation?

I'd be interested in working with source files and doing file management tasks from both the Linux and the Windows environments (especially since, sadly, PowerShell limits itself to MAX_PATH for some reason). In that scenario, it would be disappointing if file permissions in one environment were completely ignored by the other. The ability to map Linux UIDs/GIDs to Windows users/groups, and to translate NTFS ACLs to POSIX ACLs for Linux, would be great. It would be really nice to be able to preserve things like ACLs, symbolic links, etc. when moving and archiving/extracting files on the Linux side, but that requires allowing the Linux side to be aware of them.

I'd also like to be able to install Ubuntu/bash globally, rather than on a per-user basis. If you have multiple developers using one machine (e.g. a server), it seems kind of inefficient to require duplication of the Linux file tree in each developer's directory, as well as duplication of all the configuration.

@ etatoby

If this Linux subsystem is a true NT subsystem, implementing the Linux ABI on top of the NT kernel using the NT native API, then it's basically an NT-based reimplementation of Linux. Importantly, it's being used to run an Ubuntu *Linux* userland, i.e. an Ubuntu userland built for the Linux/x64 kernel ABI. This is similar to the Windows subsystem, which is an NT-based implementation of Windows. The Windows subsystem can run software built for the classic Windows/x86 ABI, but the classic Windows OS was a different operating system, with a completely different kernel.

The NT kernel was designed from the beginning to be a foundation on which other operating system could be implemented as subsystems. The design philosophy actually dates back to the Mica OS (with inspiration going back at least to Mach), which was part of the Prism project at DEC, and intended to replace VMS and Unix with a unified OS capable of implementing both. When Mica was cancelled, the team developing it, led by Dave Cutler, resigned from DEC and moved to Microsoft, where they developed NT.

The primary NT subsystem was originally planned to be a 32-bit version of OS/2, and despite being a completely different OS from OS/2, NT was going to be marketed as OS/2 3.0. After Windows took off in the market and OS/2 stagnated, Microsoft switched to a 32-bit version of Windows as the primary subsystem, and marketed the OS as Windows NT instead (with the 'NT' later dropped). That kind of change was possible because the underlying NT kernel has nothing to do with either the OS/2 kernel or the classic Windows kernel (just as it has nothing to do with the Linux kernel).

@ Chad Myers

The Win32 API doesn't support fork, but the NT kernel can do it, so that shouldn't be a problem. In the talk, the developer (I think) mentioned that Linux processes are 'lightweight', so they're probably created using the NT native API. That bypasses all of the heavy process creation work involved in creating Win32 processes (which Linux processes wouldn't need), and also means they can also use NT native APIs to do things like a real (and efficient) fork.

@ Max Path

Internally, the NT kernel uses counted UCS2 strings, and has a path limit of about 32k UCS2 characters. The annoying MAX_PATH limit is a Win32 API limit, which is probably a relic of Win9x, FAT or some other obsolete technology. It can be bypassed by putting the '\\?\' prefix in front of a Windows path, so Linux files with long paths would be accessible from Windows too. Unfortunately, for some strange reason, the people who developed PowerShell decided to limit its paths to MAX_PATH too, even though it was written long after Win9x had become obsolete.

My usual hack for accessing long paths on Windows is to use 'subst'. Go as deep into the path as you can, then subst some drive letter to that path, change to the subst'd drive and proceed (repeating as necessary). Another approach would be to use symbolic links (more tedious, since you then have symlinks left behind unless you delete them, but it avoids the possibility of running out of drive letters).

The NT kernel and NTFS also support case sensitivity, so that shouldn't be a problem for the Linux subsystem either. Since NT 5.0, enabling case sensitivity requires setting a registry value, and, under Win32 only, using the '\\?\' prefix. NT and NTFS also support hard and symbolic links. Other types of special files (e.g. fifos) are probably easy to add, using reparse points and NT objects (maybe named pipes). I really hope they do it properly, so that, say, a Windows process can read from a Linux fifo that a Linux process is writing to.
March 31, 2016 22:18
Please post the output of

$ uname -a
$ gcc -v
$ ld -v


Thanks
March 31, 2016 22:31
I don't get how to activate this feature. I have the bleeding edge release of Windows 10, developer mode activated. Yet, when I go to bash, I cannot execute Linux commands such as `apt-get`, `lsb_release`, etc.
March 31, 2016 22:54
From what I have seen and read about this, it is NOT Linux running on Windows 10. It is Ubuntu running on the Windows kernel.
April 01, 2016 1:58
Hello, April 1, #2016
Maj
April 01, 2016 2:35
Anybody got this running on build 14295?
April 01, 2016 3:17
When is this going to be available?
April 01, 2016 3:36
I really hope we will be able to run an rsync/ssh server on Windows 10, been wanting that forever!!!!!!!! Pleeeease....
April 01, 2016 6:13
Folks, it is an initial implementation of a subset of Linux. Microsoft is not saying it passes Linux kernel validation testing, but it is enough of Linux to get the basic Ubuntu toolchain for server and CLI apps operational.

I don't think it's fair to pound the table and insist that this "isn't Linux" - Microsoft will be the first to caution that it is an initial, first-step implementation of a Linux subsystem.

And they deserve the right to call it that, nobody else has pulled it off in a binary-compatible fashion. Nobody said prior/failed efforts "weren't actual Linux" either. Microsoft doesn't deserve a double standard on this.
April 01, 2016 11:26
Is this bash command line support UTF8 encoding, so I can use non-ASCII characters in paths? Does it translate them somehow into native Windows UTF16 encoding? What encoding will have the file list.txt after issuing:
$ ls > list.txt
from the folder containing non-ASCII named folders and/or files?

Also, related to paths. Does Windows version of bash support '/' character as directory separator? Or have I to use '\' instead as in cmd.exe? Bash uses '\' as control symbol, does it mean I have to write '\\' instead of '\'?
April 01, 2016 14:40
@Alexandru It could be as little as make UTF_8 locale work (this alone would already be huge improvement), and then use it by default for the programs called in this Linux subsystem
April 01, 2016 16:05
Same question as @kossboss: How do I install this?
April 01, 2016 18:57
@ Alexandru

By the sound of things, WSL (the Windows Subsystem for Linux) is basically a reimplementation of the Linux kernel on top of the NT kernel, without any userland. The Ubuntu Linux userland, including bash and the other commands, as well as the user mode libraries they load, then run on top of what looks to them like any other Linux kernel. As a result, bash and the other Ubuntu userland should behave the same way on WSL/Ubuntu as they do on Linux/Ubuntu (with the obvious exception of features that haven't been implemented by WSL). This is different from, say, porting the Ubuntu userland to another Unix OS (like OS X or the old POSIX/Interix/SUA subsystem on NT), which has a different ABI, different kernel behaviour in some respects, and would require source code modification (in most cases) and recompilation.

The really exciting thing about WSL is that it's binary compatible with Linux/x64. The POSIX subsystem was only source compatible with other Unix variants, and had its own ABI (which was normal at the time, the late 1980s/early 1990s, when there were many competing variants of Unix, running on many competing hardware architectures). Both in the original limited version and in the enhanced BSD-like version later released as Interix/SUA, the POSIX subsystem was basically an obscure variant of BSD Unix, with its own quirks, and without sufficient market share for most developers to care about (porting software from one Unix variant to another and then maintaining the port is actually a lot of work). Today, things are different. There is a de facto standard Unix, which is Linux, and most developers use x64, so Linux/x64 is essentially the de facto standard Unix ABI.

Regarding string translation, since UTF8 and UTF16 are just different encoding schemes for Unicode, translating between them is straightforward. I think the Linux kernel, like the Unix kernel (which pre-dates Unicode) just views strings as byte streams, hence the need for UTF8 instead of UTF16 (more recent operating systems and language/runtime environments typically use UTF16). The translation of the byte streams into characters then depends on the locale setting used by user-mode software and, for paths, on the local setting specified when mounting the volume. If Ubuntu on WSL mounts all NT 'volumes' with UTF8 for paths, and one of the LX kernel modules translates UTF16 to UTF8 for Linux processes, then everything should just work. It's basically the same problem NT faces when running classic Windows software, which, like Unix/Linux, expects 8-bit strings using some specific codepage (UTF8, for example, is Windows codepage 65001). So, Microsoft have been handling this problem for almost 23 years now, since the release of Windows NT 3.1 in 1993. :)
April 01, 2016 18:59
@ Bruno Leonardo Michels

I have the same question: how can we install this? The answer, unfortunately, is probably that we'll have to wait for a newer build. I've got the latest Insider built, with developer mode enabled, and there's no sign of Linux/Ubuntu/bash in the list of optional features. :(
April 01, 2016 19:43
@Thomas same thing: build 14295 + "Developer mode" enabled -> no results (nothing interesting in Features list). LXSS driver presented (as it was before, from 14251), but I cannot find "uow" / "ubuntu" / "bash" or smth like this in system folders / store.
April 01, 2016 19:49
Reading the comments a few things seem to be repeated all over:

1. This is not April Fools because the article is from 30th of March. The date of the comments are irrelevant.

2. Scott definitely knows how to exit emacs, he is just using a special technique called sarcasm. I remember how I had a hard time first times exiting vim, for example.

Just enjoy the beautiful transformation of Microsoft and stop nitpicking already! :)
April 01, 2016 20:37
I also am running the latest build 14295 and am on the fast ring. I don't see any way to enable this. Hopefully someone can chime in with some info on how to get this working.
April 02, 2016 6:34
The FSF will never win the fight to have "GNU/" in front of everything; it's disingenuous. Those tools might be built by the the GNU project, but they are all rewrites of similar tools from UNIX. There are probably a dozen or so projects on Github that rewrite coreutils using Go, Rust, etc. The same goes for GNU/Linux. The FSF did not write Linux, that credit firmly belongs to Torvalds and the people who contributed.


You've got to be kidding. You're really going to defend this? Look, I would get it if calling components of GNU "Linux tools" was just a matter of laziness. But these are not "Linux tools". To actually pretend that you're correct to call them "Linux tools" demonstrates both your ignorance and your arrogance.

Linux really has next to nothing to do with this. Linux is a kernel; its job is to allocate system resources, or in layman's terms, to interface between software and hardware. Linux doesn't need to do this on Windows. The only thing Linux has to do with this is that it's a compatibility layer for binaries compiled for glibc and Linux (GNU/Linux systems, though it's more common for people to call this combination "Linux").

And pointing out that there are other programs doing the same job that components of GNU do has nothing to do with what these components are! If GNU bash is unfit to be named properly because it's just re-implementing something else, then guess what? Linux was originally a recreation of MINIX. So I guess we have to call everything related to Linux "MINIX" now, right? Of course not. Linux is Linux, and GNU is GNU. To insist that they are actually the programs they are inspired by, when they clearly are not, is just factually wrong.

These are facts:

* Bash is part of GNU.
* GCC is part of GNU.
* glibc is a part of GNU.
* GNU coreutils is a part of GNU.
* GNU awk is a part of GNU.
* GNU grep is a part of GNU.
* GNU Emacs is a part of GNU.

These are all GNU components, not "Linux tools". They were developed separately from Linux, just like Python and Ruby were, by the GNU Project. And there are several more programs that fall under the umbrella of what you call "Linux tools". In fact, these programs predate Linux.

I'm not going to demand that you call GNU components what they are. After all, you didn't do this for things like Python and Ruby, either. You can pretend all you want that Linux is the basis of the entire GNU/Linux system, despite the fact that GNU predates Linux by about 8 years. That's fine. But when someone points out that GNU components are in fact GNU components, you'd do well not to respond with nonsense like this.
April 02, 2016 7:05
dont seem to find a way to install it. can anybody help me?
April 02, 2016 8:51
"Resistance is futile, you will be assimilated!" :-)
April 02, 2016 11:53
It is amazing how much cluelessness and hostility comes out from all directions if you mention Windows and Linux at the same time.

Having made my own contributions to both in the first paragraph, I'll now try to add some cluefullness...

From what I've been able to piece together from various places:
  • There is a lot more than "Bash" to this.

  • There is little/no "Linux" involved in this.

  • Bash is really just the "window" into a bunch of GNU userland tools

  • Installation and dependancies for those GNU tools are provided by the apt package management system, which originates with the Debian distribution(s) and used by Ubuntu

  • Ubuntu is apparently building and curating the binary packages, the same binary packages used by Ubuntu linux. Many/most of the source packages come from Debian.

  • Underneath this all is Windows Subsystem for Linux (which seems like it should be named Linux Subsystem for Windows), the latest in a long line of U*nix subsystems for the NT kernel, providing a Linux ABI.
eas
April 02, 2016 20:36
@eas: Yep, you got it - great summary!
April 02, 2016 20:37
For everyone asking "where can I get the bits" - it's coming to the next fast-ring Windows 10 Insiders build.

So if you want to get your hands on Bash on Ubuntu on Windows, be sure to join the Insiders program (free) and set your slider to ask for fast-ring updates.
April 02, 2016 20:48
@Guilia Q: We're prepping a series of deep technical articles walking you through many of the areas you requested info about! Bear with us while we craft these docs, but keep your eye on our blog.
April 02, 2016 23:55
When running Gentoo on Interix, one of the problems that had to be worked around was that open files could not be replaced or deleted. Linux applications typically assume that they can do this. Is this solved in WSL?

Next question, will WSL be published itself as open source? So people could work on implementing missing syscalls, or fix bugs, or port the whole thing to Windows 7 😉 themselves?

Bear with us while we craft these docs
According to Dustin Kirkland's blog, some documents were already available to him. Are the documents that he used to create Ubuntu on Windows unfit for public consumption, or why can't they just be published while you are crafting the other documents?
So if you want to get your hands on Bash on Ubuntu on Windows, be sure to join the Insiders program (free) and set your slider to ask for fast-ring updates.
Be sure to do it fast while everybody is still hyped for it. Release early, release often.
April 03, 2016 15:29
I assume there's no official date for a Release Cadidate?
April 03, 2016 23:49
Seems to me that the best way to describe this is "Line" or "Uine". This is Wine inverted, no?
April 03, 2016 23:49
Sorry, Line - Linux Is Not and Emulator, Uine - Ubuntu Is Not an Emulator.
April 05, 2016 14:27
Sounds nice!

Is it possible to run it with current Insider builds (I'm running Build 14295) or do we have to wait for Anniversary update or a newer Insider build ?
leo
April 06, 2016 2:35
When can this release?
April 06, 2016 19:38
Could I install Gnome over Windows Desktop, then?


April 07, 2016 0:06
Very annoying that it doesn't support /dev/null or symbolic links

This basically screws it for my use case - running node and ruby

root@localhost:/mnt/c/git# echo "abc" > file1
root@localhost:/mnt/c/git# echo "123" > file2
root@localhost:/mnt/c/git# ln file1 link1
root@localhost:/mnt/c/git# ln -s file2 link2
ln: failed to create symbolic link ‘link2’: Operation not permitted
April 07, 2016 10:00
@Andrew - sym links worked fine for me, but not under /mnt/c. I could create them under the root file system.
Nag
April 07, 2016 11:16
My install experience (Upgraded Windows 7 Pro to Windows 10 Pro):

Conanical Bash For Windows 10

Error: 0x800c0005 when installing bash

Installs ok after 0x800c0005 fix for me ... (only do fix if Windows gives an 0x800c0005 error when installing), ps command doesn't work properly, top really doesn't work, to the point where you no longer can read your output... (not completely a complaint terminal - but what really is? :) )

As someone said before, symbolic links don't work... Permission denied for system Windows files... It's fast and interesting, but don't expect too much... But also find yourself to be surprised how much it can do. Either Virtualize or Cygwin or GOW (if Windows Feature for Linux is off and not installed - not sure how two copies of bash would react on the same Windows machine...)

Hope this info helps someone, as I hit a bump in the road installing...
April 07, 2016 11:26
BTW, I take back the symbolic links and ps comments... ;)
April 07, 2016 12:14
@Nag there are _lots_ of utilties that use symlinks in the user folder, which also doesn't work

try installing nvm https://github.com/creationix/nvm
April 07, 2016 16:07
You mean they finally replaced Windows PowerShell?

C:\DOS

C:\DOS RUN


HOUR LATER.....

!@#$%^&*

apt-get remove Windows 10

DO YOU WISH TO, OH BLOODY HELL YESSSSS!!
April 07, 2016 18:43
How do I exit root? It starts root by default.
April 07, 2016 19:32
I find this an intriguing development seeing how PowerShell is such a disaster. Composing BASH scripts is far faster and easier.

But I ponder if this isn't wrought with security problems. I read 'as root' - is the bash prompt running as the root user or the current user? How are permissions handled on files and processes? Will there now be virus written specifically to exploit this shell to hose Windows?

Will there ever be shell utilities to provide BASH access to Microsoft specific features - Exchange Server? Active Directory?
April 09, 2016 20:00
If you have already C:\Data, rename it. This installation create Windows own C:\Data ... something new for me.

I was lucky. Installation saved my C:\Data to the C:\Windows.old\Data.

Installation didn't give any info that my data directory was moved.
April 10, 2016 18:57
Is there a way to share ssh files? I already have a setup .ssh folder on my Windows, can I use that on bash as well?
April 12, 2016 15:48
I have the latest build 14316 and had dev mode enabled. re-enabled it just to be sure, but there is no windows option/feature to turn on. Really strange. Perhaps because the OS is not set to english? I have seen more people with this issue on superuser. no resolution though.
April 13, 2016 18:54
Been playing with this a bit, very cool.

One question for some guru to dig into a bit - how can I re-init my Ubuntu back to a clean slate? Tried removing/adding the windows feature, my filesystem is preserved. Found the filesystem files under C:\Users\<username>\AppData\Local\lxss, deleted them, ran bash again hoping it would start from scratch, but got an error instead. Tried init'ing it as another user and copied that user's filesystem files to my lxss folder, got an error running bash. Restored all my files from recycle bin and all is well, but would love to be able to wipe it and go back to the initial clean filesystem.
April 13, 2016 23:27
Ok, so just watched the //build/ video Scott points to for more info, the issue of a wipe/reset was addressed, still TBD at this point. Lots of other good stuff in the video as well.
April 28, 2016 4:17
I recently modified my home computer from Windows 10 to Windows 10 Pro Insider Preview. This changes I made to test Bash On Ubuntu to Windows to test Linux commands using Bash command line. Basically I was interested in test .net core from Linux environment.

However, after this, I am experiencing random restart of computer.

Any suggestion?
May 01, 2016 9:37
As I've mentioned above, mattresses with heated pads are incredibly useful in order to avoid
entering cold bed. If you wish, it is possible to get a double-firmness mattress by that features a hard side for infants along with a softer one for toddlers.

Mattress pillow top These plasticizers (probably the most commonly used are phthalates)
comprise 30%-40% with the weight in the vinyl surface of your crib mattress.


Sleeping on the mattress which is firm is the one other thing that's going to help out with keeping your
spine straight. The queen-size bed frame is often made of wooden slats or perhaps a mattress-shaped wooden box
with corresponding spring that support the mattress in location.
May 14, 2016 7:04
@Scott,

I'm running build 14342 and I was able to successfully sudo apt-get install redis-server. I can run redis-server, either with redis-server --daemonize yes or redis-server & but either way when I run redis-cli I get Could not connect to Redis at 127.0.0.1:6379: Connection refused.

Where you able to successfully connect to redis?
Lee
June 08, 2016 7:43
@Adam Wright - BSD has had LCL for years, this is probably exactly that.

If it really can run apt, then the answer to most questions here is, yes. Want I want to know is, how does this affect Microsoft's relationship with Valve Corporation?
June 14, 2016 7:29
Amazing info and i really like your work! thanks a lot or sharing! Free Android APK file download safe link apkdom best safe APK downloader free download mirror xapk obb server CoC private link. Love fun ideas lovematchfun join now. The Best Prank Apps, jokes and shocking Games for Android. prankyapps electric screen joke, Love Match test Prank, transparent screen android app, etc. Free Android app APK download softlot app games APK downloader. Gift Ideas giftspilot gifts for her and kids.
So, yes, ads are coming to Wholesale Jerseys 2016 uniforms. Maybe not next year, but soon, and for the rest of our viewing lives. At least we can take heart in the fact that we won't be watching, say, the Citibank Giants play the Coca-Cola Falcons. Yet.
One key, of course, is matching the right sponsor with the right team. The NFL will have its say in advertiser selection Kansas City Chiefs Jersey , to avoid some Texas offramp strip club sponsoring the Cowboys or some Bay-area pawn shop hooking up with the Raiders. You'll be looking at multi-year agreements; this won't be like NASCAR, where advertisers can switch from week to week and certain unfortunate cars might run without ads at all Pittsburgh Steelers Jersey . Dozens of companies are willing to spend millions for 30 seconds of Super Bowl ad time; you think there won't be a line out the door to buy three hours' worth?
June 22, 2016 1:31
I tried Long Path Tool and it worked.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.