13 ms·
Foreign Linux: Run Linux binaries on Windows without drivers or modification
- kikki 12y agoSo 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 hope it works out.
- spurgu 12y agoI think it would mainly be used by Linux users forced to use Windows for some reason (at work, for example).
- sunilkumarc 12y agoI totally agree with you. Some of us who really like Linux are forced to use Windows at work. This project is really going to help a lot of people :)
- wampus 12y agoBut if you can run this, you can run VirtualBox, which is a much safer alternative (and simpler, if a live ISO meets your needs).
- usefulcat 12y agoBut not equivalent for some use cases. Like, say I want to use 'find' (not windows find.exe) to find files on a Windows filesystem.
- leni536 12y agoWhat I typically miss on Windows is "rsync".
- cgh 12y agoUnfortunately, a vm solution won't work with certain vpns, such as Cisco's. I know firsthand as I've tried it.
- copperx 12y agoForcing 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.
- aaronem 12y agoLinux already does plenty to bring Linux users back to Windows. What’s this going to hurt?
- sengork 12y ago"Linux services for Windows NT"
- jkot 12y agoCool. CoLinux does something similar
- elcct 12y agoI thought it's been dead for ages
- derekp7 12y agoThis is one of the things that's always driven me nuts on Linux, and also one of the things I really like. Some projects that are interesting like this seem to disappear for a while, but often the concept will be resurrected under a new project. CoLinux is one of them, UserFS (now FUSE) is another one that went away for a couple kernel versions and is now back. I'm still waiting for an SSI (single system image) to make a comeback though (Mosix, OpenMosix, OpenSSI, but none of them work with newer kernel versions).
- jdboyd 12y agoI thought that CoLinux was actually running Linux as a service in the NT microkernel (like MkLinux on Mach), rather than just an executable compatibility layer.
- sspiff 12y agoThis is brilliant! Much more light weight than a VM. I hope they can iron out the remaining kinks. I used coLinux many moons ago, but it hasn't been updated in any significant way lately, and still doesn't work on 64-bit Windows.
- sz4kerto 12y agoIf 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.
- ryannevius 12y agoIt's not quite the same...but Git Bash for Windows[1] is an awesome substitute for the Windows command prompt. [1] http://git-scm.com/downloads http://git-scm.com/downloads
- babuskov 12y agoAFAIK, that's actually MSYS. But since I need git anyway, I'm using exactly that, together with MinGW-w64 and it works quite well.
- cssmoo 12y agoTo 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 :(
- joelthelion 12y agoWhat 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.
- cron 12y ago`select-string` or it's alias `sst`. I find myself filtering collections of objects far more frequently then grepping lines when using powershell.
- 12y ago
- vander_elst 12y agovery nice project! I hope it takes off running applications on cygwin can be a pain
- mappu 12y agoCygwin 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/ 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 have the source code. For me there's not very much of that although i release some at $DAYJOB.
- mijoharas 12y agoFor me I've had too many problems with cygwin and $DAYJOB installs BLODA, so I'm really interested to see what comes of this, also since it uses arch and pacman, which are my distro of choice, it sounds pretty perfect to me! (no more having to recompile everything from source with cygwin or `rebaseall` and suchlike)
- Surio 12y agoHmm, Have you looked at http://mobaxterm.mobatek.net/ http://mobaxterm.mobatek.net/ before. I found this less of a hassle to install and work with, than cygwin.
- mijoharas 12y agoHmm... seems interesting, I still like the idea of this foreign-linux, it seems like the idea has a lot of potential. Thanks.
- dhimes 12y agoBLODA: Big List Of Dodgy Apps
- lelandbatey 12y agoI 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.
- sgt 12y agoCmd.exe is an abomination though - and Cygwin defaults to using it for terminal use. I see that this project also does that.
- _pmf_ 12y ago> Cmd.exe is an abomination though - and Cygwin defaults to using it for terminal use. I see that this project also does that. Use http://mridgers.github.io/clink/ http://mridgers.github.io/clink/ It is not an alternative terminal, but injects itself into every cmd process to allow completion, better key handling etc. I was skeptical at first, but it's a really, really great tool.
- rossy 12y ago> Cmd.exe is an abomination though Agreed, but I don't think Cygwin defaults to it any more. It uses mintty now, which understands Cygwin ptys and has a native Windows interface. I guess you could also use an X11 terminal emulator in this project.
- sspiff 12y agoCorrect. Cygwin has used mintty as a default since 2011[1]. [1]: http://cygwin.com/ml/cygwin-announce/2011-11/msg00040.html http://cygwin.com/ml/cygwin-announce/2011-11/msg00040.html
- Zr40 12y agoCmd.exe isn't a terminal emulator, it's a shell. Conhost.exe (and before Windows 7, csrss.exe) is the process behind the terminal window.
- amyjess 12y agoCan't you use cygwin with PowerShell?
- ygra 12y agocmd.exe is _not_ the console subsystem. It's just another program running in it. If you run bash, there's no cmd to be found anywhere. Just as your shell is not your terminal emulator the same holds true on Windows.
- Intermernet 12y agoFirstly, this looks brilliant. If anyone can remove the extra layers of cygwin, mingw, xming etc. and provide a direct ability to execute linux programs from powershell/cmd , I call Black Magic. Voodoo I tell you; Windows cannot be this user friendly (I work with it every day). Secondly, completely off topic, I noticed that Github picks up 0.4% of the code-base as Objective-C (https://github.com/wishstudio/flinux/search?l=objective-c https://github.com/wishstudio/flinux/search?l=objective-c) due to the files functionally consisting of a single line, `#pragma once`. Is this statement more common in Objective-C than C or C++ ? Just wondering if Github detects the language based partly on some statistical analysis of other existing code, or if it has "set rules".
- matthewmacleod 12y agoGithub's language detection is actually open-source — you can have a look at what it does here: https://github.com/github/linguist https://github.com/github/linguist Linguist uses a number of different 'strategies' to identify the language – in the case of C vs. Objective C, it uses a pretty simple heuristic (https://github.com/github/linguist/blob/master/lib/linguist/heuristics.rb#L83-L90 https://github.com/github/linguist/blob/master/lib/linguist/...) to disambiguate C/C++/ObjC where required (such as in header files, which can't be disambiguated by file extension.) In this case, the content of the file can't be reliably disambiguated, so I imagine it'll probably fall back to the Bayesian classifier. Interesting that the classifier identifies it as Objective C though!
- Intermernet 12y agoThanks for the link! Time to do some reading.
- pbhjpbhj 12y agoI'm not a programmer so bear with me. They have a cadre of samples in the project, searching on "#pragma once" shows no examples of Objective-C (that I can see) using that line but does show C/C++ examples with it. Is that the input to the classifier? The heuristic you linked appears to default to identifying as C; that regex doesn't look like it has anything to make the else-if return the sample as Obj-C. I'd have expected the fact that most other files on the project were C to be the dominant factor that - without any other positive result in the classifier - would weight the files as being C. Presumably this data isn't used in classifier though? Interesting.
- VSpike 12y agoAlways nice to have more alternatives, but I find either http://bliker.github.io/cmder/ http://bliker.github.io/cmder/ (a tricked out console with a nicely tweaked git bash environment) or http://babun.github.io/ http://babun.github.io/ (Cygwin but easier to install and with nicer defaults) better for daily use when forced to wallow in the Windows pool at work.
- cturner 12y agoAs cool as this is, a remaining problem I'd have for using Windows is that I've found git to be slow there. For example, the responsiveness of 'git status'. I'd guess this is something to do with NTFS being optimised for things different than unix-tradition filesystems. If so, this tool wouldn't improve that. Does anyone know more about this area?
- babuskov 12y agoGit is built for Linux and relies on some features of Linux filesystems for speed. As long as underlying filesystem is NTFS, there's no way to speed up Git. Although, the "Support NTFS native hardlinks and emulated symbolic links" could be relevant if it does some magic there.
- eps 12y ago> Git [...] relies on some features of Linux filesystems for speed. Modern NTFS versions support all the things that git needs, so it has less to do with having magical features in Linux filesystems per se and more with the fact that they aren't properly mapped onto respective NTFS features in the abstraction layer (MSYS or similar).
- ygra 12y agoI wondered about the emulated symlinks here, though. NTFS supports symlinks just fine or maybe I'm not aware of a crucial difference in how they work in NTFS and Linux filesystems.
- Surio 12y agoThis looks like an interesting project to keep an eye out for. On the topic of cygwin, I would also like to recommend mobaXterm, that I use instead of cygwin nowadays... It is an interesting choice in the alternatives we have. So, those of you that use cygwin, take a look at it here: http://mobaxterm.mobatek.net/ http://mobaxterm.mobatek.net/ If you are thinking about trying cygwin, I would recommend this instead, as the installation is relatively easier when compared to cygwin. (I have no affiliation to mobaxterm) Another new indispensible tool for me is cmder, which leverages ConEmu, clink and mysysgit to provide a wonderful UX in the commandline for me - just brilliant. Here: http://bliker.github.io/cmder/ http://bliker.github.io/cmder/ Memo to self: Spend the next 4 months learning powershell during lunch breaks!
- ctb_mg 12y agoUnfortunate that MobaXterm is not free (as in freedom) software, but looks VERY nice from the website. I'm very tempted, although I don't do much remote administration anymore.
- bryanlarsen 12y agoThe big problem with MobaTerm is that it includes really old versions of the standard unix utilities, and it's difficult to integrate with newer & missing utilities. This isn't a problem that's limited to MobaXTerm, but the way MobaXTerm does things makes it harder to fix. Let's say you want to set up a standard dev setup. So you install MobaXTerm, vagrant, emacs, msysgit, and rsync. Each of these require SSH for full operation, so in the interest of making things easy, the installers bundle SSH. You now have up to 5 copies of SSH installed, all storing their private keys, cert stores and configuration in different places. What a mess. And some things aren't compatible with each other. IIRC, vagrant is built with cygwin, so you have to make sure you use a cygwin rsync with it, the msys rsync won't work. To keep everything sane, start with the standard cygwin or msys installer, and install everything using that. Does conemu include mingw-get? If so, that sounds like it might be a good solution. If not, I recommend avoiding it. Or just reformat and install Linux. That's what I ended up doing. Putting up with poor HiDPI support in Linux was much more tolerable than the horrors of trying to use Unix utilities in Windows. And HiDPI support is improving quickly in Linux land....
- shiggerino 12y agoI don't understand what this is supposed to accomplish. What's the advantage of building on GNU/Linux and running on Windows compared to building on Windows and running on Windows? Seems like it's needlessly complicating things making a binary compatibility layer.
- zoidb 12y agoFor people who are required to have a machine that boots into windows because of corporate policies at work maybe?
- kyberias 12y agoIt's trying to accomplish exactly the same as Wine, only vice versa. There is a considerable amount of software written and compiled for Linux that is not available on Windows.
- fijal 12y agoThis 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.
- emodendroket 12y agoI remember from trying to use Linux on a desktop machine (and this was like a decade ago so maybe it's no longer relevant) that graphics drivers were often distributed only as binaries.
- towelguy 12y agoAnd I remember (from a decade ago as well) having to recompile my kernel to use those binary graphics drivers :)
- xioxox 12y agoThe 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.
- kyberias 12y agoThis has been tried before as the author notes. E.g. http://lbw.sourceforge.net/ 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.
- JoshTriplett 12y agoThere's also LINE and coLinux.
- david-given 12y agoHey, I resemble that project! Yeah, it ground to a halt due to fundamental differences in the way Linux and Windows binaries work. I'm actually now kind of scared at how much working hackery LBW ended up containing: it'd dynamically patch the binary after trapping out at instructions manipulating things that Windows wouldn't allow access to. (The LBW instruction patching code is here. It's entertainingly bonkers. http://sourceforge.net/p/lbw/code/ci/master/tree/src/ehandler.cc http://sourceforge.net/p/lbw/code/ci/master/tree/src/ehandle...) Not all the horror was Windows, mind: Linux's interface to executables is barely documented and extremely fragile, involving passing a key-value table full of magic parameters on the stack after the argument and environment tables. And, of course, I'd have to replicate this otherwise glibc would crash out. (At least, I thought I did --- I cannot now find any of the actual code. Maybe I got rid of it?) I eventually gave up because it was obviously not a tenable approach. Plus, it'd completely fail on 64-bit platforms. Dynamic recompilation is obviously a way more preferable approach. If I ever have to use Windows again, god forbid, I'm definitely checking this out.
- 72deluxe 12y agoVery impressive. I'd appreciate if they could get WINE working under this though..... :-)
- deevus 12y agoPersonally I have been using Scoop with ConEmu. I find that is enough for most things :) http://scoop.sh/ http://scoop.sh/ http://www.fosshub.com/ConEmu.html http://www.fosshub.com/ConEmu.html
- justincormack 12y agoMidipix is due soon and provides a system call interface for Windows and a Linux libc.http://midipix.org/ http://midipix.org/
- heywire 12y agoUnfortunately seems to crash immediately on Windows 10 Tech Preview (build 9926). It's what I can expect for using a prerelease OS though. Edit: It looks like this might have been something on my end. Re-downloaded and extracted and it seems to be working now.
- deleted 12y ago[deleted]
- anotherevan 12y agoThis reminded me, with some nostalgia, of a long time ago using Cooperative Linux on my work Windows machine with sole intent of being able to use Amarok as my media player. (Version 1.4, before Amarok turned to crap. I use Clementine now, which has a native Windows port.)
- gtwy 12y agoDoes this support running X over SSH? The biggest drawback for me with Windows boxes was always a lack of X support for applications I want to run on remote servers.
- fizgig 12y agoYes. From the stock bash prompt, run "startxwin". With the resulting xterm, you can launch any X apps within Cygwin, or you can SSH in (with appropriate flags and xauth config, etc.) and blow back X apps from the remote Unix box. It's really nice.
- icebraining 12y agoIn my limited experience, Xming worked fine for that use case.
- alisnic 12y agothis is the exact opposite of WINE, implements linux sys calls in windows
- tlb 12y agoI really want Linux emulation for OSX, which should be much easier. FreeBSD had very usable Linux emulation on a similar kernel.
- malkia 12y agoWondering how well fork() works?
- RDeckard 12y agoI 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 from the forked process will be visible in the parent. These are not correct semantics for fork. I am hoping I misread the code and someone can prove me wrong here, because it looks like a cool project with a lot of potential.
- malkia 12y agoFrom 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-sensitive names for the filesystem) BTW, the coolest usage of fork(), and granted a pain in the ass to port possibly was the one in REDIS where antirez used it to fork() at certain time the current process, then write back the state of memory knowing that it'll get a "snapshot" of it, and if writes to disk succeed, this "snapshot" would correctly and fully be written to the disk. I know there are plenty of other uses (for example this way "lua" can do threads with just a bit of a communication library on top... e.g. any language without explicit thread handling can actually use them). Wondering what made win32k folks disable it. Possibly there are lots of gotchas...
- MichaelGG 12y agoUsing 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.)
- ericfontaine 12y agointerestingly 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.
- abalashov 12y agoI admit that I am a bit lost as to the value of this endeavour, or Cygwin for that matter, in an era where just about all commodity hardware can sustain virtualisation. I used to have the problem of my dayjob requiring me to run Windows and use Outlook/Exchange, and Cygwin was a useful means of coping with that. But that was back in 2006. Now, it seems to me one should just fire up a Linux VM in VirtualBox, full-screen it, and pretend the encapsulating Windows doesn't exist.
- vectorpush 12y agoor Cygwin for that matter, in an era where just about all commodity hardware can sustain virtualisation. I use cygwin primarily as an ssh client for my local linux VMs. My IDE is vim/tmux/zsh, and I've found ssh via cygwin provides an experience that closely resembles gnome-terminal in appearance and behavior (gnome-terminal being the best terminal emulator around IMHO)
- Scarbutt 12y agoseems overkill, wouldn't just putty do in your case?
- vectorpush 12y agoAs I said, I prefer cygwin's look and feel to the alternatives. Also, cygwin supports transparent windows out of the box. I don't think it's overkill at all, the only package you need is ssh, everything else lives in the VM.
- shmerl 12y agoThat's like Wine in reverse?
- bane 12y agoSo this is the opposite of Wine for Windows?
- neiesc 12y agoI am getting error when using go [root@ForeignLinux ~]# gccgo hello.go -o test /tmp/cc06PbMI.o: file not recognized: File truncated collect2: error: ld returned 1 exit status https://wiki.archlinux.org/index.php/Go https://wiki.archlinux.org/index.php/Go anyone experienced this?