Ask HN: Is Bash for Windows good enough to replace a Linux/Mac terminal?
I know the Interop feature is coming to Bash for Windows (https://blogs.msdn.microsoft.com/commandline/2016/10/19/interop-between-windows-and-bash/) which to me seems to solve the complaints I had with the initial implementation.
Can anyone comment on their experiences using Bash for Windows for development full-time?
Thanks!
52 comments
[ 3.5 ms ] story [ 129 ms ] threadYou 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...
Yes, like WSL, which OP is asking.
The only difficulty is if the hardware doesn't fully support Linux without hassle (in very recent notebooks for instance).
What would you mainly use the bash environment for ?
[0](http://www.omgubuntu.co.uk/2016/08/upgrade-bash-windows-10-u...) [1](https://github.com/Microsoft/BashOnWindows/issues/482#issuec...)
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.
But yes, it is generally slower. I'm much happier to be back to Linux these days.
Best solution is to edit /etc/bash_completion.d and remove anything you don't need this can shave off 2-3 seconds of the load time.
Since windows now should have a native fork() call Cygwin might be updated on its own which will make it about as fast as a native nix system, that said Cygwin will need to make a dedicated version for windows 10 for this to work.
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.
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/
For a terminal emulator, I set up Conemu (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.
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.
http://ttyplus.com/multi-tabbed-putty/
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.
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.
[1]: https://sourceforge.net/projects/xming/
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.
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.
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
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?
I know this is not exactly what you are looking for but it's a step in the right direction.
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.
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.
The part that comes from Microsoft is the Windows Subsystem for Linux, and of course the Windows NT kernel beneath it (and the Win32 subsystem alongside it). Unless something has changed recently, that is not open source.
What do people actually use it for?
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.
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.