Cocoa-Way – Native macOS Wayland compositor for running Linux apps seamlessly (github.com)

by OJFord 111 comments 331 points
Read article View on HN

111 comments

[−] cyanmagenta 49d ago
Forgive the naivety, but what graphical Linux apps are people trying to run that don’t have native MacOS builds? In my experience, Linux GUIs are generally written in Qt or GTK, both of which are multi-platform.

I don’t doubt that they exist, I’m just struggling to think of a popular example.

[−] fny 48d ago
That's not the use case. The use case is running apps from a remote Linux host as a local window. A performant VNC for specific windows if you will.

For example, you could run VS Code on that machine as a window on your Mac. A more real world example is people accessing guis (e.g. matlab) on lab clusters.

The closest set up for x11 would be to use x11 forwarding with xpra.

[−] QuantumNomad_ 48d ago

> The closest set up for x11 would be to use x11 forwarding with xpra.

Older versions of macOS even had an X server distributed by Apple that you could install on your machine, and if memory serves right you were then easily able to forward X11 from a remote Linux host (or other operating systems running X11 applications) using ssh and have it render to your macOS desktop.

From a quick google search there is apparently still an Apple supported third-party open source project called XQuartz one can use.

https://en.wikipedia.org/wiki/XQuartz

X11 forwarding with ssh and XQuartz looks to work the same way that I remember using the Apple distributed X server in the past. Install the X server and then use the -X flag of ssh. Same way that you forward X11 between two Linux computers, or Sun workstations or whatever with an X11 desktop, over ssh.

https://docs.cse.lehigh.edu/xforwarding/xforwarding-mac/

[−] fouc 48d ago
I tried that a few times back in the day, but I found it so jarring & ugly against the macOS GUI. The problem was that it was rendering the application alone, for a seamless integration. I don't remember if there was even an option to run a compositor or window manager such that you had a proper window with it's own background and the linux apps show up inside that (like the cocoa-way example).
[−] nunez 48d ago
Used to use XQuartz often years ago for (I think?) forwarding Firefox running in containers for browser-facing integration testing. It was pretty slow IIRC. Switched to VNC, which worked much better.
[−] LeFantome 48d ago
This is Wayland. You could use xprs
[−] vasvir 48d ago
wprs? Does not work for mac yet IIRC...
[−] adastra22 48d ago
Or running applications within fully sandboxed VMs on the local machine, but with native-ish forwarded GUI. Great for dev.
[−] semi-extrinsic 48d ago
We run TurboVNC from macOS to beefy Linux servers on the daily. Just tunnel the connection over SSH. It's been solid for 5+ years.
[−] varispeed 48d ago
Isn't better to run native VS Code and have remote SSH session? It very much works as if it was local (on fast low latency network). Only issue is moving files.
[−] LeFantome 48d ago
This is Wayland. You could use xprs (or Waypipe).

Sorry, I responded to the wrong comment.

[−] audunw 49d ago
Popular apps? Probably not many.

But in the field of integrated circuit design there’s lots of apps that are Linux-only. I’ve tried to run some of them in containers on Mac. But XQuartz is awful.

If they ever transitioned to Wayland perhaps this would let us run these apps on Mac in a nice way.

On the other hand some of them have started getting ARM builds (for running simulations on certain cloud environments) so maybe native Mac GUI builds could happen someday soon.

[−] addaon 48d ago

> But XQuartz is awful.

What issues are you seeing with it? I use it pretty heavily and have no complaints…

[−] bitwize 48d ago
The biggest issue I found is that X apps look like ass against the elegant Mac environment. Maybe that's mitigated somewhat by macOS 26's Android-ass looking UI, but the appearance/functionality clash between Mac and generic Unix was a major issue before.
[−] fouc 48d ago
I agree, I think the problem is the seamless integration, where it renders only the application against the macOS environment. I'd much prefer something more like the cocoa-way example where there's a window that has its own background, and the applications run inside that. Not sure if Xquartz supports running a compositor or windowing manager.
[−] bitwize 48d ago
XQuartz used to support rooted mode. I played with an early version back in the PowerPC era, and ran a regular desktop with WindowMaker and everything, using software from MacPorts. It was kind of a "parallel universe", as XQuartz would take over the whole screen in rooted mode and you had to switch between it and the Mac desktop, but it looked and functioned like a typical Linux or Unix desktop of the early 2000s.
[−] MBCook 49d ago
What about this plus XWayland? Would that do it?
[−] jon-wood 49d ago
This is very interesting to me for two reasons:

1. I'd really like to run my development environment for things under Siri for its tiling window management but for better or worse I'm deeply embedded in the Apple ecosystem for everything else, this looks like it could be a really nice way of doing it (possibly once multi monitor support is in).

