7 ms·
Invoke Win32 applications with Bash on Windows
- teh_klev 10y agoI'm guessing this solves: https://news.ycombinator.com/item?id=12715945 https://news.ycombinator.com/item?id=12715945
- kyriakos 10y agoThis finally makes bash on windows functional. It was one of its limitations that made it feel disconnected from the rest of Windows.
- TimTheTinker 10y agoIt also introduces potentially significant new attack surface.
- flukus 10y agoDoes it expose any network service by default?
- laumars 10y agoNo more so than any of the shells that's already available on Windows (batch scripts, WSH, Powershell). If one was to exploit scripting on Windows, it would make more sense to target the existing shells rather than Bash as they're more widespread on Windows. Plus Bash on Windows isn't a new thing: we already have Cygwin, MinGW and I believe there was also some native Windows PE ports too. This is just a better implementation than the aforementioned three.
- dspillett 10y agoAny more so than, say, using bash and friends via cygwin or similar?
- criddell 10y agoMaybe. Cygwin is old code and sometimes that's better than new code from a security point of view.
- dragonwriter 10y agoYes, insofar as anything that allows you to do anything with your computer expands the attack surface. Like nearly everything, it's a context-dependent cost-benefit consideration.
- Matthias247 10y agoYes, that's really the missing piece and sounds great. Before that it really felt isolated, like working in a VM. My use-case was to have a full featured bash for invoking some build scripts built still to be able to utilize some windows executables (most imporantly currently docker for windows) in it. Seems like this should do it.
- jsingleton 10y agoThis does sound like it will make it a reasonable choice once it's stable. I currently use Git Bash and it integrates pretty nicely. I typically install it along with git and Git Extensions. It's great when you already know the bash way of doing something, hashing files for example.
- Matthias247 10y agoYes, I also use git bash / msys currently and I'm pretty happy with it. But there were a few cases were it caused problems, e.g. the automatic translation of file names caused some headaches for me (in most cases you want it, but e.g. in docker statements you don't want it). Wanted to try whether WSL can even improve that. The old version was unfortunately too limited, but this update sounds very promising and I will test it again.
- jongalloway2 10y agoThere's a lot more technical information in this post (scroll below the video for diagrams and writeup): https://blogs.msdn.microsoft.com/wsl/2016/10/19/windows-and-ubuntu-interoperability/ https://blogs.msdn.microsoft.com/wsl/2016/10/19/windows-and-...
- 0xFFC 10y agoWow, this is really impressive. Last time I worked with bash on Windows it felt like isolated island. But with this. I think it is a viable option right now. The only down side to it is slow file system operations. Compiling a single toy kernel (xv6) would take much longer than Linux. This is amazing, now I can have emacs server in Linux running through bash with windows service manager. This is fucking awesome. I hope they improve thing further and further. The only and biggest problem : Windows ridiculous conemu. I am not going use a console which I can't resize without any problem. For the sake of God they don't have unlimited buffer option and hide scrollbar (permanently) or resize window without messing up text.
- flukus 10y ago> Parameters are passed to the Windows binary unmodified. As an example, the following commands will open C:\temp\foo.txt in notepad.exe: This might rain on your parade a bit. Each island still has to know about the file sytem of the other island.
- 0xFFC 10y agoCutting them some slack I think is not bad idea. They are literally integrating two big operating system together. Do you see what I am saying? As we all know Microsoft messed up with mobile and web, but when it comes to software development they are ruler without even competition. Windows kernel is wonderful peace of software, and with this wsl they are literally showing industry how is software developed.
- flukus 10y agoI will, they've been clear about it being a work in progress. There are a lot of other people saying how amazing it is though, when functionality wise it's only just coming up to par with cygwin. Edit - functionality wise as a usable bash shell, it's an acceptable linux virtual machine already.
- cheiVia0 10y ago
- youdontknowtho 10y agoOh, that's nice. That's what I was looking for in the first place. As I'm reading the comments I keep seeing things that other people want to do that I never thought of...that's awesome.
- shados 10y agoNow they just need a better terminal emulator. Windows 10 made some minor but much needed adjustment, but I still end up using Cmdr (a nicely preconfigured ConEmu), and it's decent enough, but it pales over a nicely configured iTerm2 or what most popular Linux distros come with out of the box.
- timgws 10y agoI second this. Someone porting iTerm2 to Windows would make my day.
- Ultra_64 10y agoEmbrace, extend and invoke? ;)
- NoGravitas 10y agoWe're not on Windows 10 yet at my workplace, and I don't use Windows at home, so I've only been following loosely in a "this will be nice once I'm finally able to use it" way. But this bit took me by surprise: > 1 Use the same working directory as the CMD or PowerShell prompt > 2 Are run under as the WSL default user > 3 Have the same Windows administrative rights as the calling process and terminal 1 and 3 are not surprising. But 2? There's a WSL default user? Windows users aren't automatically mapped to unique Linux users? That seems problematic in theory. How does it work out in practice?
- kojoru 10y agoEvery Windows user get a separate Linux. When they run bash for the first time, system asks them to create a default linux user. Typically, this is also the only user. Mapping Linux users to Windows users would be quite problematic, e. g. with user such as nobody or apache that are typical to Linux.
- Senji 10y agoSolved problem, see Samba
- WorldMaker 10y agoIt seems to work pretty well in practice. The entire Ubuntu "system" is essentially installed into a Windows User's home space, which means that all of the Linux users are unique to a Windows user. This is useful in that you can install things that need Linux accounts for services (like say postgresql that uses a postgres user as a service account) and interact with it with sudo -u just as you would on an ordinary Ubuntu machine. With the interesting bit that the postgres user under my Windows user login would be different from the one under a different Windows user on the same machine, but that also has some advantages.
- NoGravitas 10y agoThanks. That is a helpful explanation.
- apatters 10y agoIf there's ever been a great opportunity to open source something in the Windows client, it's WSL. A number of popular User Voice feature requests were closed recently as not in scope, which is reasonable on the part of the WSL team but shows that the demand for Linux-on-Windows is much greater than the team's current objectives. If the project was open source and the team accepted patches who knows where this thing could go. People want to run X, they want device emulation, they want to run all kinds of apps that aren't necessarily dev tools.