
Ask HN: Is Bash for Windows good enough to replace a Linux/Mac terminal? - jiantastic
I know the Interop feature is coming to Bash for Windows (https:&#x2F;&#x2F;blogs.msdn.microsoft.com&#x2F;commandline&#x2F;2016&#x2F;10&#x2F;19&#x2F;interop-between-windows-and-bash&#x2F;) which to me seems to solve the complaints I had with the initial implementation.<p>Can anyone comment on their experiences using Bash for Windows for development full-time?<p>Thanks!
======
gtbono
I've been watching the whole Bash on Windows thing since it launched and it
blows my mind in almost every possible way, the project has all the potential
to make Windows a viable programming environment, specially for PHP and Ruby
folks, which need to run Apache and all that stuff.

It won't replace a full Linux install, but it might be enough for most use
cases (it doesn't run X yet, for example). So virtual machines aren't exactly
going to be replaced by Bash on Windows.

But for people who buy Macs just because it is a Unix machine that runs
Photoshop, and use Homebrew and Macports, which let's be clear apt-get wins
hands-down, Bash on Windows is a strong alternative for these types of users.

I own a Macbook Air 2011, Apple prices skyrocketed in Brazil and for me to pay
that price on a machine that has soldered RAM, almost no ports, having to buy
expensive adapters, to use a shitty package manager with an OS that makes me
dual-boot with Windows/Linux for some things, I am definitely considering a
Lenovo or Dell machine with Windows for my next development environment.

Of course, not all things are perfect, while the project seems to be moving at
an awesome pace and the future is bright, it is still in Beta, and lots of
things are broken for now, if it becomes as stable as it should be, it will be
big. I am eagerly waiting for the stable version of it.

~~~
russellsprouts
It is possible to run X programs with Bash on Windows. You need to run a
Windows port of an X server, like Xming[1]. Even programs like Firefox work,
though it's a bit laggy. It's good enough to run gvim, though.

[1]:
[https://sourceforge.net/projects/xming/](https://sourceforge.net/projects/xming/)

------
alexwebb2
In short: yes. I recently went through this with a new work laptop.

I checked a couple boxes, restarted, and installed ConEmu.

I added symlinks in my bash home directory for "c", "docs", and "downloads",
and pinned my Linux installation as a favorite in Windows Explorer, which
makes file management between the two systems incredibly easy.

I installed git, and zsh, and a lot of the other basics. Zero issues. It's a
normal Ubuntu installation.

I've been thrilled with it, so much so that I just plunked down some money for
my first Windows laptop in years, and I'm selling my old Macbook Pro.

It's the real deal. Microsoft is on fire lately.

~~~
elcct
And recent insider update lets you install ubuntu 16.04 and run Windows
commands from bash. Neat.

------
ordinary
I have not tried Bash for Windows, but I've been a Cygwin user for almost a
decade.

The main problem I have with using any kind of shell on Windows is that
process spawning takes much, much longer than on *nix systems. I regularly
find myself optimizing my scripts not for readability or elegance, but for
total number of calls to executables.

To illustrate, opening a new Cygwin Bash shell on this machine takes 3
seconds, almost all of which is spent executing .bashrc. On Linux, with the
same .bashrc (modulo a few platform-specific settings) that's under 0.2
seconds.

So, far from perfect, but is it 'good enough'? I'd say yes. Bash is just so
much nicer than CMD, and while I hear good things about PowerShell, I can't be
bothered to learn a different shell for every platform I use.

Whether there are additional tradeoffs with Bash for Windows, I cannot judge.

~~~
JdeBP
One cannot infer the behaviour of the Windows Subsystem for Linux from the
behaviour of Cygwin. The two are quite different things.

You're also being misled by the misleading "Bash on Windows" marketing name.
It's not bash, even primarily. It's a "personality" subsystem for running
Linux binaries on top of the Windows NT kernel. And that's what jiantastic is
asking about: whether _the subsystem_ , with what Linux programs it can run
and what limitations it has, is "good enough" as a development environment,
which includes considering everything from running compilers to hosting test
rigs. Xe is not asking whether the Bourne Again shell is better than some
other command interpreter.

------
Down_n_Out
There's also Babun[1] which is a pre-configured Cygwin with a lot of addons as
they say themselves. It also uses oh-my-zhs.

When I have to use a Windows OS for some reason I install this, it at least
makes me feel a little bit at home.

[1][http://babun.github.io/](http://babun.github.io/)

------
eswat
My experience and usecase is limited - I just use my Windows machine for game
development - but I’ve dealt with more headaches trying to get Bash for
Windows + git to play nice with Unity that I’ve just gone back to using Git
for Windows and its bash exe.

Probably the weirdest problem I’ve ran into are shader files in my git repo
being locked to requiring administrative rights for either Unity or Bash for
Windows to be able to open them.

~~~
bitcrazed
@eswat : So long as your shader files are stored in a non-protected folder
(e.g. C:\Windows, C:\Program Files, etc.), you shouldn't need Admin rights to
load them.

------
johnnycarcin
It's not 100% there yet but it's pretty damn close for me. If you are set on
running a stable build of Windows then there are still some bugs out there
that range from annoying to possible deal breakers. The two that come to mind
is the stable version doesn't support 256 colors (annoyance) but then there
are issues like this that stop me from being able to totally use go:
[https://github.com/Microsoft/BashOnWindows/issues/638](https://github.com/Microsoft/BashOnWindows/issues/638)

Most of these are fixed in the insider builds of Windows but that means you
have to run full insider builds, you can't pick and choose components, so
sometimes that is a non-starter for people.

Some of the annoying (color, cut & paste, etc) things can be fixed by using
something like ConEmu (what I use).

I've actually stopped using my macbook and am now just using my company
provided Windows machine for day-to-day stuff and it's been pretty smooth for
the most part.

full disclosure: I work at Microsoft

------
Eridrus
If you're switching platforms you should test the software you plan to run,
there are still some small gaps that may kill your workflow (eg zeromq doesn't
run out of the box, which means jupyter doesn't either).

It's been pretty good to me, but I'm normally a Windows user, so roadblocks in
WSL just send me back to my old workflows rather than causing me headaches.

------
mephistopheles
I have tried using it for the past couple of weeks, and had to fiddle a lot
for the first week or so to get it working nicely. The package state is stuck
at 14.04 but you can upgrade[0] to 16.04 with dirty[1] trick. After the
initial setup, Windows Bash worked just fine for my Rust / Go / Python needs.

What would you mainly use the bash environment for ?

[0]([http://www.omgubuntu.co.uk/2016/08/upgrade-bash-
windows-10-u...](http://www.omgubuntu.co.uk/2016/08/upgrade-bash-
windows-10-ubuntu-16-04-lts))
[1]([https://github.com/Microsoft/BashOnWindows/issues/482#issuec...](https://github.com/Microsoft/BashOnWindows/issues/482#issuecomment-235449454))

~~~
Eridrus
You can install 16.04 now, but you have to blow away your Linux install to do
so
[https://blogs.msdn.microsoft.com/commandline/2016/10/19/wsl-...](https://blogs.msdn.microsoft.com/commandline/2016/10/19/wsl-
adds-ubuntu-16-04-xenial-support/)

~~~
elcct
I didn't have to. Upgraded nicely using do release upgrade

------
jbb555
What exactly are people using the linux shell for? It's fun, but given that
you can't easily access windows files and you can't use it to run things like
the visual C++ compiler you can't easily use it to script windows programs.

What do people actually use it for?

~~~
bitcrazed
Bash <\--> Windows interop arrived in build #14951:
[https://blogs.msdn.microsoft.com/commandline/2016/10/19/inte...](https://blogs.msdn.microsoft.com/commandline/2016/10/19/interop-
between-windows-and-bash/) allowing you to call Windows apps from within bash,
and capture and process the output of Bash scripts and/or Linux tools from
Windows.

What else can you use Bash for? Using apt-get to install your favorite dev
tools, libraries, platforms and languages inc. node.js, Ruby, Python, gcc, go,
Rust, htop, Apache, MySQL, Jekyll, etc., and then building and running your
code with little/no change vs. running on Linux natively.

------
zachruss92
Personally, I dislike it. I have been a Cygwin user for a few years and I
desperately want to like LSFW, but I just can't. I find the customization
options of Cygwin to be much more and I can get things like Tmux working on it
without any issues.

I also have a ton of docker compatibility issues when trying to work with
containers, ultimately I just wrote a power shell script to get my docker-
compose environment up and running and go from there.

As far as I know, you also can't run nginx on port 80 which makes it
challenging for web development (i'm sure I can run things on different ports,
but who wants to do that).

I think it's promoting, but not quite ready to replace my MacBook & Linux
partitions yet.

------
patleeman
I've been using it for some web development tasks. Mainly for git, ssh,
perusing my file system, and PHP/Python programming. It's worked well so far.

For a terminal emulator, I set up Conemu
([https://conemu.github.io/](https://conemu.github.io/)) which is pretty
swell.

I hit a road block when I need to use vagrant for my development environment.
I need to hop into powershell to fire up vagrant as virtualization doesn't
seem to work in WSL. Otherwise it seems to work for most of my use cases.

~~~
kyriakos
In the latest build you can run Windows executables directly from bash so you
can run vagrant from the windows installation without switching shell.

------
bucma
I've been using Bash for Windows at work for a couple of months, and it's
mostly been good enough that I don't need to fire up my ubuntu vm anymore.

The biggest problem I've run into lately is that I _really_ want to be able to
run GUI-based programs, and even though that does worth with VcXWin, it's kind
of crappy, especially for font rendering.

Anyone know of a free (or cheap) x window server for windows that does anti-
aliasing?

~~~
aq3cn
I wonder if MS finds a way to port open source Linux apps in Windows 10.

~~~
NetStrikeForce
Isn't WSL the shotgun approach to answer your question? There's no need to
port thousands of useful tools; create the WSL and poof! most of it runs out
of the box, natively, in Windows.

------
automathematics
Last I tried, absolutely not. There is a bug with TCP/IP that apparently
prevents nodejs from doing anything networking related. So for example,
express will not run because it can't find to the port to listen for HTTP.

Its been documented and seemingly ignored by the bash team every time I've
checked so I may stuck sticking with a laptop that doesn't have an escape
key.. :(

Proceed with caution, for now.

~~~
outdooricon
It's actually not being ignored, the fix is in active development:
[https://github.com/Microsoft/BashOnWindows/issues/468#issuec...](https://github.com/Microsoft/BashOnWindows/issues/468#issuecomment-251298565)

------
aq3cn
I do scientific programming using FORTRAN 90 and Python. I am Windows Insider
with fast build releases set up in my Dell XPS. For my needs it has served
well. But I request MS developers to give more control over how to utilize
system resources more efficiently. It needs to be more transparent and
documented for users of procexp.

~~~
kyriakos
A change in a recent build lets you see which particular OS process is using
the CPU instead of previously all being combined into one.

I know this is not exactly what you are looking for but it's a step in the
right direction.

------
tkinom
Bash for Windows is open source, right?

Is there anyway for me to get just bash binary to run? or build it from source
and run it instead sign up for the insider program.

I tried to signed up as insider a few times on couple win 10 systems, failed
and completely gave up on that.

~~~
enzanki_ars
You don't need to be an insider to run it. It is available in the current
version of Windows 10 (Build 1607 - AKA Anniversary Update). Then go to
`Settings -> Update and Security -> For Developers -> Developer Mode`. Next,
search for `Optional Features` Start Menu (Just start typing that in the Start
Menu, it will show up) and check the box next to `Bash for Windows`.

------
timehastoldme
I used it at work last summer, and it was fine-- did everything you'd expect
it to, etc. I found that I missed my Mac for a few reasons, but those seem to
be mostly idiosyncratic.

------
null4bl3
But.. Why.. Why would you want to do that. And I am not asking to be clever. I
just can't imagine why anyone wouldn't just run Linux?

~~~
JdeBP
Then that's a major failure of imagination. (-:

It's actually quite easy to imagine scenarios such as _it is not your
computer_ and the person whose computer it is (such as an employer) requires
for whatever reasons that it run Windows.

That said, it should be noted that in many discussions of the Windows
Subsystem for Linux people have observed that this is not being aimed at
people who run Linux. This is being aimed at people who would otherwise be
migrating from Windows to (say) a Mac. (And also at those who have already
migrated, and might be reconsidering migrating back.)

For those people, jiantastic's question is important. They want to know
whether their needs can be met by staying on Windows and using the Windows
Subsystem for Linux, whether it is "good enough" as a development environment
to do all of the things that they may need to do as a developer (from
installing and running development tools to hosting test rigs), or whether it
doesn't meet those needs and they should instead consider the more drastic
course of replacing Windows with something else.

------
abrown28
I can do almost everything I want in bash except run anything that needs a
list of network interfaces. I would like to run gulp with browsersync.

------
miriadis
Why not a Virtual Machine on your PC?

~~~
jiantastic
For my use case I would prefer to have 100% of system resources on one OS.
Also, I'm coming from a Mac and would prefer the "integrated" feel if that
makes sense

~~~
LifeQuestioner
The VM's are amazing.

You don't have to dual boot.

You can have on one screen Ubuntu, on the other, windows. So you can use all
your photoshoppy design programs on windows and the best coding on linux.

Best of both worlds.

You can also intall cygwin in windows which gives you a terminal on windows.
Although there may be be a better program now than cygwin

Also, not sure if this is any good:
[http://www.pcworld.com/article/3106463/windows/how-to-get-
ba...](http://www.pcworld.com/article/3106463/windows/how-to-get-bash-on-
windows-10-with-the-anniversary-update.html)

~~~
ars_nihili
> You can also intall cygwin in windows which gives you a terminal on windows.
> Although there may be be a better program now than cygwin

Yes, like WSL, which OP is asking.

~~~
LifeQuestioner
Nothing wrong with broadening an answer, no need to be black and white. Cygwin
has been around for ages.

~~~
bitcrazed
There's a big difference between Cygwin and Bash on Windows though: Cygwin is
a Win32 port of the GNU tools, whereas Bash on Windows is a Linux kernel
emulation layer that allows you to run unmodified Linux binaries directly on
Windows.

------
mdrzn
Multi-tabbed-putty

[http://ttyplus.com/multi-tabbed-putty/](http://ttyplus.com/multi-tabbed-
putty/)