2. There are still a few applications which have supported Linux builds but no support for macOS (Iridium's Niagara Workbench application for configuration of building management systems springs to mind here). Since Apple ended support for Quartz this has been a bit of a pain to deal with.

[−] xlmnxp 49d ago
I want to use KDE Plasma instead of Mac OS ugly (in my opinion) interface
[−] vovavili 49d ago
This is possibly the first time in human history this opinion has been stated.
[−] coldtea 49d ago
Then you want to run KDE on Linux. This is not going to replace your native mac desktop environment.
[−] MarsIronPI 49d ago
Honest question: why use MacOS at all then? If you prefer KDE, why not run a system that KDE natively supports? Is it a particular MacOS application? Or is it that Linux support on Mac hardware is not good enough?
[−] ubercow13 49d ago
Apart from just running Linux apps, you can use this to run graphical applications remotely on a Linux server, like X11 forwarding.
[−] boschetto 49d ago
I think there are many use cases for this software.

For example, you may not want to run some graphical applications directly on your Mac for security, isolation or testing purposes.

If this software turns out to be lower latency than RDP and CRD, I could also see it being very useful for accessing a remote graphical workstation (e.g.: running heavy software on an beefy machine in a data center instead of taking up resources on my skinny laptop).

[−] pxc 38d ago
I use Linux VMs on macOS mostly headless via OrbStack. If it was convenient to run an individual window from the GUI in a way that felt native and performed well, I might run Emacs and Firefox from Linux instead of on the macOS side. Then I could manage them more via NixOS mechanisms instead of the janky options available on macOS. Plus in the case of Emacs, filesystem performance is still way, way better on Linux for some common tools. Git and Magit just perform massively better.
[−] OJFord 49d ago
It's not necessarily something only available for Linux, but something that you want to containerise. (And then it's inherently running on Linux.)
[−] okayokay123 49d ago
Emacs runs much faster and better on Linux VMs. And I have a VM for each client I work with.
[−] e40 48d ago
I run emacs on linix in X11 mode and display on my mac with Starnet’s FastX. Been doing this since the product was released, and was a customer of their X server before that.
[−] bigyabai 48d ago
Native GTK apps on macOS are often more broken than running it in a VM or Parallels, in my experience. I used to use Gitg on macOS and it was a terrible experience all around.
[−] addaon 48d ago
There’s a bunch of old Fortran stuff I use regularly (AVL, XFoil), but that’s all X, not Wayland, and XQuartz has worked great for decades.
[−] LeFantome 48d ago
The first thing I wondered about was running GUI apps in a Linux container.
[−] pajko 49d ago
PuTTY
[−] hrmtst93837 49d ago
[flagged]
[−] jbverschoor 49d ago
Perfect.. this will allow me to run GUI apps in a container.

I did a similar thing with X11, but I didn't like so much.

Bit by bit, Apple is loosing it's Desktop position. It all starts at the developers. At soon, every person will be a "developer".

[−] skrrtww 49d ago
This looks like slop? The README is full of emojis and kind of incoherent, there are no implementation details, there claims to be a Metal backend that doesn't seem to exist, etc.

The dependency list is also...something: https://github.com/J-x-Z/cocoa-way/tree/main/vendor

[−] Imustaskforhelp 49d ago
Very interesting, can this run something like android using waydroid within Orbstack too?

It would then essentially run android on macos as well, I do feel like it should be possible.

[−] jFriedensreich 48d ago
I need something like this for android, termux-x11 is a good start but if termux gets wayland support or there is a way to expose wayland sockets from the android native linux VM, the only thing missing is a native rendering compositor for a smoother experience
[−] BirAdam 49d ago
Now, if only macOS still had the ability to drop to a Darwin shell without a GUI at all… we could just have a nice UNIX with something like KDE or COSMIC, brew as our package manager… what a dream.
[−] tsuru 49d ago
Wow. Would this allow a macos-based wayland-client to create an EGL surface?
[−] IshKebab 49d ago
Neat, but wouldn't it be better to have the windows as "seamless"? I.e. not contained within another window.
[−] kogasa240p 49d ago
Wonder if this will bring at least a tiny amount of interest to GNUstep.
[−] anArbitraryOne 49d ago
Now if we could switch MacOS to use Win/Linux keyboard commands, MacOS wouldn't be so insufferable
[−] LoganDark 48d ago
Server-side decorations "with shadows and focus indicators" -- is it not using macOS's native window chrome? Pass... Add OpenGL instead of Metal, and hard pass.
[−] pugchat 49d ago
[dead]
[−] lzhgusapp 48d ago
[dead]
[−] jeremie_strand 48d ago
[dead]