Live data from Hacker News

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

github.com

101–110 of 149 posts

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

#101
post #55
post #51

Earlier quoted context omitted.

Is it better than using virtualbox?

It applies a Linux-like polish to a Windows machine. You can manipulate the whole Windows filesystem from within a Linux-like environment. With a VM you get a full Linux environment that cannot simply get to your Windows environment - you get a clear separation between the two. I like to say Cygwin "civilizes" Windows.

I like to say that Cygwin gives me the best of both worlds because Linux desktop environments simply lack the polish that the Windows desktop has.

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

#102

This has been tried before as the author notes. E.g. http://lbw.sourceforge.net/ Previous experiments have stumbled on Linux usage of %gs and other segmentation issues. The present project is possibly trying to overcome those obstacles with dynamic recompilation. It's in very early stages though.

There's also LINE and coLinux.

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

#103
post #55

Earlier quoted context omitted.

It applies a Linux-like polish to a Windows machine. You can manipulate the whole Windows filesystem from within a Linux-like environment. With a VM you get a full Linux environment that cannot simply get to your Windows environment - you get a clear separation between the two. I like to say Cygwin "civilizes" Windows.

I agree. And when you add Chocolatey to the mix (just add it with an elevated cmd.exe as stated on chocolatey.org), you're about half-way to a GNU/Linux-ish Windows. (In elevated PowerShell, I actually used "choco install cygwin -y" after doing so!) I think in Windows 10 this is supposed to be even better with their OneGet framework that will be compatible with Choco. Things are looking better for those who have to u…

Chocolatey is a bit of a security nightmare just waiting to happen. I heard it has a veto system now but it would have been better to design it from the ground up to use a central repo where people could do pull requests. The lack of review and arbitrary ownership of packages makes it very iffy, particularly on work/production workstations or servers.

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

#104
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

I knew about ConEmu (though I'm not 100% happy with it either). I'll take a look at PSReadLine, thanks.

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

#105
post #51

Earlier quoted context omitted.

I also want to out in a good word for Cygwin. It's fantastic, I have absolutely no complaints about it. I have python and GCC, as well as a fully working shell. I can do Linux development in either of my favorite languages (Python and C++) without any kind of worry, and they work without modification on Linux. Plus, having a working Bash with everything I want on Windows blows my mind.

Is it better than using virtualbox?

Sometimes a linux VM won't cut it, like on corporate networks heavily invested in Windows infrastructure (activedirectory domains and many layers of authentication that are either difficult or impossible to interop with linux).

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

#106
post #34

This is quite funny, since you can't run unmodified linux binaries on other linuxes (that is a binary distribution on linux is generally not a thing and there will always be a distribution that does stuff just differently enough), so a recompilation on windows sounds like as good of a solution.

The system call interface in linux is actually pretty stable. You can often run old binaries (at least ELF binaries) and binaries from different distributions as long as you have the shared libraries to go with them (including glibc). You can use a chroot or mess around with LD_LIBRARY_PATH.

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

#107
post #2

So it's cool, and a lot of people might see it as a bad thing that if this took off could potentially bring Linux users back to Windows. I personally think it could do the reverse though and encourage people to try Linux. If they enjoy using some small selection of tools that work on Windows (presumably all CLI tools) then they might be convinced to give a full distro a go. Interesting concept though and I really hop…

Linux already does plenty to bring Linux users back to Windows. What’s this going to hurt?

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

#108
post #10

Cygwin is impressively complete - if you haven't checked in on it recently, there are over 5000 packages in the official repo (that's more than Arch Linux's official repos), and adding the http://cygwinports.org/ repo gives you full KDE, GNOME 3 and Xfce on windows (although KDE has a first-party port). What this tool offers over Cygwin is the ability to run unmodified linux binary-only software for which you do not…

It took many years before I realized and tried it, but Cygwin also very easily lets you run an OpenSSH server on Windows, which I find incredibly useful.

And it's also the only reasonable and free option for this. (Correct me if I'm wrong but I've tried)

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

#109
interestingly I wasn't able to run vi, but could run vim. I reported to the github issue tracker.

This seems very neat. Definitely much less overhead than VirtualBox. Plus can write to the same filesystem as windows without windows admin privileges (which can be done with cygwin, but not with virtualbox). Once it supports x86-64 binaries and threading and users, this could be very useful.

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

#110
post #69
post #47

Earlier quoted context omitted.

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.

For the uninitiated this looks completely barbaric, but makes a whole lot of sense when you consider that PS is built around an object-based pipeline. 'Select-String' in PS doesn't actually return a string, but a 'MatchInfo' object, which contains more properties -- 'linenumber', 'context', etc, as well as the 'line' property which contains the actual matched lines as strings. The default output from any part of the…

You also don't technically need to go through Select-String if all you care about is the line itself:

    (gc file.txt) -match "Pattern" | Out-File t.txt
Comparison operators that get an array as their left argument return the items where the comparison returns true.
Post reply on HN