Live data from Hacker News

Foreign Linux: Run Linux binaries on Windows without drivers or modification

github.com

131–140 of 149 posts

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#131
post #99
post #92

Earlier quoted context omitted.

Windows has had a proper shell for a while now, in the form of PowerShell. It's quite different from the standard Unix shell, and I'm nowhere near as productive in it as I am in Bash, but that's more a function of lack of familiarity than any weaknesses of the shell. In fact, I'd say that it's actually much nicer than unix-y shells for a wide variety of tasks. All I really find missing these days is good line-editing…

> All I really find missing these days is good line-editing Probably familiar enough for bash people: https://github.com/lzybkr/PSReadLine > and a half-decent terminal emulator in which to run the shell. Not a terminal emulator (although I think it can do Terminal escape sequences if needed): https://github.com/Maximus5/ConEmu

It's still not a terminal emulator, but you can use Clink [1] to get readline in cmd. Works great with ConEmu or as part of cmder, as others have mentioned.

[1]: http://mridgers.github.io/clink/

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#132
post #47

Earlier quoted context omitted.

What do you use for grep? I tried using Powershell and did a few things with it, but while it is a great shell, the lack of good tools like grep prevented me from being really productive.

I've ended up with Select-String "pattern" -Path file.txt | ForEach-Object { Write-Output $_.Line } | Out-File t.txt Slightly Heath Robinson, but by default PS will truncate lines to terminal width, even when writing to a file, which is a disaster for any kind of subsequent machine processing.

Today, I learned "Heath Robinson" is British English for "Rube Goldberg"

http://en.wikipedia.org/wiki/W._Heath_Robinson

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#133
post #99

Earlier quoted context omitted.

> All I really find missing these days is good line-editing Probably familiar enough for bash people: https://github.com/lzybkr/PSReadLine > and a half-decent terminal emulator in which to run the shell. Not a terminal emulator (although I think it can do Terminal escape sequences if needed): https://github.com/Maximus5/ConEmu

It's still not a terminal emulator, but you can use Clink [1] to get readline in cmd. Works great with ConEmu or as part of cmder, as others have mentioned. [1]: http://mridgers.github.io/clink/

Very high ROI. Removes a lot of stress you got just typing cmd.exe.

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#135
post #52

Earlier quoted context omitted.

For me, Cygwin makes Windows bearable. It's still Windows, but, at least, it has a proper shell, interpreters, compilers, compressors (no need for WinZip or WinRAR - think about it!) and so on. For the same reason you need MacPorts or Brew on a Mac, you need Cygwin on Windows. Unless you are happy to spend your day in Visual Studio, in which case Cygwin will not be that useful.

cygwin is fine, but if you want to spend most of your time in bash or using software designed for Unix you probably shouldn't be using Windows in the first place.

I'm a bit split at this point.. in general, I have an ubuntu server VM running (with docker), with my home directory mounted via samba as a drive in windows, and have a couple conemu tabs open ssh'd into the VM... I can continue to edit in windows, but run in Linux.

At least for my stuff that will run in Linux (node/iojs and golang) targeting docker containers, it works well.

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#136
post #92
post #52

Earlier quoted context omitted.

For me, Cygwin makes Windows bearable. It's still Windows, but, at least, it has a proper shell, interpreters, compilers, compressors (no need for WinZip or WinRAR - think about it!) and so on. For the same reason you need MacPorts or Brew on a Mac, you need Cygwin on Windows. Unless you are happy to spend your day in Visual Studio, in which case Cygwin will not be that useful.

Windows has had a proper shell for a while now, in the form of PowerShell. It's quite different from the standard Unix shell, and I'm nowhere near as productive in it as I am in Bash, but that's more a function of lack of familiarity than any weaknesses of the shell. In fact, I'd say that it's actually much nicer than unix-y shells for a wide variety of tasks. All I really find missing these days is good line-editing…

However great powershell is, the fact that bash is so universal everywhere else makes it too hard for me to use. With Cygwin I can often move seamlessly between Linux, OSX and Windows without changing anything I do, including all the utility scripts I write etc.

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#137
post #130

Earlier quoted context omitted.

I was wondering the same thing. The features page claims "copy on write fork implementation" but that is not universally true. A cursory look at the code suggests that every allocation is a Win32 file mapping object (aka NT section) underneath, which the fork worker (mm_fork) remaps into the forked process. This means the memory is shared between two processes, and not in a CoW fashion. A write to the memory region f…

From little I've read on cygwin mailing list (btw, cool folks over there) - it seems the problem is not very easy. If I'm not mistaken the Windows Kernel actually does support fork()-ing, but the win32k system somehow "forbids" it (lots of grains of salt). After all for a long time there was a commercial UNIX compatible offering on Windows that probably used fork() all over and must've worked (also it supported case-…

Using fork to get a "snapshot" of memory seems... like a roundabout way of doing things. The underlying memory mapping mechanism should expose a simple way of just doing it directly. (I still don't understand the point of fork, especially when most of the time exec is just gonna overwrite things anyways. And the impact fork has is to massively increase potentially used memory, leading to the dumb memory overcommit semantics and hack fixes like OOM killer.)

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#138
post #130

Earlier quoted context omitted.

From little I've read on cygwin mailing list (btw, cool folks over there) - it seems the problem is not very easy. If I'm not mistaken the Windows Kernel actually does support fork()-ing, but the win32k system somehow "forbids" it (lots of grains of salt). After all for a long time there was a commercial UNIX compatible offering on Windows that probably used fork() all over and must've worked (also it supported case-…

Using fork to get a "snapshot" of memory seems... like a roundabout way of doing things. The underlying memory mapping mechanism should expose a simple way of just doing it directly. (I still don't understand the point of fork, especially when most of the time exec is just gonna overwrite things anyways. And the impact fork has is to massively increase potentially used memory, leading to the dumb memory overcommit se…

Yup. indeed, but it seems so elegant, in the same way (elegant) as one can implement undo using closures - at the expense of unaccounted resources (cpu, memory, who knows what else).

From redis's page: http://redis.io/topics/persistence

"RDB needs to fork() often in order to persist on disk using a child process. Fork() can be time consuming if the dataset is big, and may result in Redis to stop serving clients for some millisecond or even for one second if the dataset is very big and the CPU performance not great. AOF also needs to fork() but you can tune how often you want to rewrite your logs without any trade-off on durability"

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#139
post #119
post #45

Earlier quoted context omitted.

But if you can run this, you can run VirtualBox, which is a much safer alternative (and simpler, if a live ISO meets your needs).

Unfortunately, a vm solution won't work with certain vpns, such as Cisco's. I know firsthand as I've tried it.

Forcing me into a non-admin Windows account at work is bad enough. If I had a to tolerate a VM on top of that I would start bringing my laptop.

Re: Foreign Linux: Run Linux binaries on Windows without drivers or modification

#140
post #14
post #7

If this can bring me a working * nix shell under Windows, I'd be extremely happy. Windows is great for everything except I have never learned PS as well as I know the * nix shells -- with this, I could enjoy the hardware and proper multi-monitor support, speed and stability (seriously) of Windows and use the * nix command line.

To be honest, and I say this with a massive cringe, after 20 years of Unix I'm more productive with PS in a couple of months! It's quite refreshingly easy to use and I genuinely had no idea how much time I was wasting on parsing streams. Now I feel horrible for revealing my dirty secret :(

You're a .Net developer who wrote a C# framework back in 2004 and consistently posts about how great Windows is and how poor Linux is.

At a wild guess I'd say that's why you're "more productive with PS in a couple of months".

Post reply on HN