Linux subsystem for Haiku


#1

Will Haiku get a “Linux subsystem for Haiku”?

As it’s a must have now for a desktop OS to flawlessly and compatible support Unix development. Even Windows 10 now has the “Linux subsystem for Windows”. This answer (see the second comment by Brian Knapp) explains the popularity of Mac OS X by this factor mostly. Additional details can be found in this answer but that’s not about desktop anymore.

Such system can also export Haiku driver plugins so it can be temporal solution that allows fast usage of Linux drivers in Haiku - so it can be massively usable not in the forever future but right after such system is implemented.


Haiku as ideal virtual machine guest. State of QEMU/KVM/VirGL support
#2

It already have, called POSIX.


#3

That’s good but seems rather useless from desktop user perspective. Thinking about inevitable differences or noting that something wasn’t easily ported is not what the end user wants.

The only thing that Haiku can offer exept nostalgia is consistent and may be better that Linux desktop user experience. Having Linux subsystem is also part of a good user experience. That’s drivers problem aside. if we take it into account: Linux is still worse than Windows and FreeBSD even worse than Linux. Haiku without Linux drivers would be worse or the same as FreeBSD.

That would not be the problem actually if Haiku targets only virtual machines. By the way how good Haiku works with VMware/QEMU drivers? (Especially 3D).


#4

That’s good but seems rather useless from desktop user perspective.

A Linux Subsystem is for running linux programs. But if the same programs are ported to Haiku, then it is useless from the user perspective? Umm…

Thinking about inevitable differences or noting that something wasn’t easily ported is not what the end user wants.

Not the user who needs to do the porting work, but the port-maintainers.

The only thing that Haiku can offer exept nostalgia is consistent and may be better that Linux desktop user experience.

If it is better than Linux desktop, then why should it incorporate Linux? Seems illogical.

Having Linux subsystem is also part of a good user experience.

You haven’t elaborated this, nor your links. I think only BSD-s can provide “good user experience” with Linux subsystem, as it doesn’t need a whole bunch of mess to support it.
Just look at the MS guys, they got everything to accomplish this task yet it takes ages, it still have dealbreaker bugs and constrains. And at the end as far as i can see (but note the fact i’m not a devops or something) the users running bash with it, and installing linux packages. One can do it much “cheaper” (in term of mess and code) with a simple VM.

Linux is still worse than Windows and FreeBSD even worse than Linux.

If it is Windows > Linux > FreeBSD > Haiku, then why do Haiku needs any Linux subsystem? Why doesn’t Linux should have Haiku subsystem?

That’s drivers problem aside.

I don’t think the Linux subsystem in Windows allows to use Linux drivers on Windows. Ofc, it isn’t their focus as Windows got drivers for almost everything.

Haiku without Linux drivers would be worse or the same as FreeBSD.

If it so, then one can just use Linux. Do not misunderstand me, i see your point, you want to see Haiku usable, but really is this the only way?
haiku and the HaikuPorts project got plenty critique (mostly because the package management), that Haiku became way too unixy with the introduction of the PM. Do Haiku need to introduce yet more abstractions layer to be something wich isn’t? Do the users needs another Linux-something, while there are countless Linux distributions in every flavor?

I do plenty unixy thing in Haiku, but i don’t see where and how would a Linux subsystem make my life easier, or my workflow better.
A “sudo apt” certainly not.
The possibilities, that i can use every Linux package? Why not port them and run them natively?
The drivers? Yep, that would be great, but hey, theese drivers are mostly open-source, so one can port them. Wich one is easier? To port and maintain a driver or a whole Linux in Haiku?

And we haven’t even talked about if a “Linux subsystem” is in the scope of Haiku or not.

It is just my 2 cents, but the current computer-development field looks like a whole bunch of mess shoveled on top of a whole bunch of mess, shoveled on top of incompetence.
I definetly don’t need that.

What i would like to see is a small VM subsystem, where one can run different OS fully self-contained way. No direct interaction between the host and the guest. And it should run in headless mode too.
That could be a “linux subsystem”. Or a windows one, or a templeos, if you prefer.

But i personally see no point integrating Linux into Haiku. (You can however explain, how and why would it be better.)


#5

You are mixing different things here.

  1. Running Linux drivers for Haiku: we won’t do this as part of the Haiku project. There is another project called Cosmoe, which was about running Haiku apps using a Linux or BSD kernel (and drivers). Currently no one is interested in keeping this up to date, to my knowledge.

  2. Running Linux applications under Haiku. We are not really interested, because our goal with Haiku is consistency and good integration. This is quite similar to what Apple is doing with Mac OS, in fact. Except our version is fully based on free software.

So, you can easily port command line things (php, MySQL or PostgreSQL, etc will run without too much problems). This covers the main use cases for the “Linux subsystem for Windows” thing. And for the UI part, we prefer to have our own apps, but people have shown it’s possible to get Qt based apps running, and this is how we now have a good selection of ported apps, with great efforts making them look native and work well together with other apps, something Linux still doesn’t really get right, and Linux on Windows even less.


#6

Don’t mind this topic anymore. Right after I wrote it I understood that there’s a better way to go: Haiku as ideal virtual machine. State of QEMU/KVM/VirGL support


#7

So does this mean that I can run a Linux application on Haiku?


#8

The POSIX compatibility allows us in many cases just take the official source code and recompile it on Haiku, without any changes.
So, yes, Haiku can run many programs written originally for Linux, but they need to be recompiled. Depot is already full of programs and libs like that.

But If you meant running linux binaries on Haiku: that’s not possible.


#9

This is the main reason I don’t use Linux.:grinning:


#10

Why don’t you use Linux exactly? What is exactly wrong with it?


#11

What would I need to type in terminal to compile the Linux code to make it work on Haiku?


#12

It depends. Look at the sources, it may provides a well known build system, like autotools, cmake or qmake.

  • If you see autogen.sh / configure files in the source tree, it is a good sign it it autotools based. If configure already here, you have to run it, if not, you should generate it with autogen.sh. Then a simple make should do the trick.

  • If you see CMakeLists.txt in the source tree, it is cmake based, calling cmake . and then make should work.

  • If you see .pro and .pri files, it is qmake based, where qmake . and make should work.

  • If your sourcetree have some Jam* files, it is jam based, and simply calling jam should work.

  • There are plenty other build systems. Note: not all of them are available for Haiku at this moment.

  • If it is just whole bunch of .c/.cpp and .h files, then you are your own.

But clearly this topic is way beyond the scope of the forum, for more information you should check the BeOS: Porting UNIX Applications book, it is a nice read, even if it is a bit outdated.
For up to date info, you should read the user guide of the specific build system.

Porting programs Isn’t trivial, so don’t assume it will just magically work. For real case-studies you should check the HaikuPorts recipes.