111 points · by pmarin · 4y ago · 51 comments
[1] https://github.com/QubesOS/qubes-issues/issues/2809
[2] https://reactos.org/forum/viewtopic.php?t=16480
[3] https://github.com/Jeeppler/QubesOS-notes/blob/master/ReactO...
The hardware X server runs in a secure X VM, which has exclusive access to input devices, the GPU, and the physical frame buffer memory. (Ordinary X gives all programs access to all traffic from all input devices, and the whole frame buffer.)
Each client VM runs an X server that really only manages window contents. These windows are mmapped to memory the secure X VM exposes from its address space, It copies pixels from the shared regions to the real frame buffer. UI events that happen in each such window are forwarded to the client VM that owns it.
Regular desktop "panel" widgets and other UI stuff is managed by the secure X VM.
USB devices can be attached, via the secure X UI, to a chosen client VM, or taken back. Likewise, input devices such as microphones. The VM only gets PulseAudio streams forwarded from a microphone, and has no access to the sound chip.
The only awkward thing is that client VMs have no access to any GPU acceleration. This is not a problem for normal use -- browsers all can use CPU-only graphics modes, and they are fast enough for the usual things, including youtube videos, albeit with increased power consumption.
Regarding HiDPI and XWayland, there is work-in-progress PR[1] that so far is being ignored by the Wayland developers.
[1] https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests...
The reviewers have asked for some details about the changes and no response yet, it seems unfair to blame the maintainers here.
But of course that goes against the narrative of "Wayland bad".
As for Wayland,
https://wiki.openjdk.java.net/display/wakefield/OpenJDK+Proj...
> It is very unlikely that distros will be ready to ship all the pieces we need in the next 12 months. So the "short term" goal may actually need to wait for somewhat longer than that.
https://wiki.openjdk.java.net/display/wakefield/Meeting+Note...
The way you made your remark could be understood as if nothing was being done at all.
Well, there is a wlroots impl, so I've just added a couple lines to wlroots to invoke this support from an env variable without having to modify the actual compositor :D
https://github.com/unrelentingtech/wlroots/commit/5b8308651c...
but the wlroots impl isn't merged either, so I think there's kind of a mutual dependency here. Either your MR or the wlroots MR should go in first!
Just curious, what are the Wayland developers expected to do? This seems like an Xwayland and compositor implementation issue.
Feel free to improve and/or review it. Maybe it's very important to you. But it may no be very important to other contributors, and said contributors are just volunteers.
It... doesn't seem like it is, really. Couldn't we modify the X server so clients just can't do that anymore? And then introduce a new X extension that provides for cases where this does need to happen, like the window manager (which could be granted blanket permissions), and other apps that would cause a dialog to pop up where the user could approve or deny access (think apps that take screenshots, or video conferencing apps that share the screen or specific windows with other participants). This permissions dialog could be handled by the window manager, or perhaps some standalone app that is somehow securely registered with the X server via this new X extension.
I expect there are some other issues (and things that will break[0]) with apps not knowing about other apps' windows, but I'm not convinced those issues can't be solved. I could even imagine that this new regime might only implement partial isolation, where clients can't read pixels from or fake events to other clients' windows (among other things), but can know the sizes and positions of other windows, and maybe even read some whitelisted set of window properties. I think that would still address most, if not all, security concerns with the current model.
(Just to present some credentials so this doesn't come off as a clueless, "duh, this is so easy, you morons"-type post: I've written an X11 compositor, hacked on a window manager, built a simple toy WM for fun, and was once a co-maintainer of a reasonably popular desktop environment. So I'm not a complete noob here.)
Certainly there are other benefits to Wayland over X11, not just security: greatly simplifying the graphics situation, moving the compositor into the "server" where IMO it belongs, etc. But I'm still not completely sold on the idea that this is worth a multi-decade project to completely replace this critical bit of the Linux GUI stack.
I'm also not convinced that the X server can't be extended in other ways to fix other deficiencies. Of course, at the end of the day, I'm not doing the work, and the nature of open source means that if everyone wants to work on Wayland and no one wants to work on X11 or the xorg server, that's just the way it will be. But it feels like if we'd put even a fraction of the Wayland effort toward making X11 better, we'd be done by now, and people writing X11 applications would mostly not have had to do all that much work to migrate (and many wouldn't have to do any). Would it be as objectively "good" as Wayland supposedly is? No, probably not, but perhaps that doesn't matter.
[0] One thing I can think of here is that some applications need to open more than one connection to the X server, and the X server would see them as separate clients. That could break an application that expects to be able to share and manipulate resources between the multiple connections. But perhaps that could be worked around by grouping permissions not solely by connection, but by process ID. There are probably still some edge cases here, but I think changing the apps here would be ok to do; at least, it seems like less work to accept this sort of breakage and try to fix the apps rather than develop an entirely new windowing system!
security was only a footnote in the list of arguments of why X has/had to go.
X11 maintainer Daniel Stone's[0] very funny but also educational talk[1] from 2013 linux.conf.au has a lot of the gory details that make you say thank fuck and good riddance. The talk will make you feel truly grateful instead of nostalgic. Anyone who missed the 3 decade long discussion of why X is bad give it a go (it'll put good cheer in your heart I promise).
> I'm also not convinced that the X server can't be extended in other ways to fix other deficiencies.
it's not about whether anyone _can_ but if anyone should and is willing to do so is the right question (that Daniel's talk answers).
BUT X IS THE UNIX WAY! << so what is the 1 thing X does, and what is it doing well?
Provide an X server :-P.
The Unix Philosophy not only isn't really a philosophy but also isn't meant to be a dogma - it is meant to be a guideline that, when it makes sense, can be bent.
For example not even the original Unix kernel followed the Unix philosophy because sometimes you need some programs to do more than one things - often in order to enable other programs focus on their "do one thing well" aspect (e.g. window managers).
That... Isn't entirely fair. UNIX Philosophy is usually applied at the program level. You're talking the entire X stack, which, like it or not, started as "Network agnostic graphical computing" which was composed out of a handful of programs, and a protocol.
Now. We all know it isn't that now; and I don't buy that it's all X's fault. You have what, going on 40 years worth of dead ends there, that obviously someone thought was going to be important at some point, but which also were emergent outcomes of a bunch of companies doing, among other things, pursuing their own ends without tipping their hand to everyone else trying to yoink an idea or two. If you don't think X suffered for it, I'd like to point you at the rats nest of abstractions you end up having to navigate. And no, a compositor doesn't magically make it go away. Further, how many people here discussing/developing/opining have read, understood and reasoned about the source as a whole to the point of actually getting something working?
I'd wager not many. Next time I have a few months, it's on my TODO list. I have gone through the X.Org Dev docs a couple times though. Need to probably print it out and do some bookmarking to build up my haptic recall model for it.
You WILL be running a Wayland desktop in the near future. Xorg itself is already unmaintained abandonware. The next step is deprecating and removing X support from the major toolkits. Beyond that, who knows. Probably Xwayland itself will be deprecated and removed too.
Best to suck it up, burn your X config to the ground, and start afresh with Wayland. If it's janky, submit bug reports or PRs. Just rip the band-aid off already, because nobody wants to hear your hemming and hawing when the axe finally comes for X.
I'm not going to go over the whole video since it was primarily made for entertainment and therefore any point can be defended by "he was exaggerating for comedic effect". Invoking this video is akin to invoking late night tv hosts when talking about politics.
And then of course he also has some valid points which are unfortunately diminished because the uninformed watcher will not be able to distinguish them for the invalid points.
The limitations that are there are very minor and if someone cared they could be completely eliminated. As you wrote, Xorg is opensource - which also means that these limitations exist since there wasn't much of an interest towards addressing them.
Though there is also the bureaucracy aspect - in recent years i've been trying to provide fixes, improvements, etc on various open source projects i'm using and i've noticed that the more involvement there is by companies in a project, especially among maintainers, the more bureaucracy and harder it is to get things merged to the point where whenever i see an issue with something that has at least one bigger company behind it, my first instinct is to make my own fork, fix it there and leave it at that. Or not bother. Projects that are primarily run by volunteers tend to be way easier to get involved with.
But there isn't really any core limitation of how X works that couldn't make it so that, e.g., some "privileged" applications (like the window manager) can decide what other less privileged clients can see and even create "domains" on the fly (as far as the applications are concerned it'd be like clients connecting/disconnecting from the server) for applications to see each other if needed. It could be possible if there were people interested in it (and interested enough to implement it, of course :-P).
I prefer not to use email for most things because then the reply only benefits one person, whereas replies in a public forum can be read by others and get indexed by search engines.
I've been thinking about creating a Matrix room for each blog post as a discussion forum, but so far most posts have ended up on other discussion sites anyway.
Still close to unusable: Web conferences in the browser (webex for example).
To me it seems that the author doesn't list contact details on purpose. There's an extensive "about me" section without any contact information, so I think the author might wish not to be contacted.
Edit: actually, his Gmail is in one of the screenshots in this article.
the linked code about vim is incredible tho (and not the good kind of it), I have actually spent a good part of my evening trying to understand how they end up with that implementation (I do have the same kind of spaghetti code and wonder the same about my code) :
https://github.com/vim/vim/blob/9cd063e3195a4c250c8016fa3409...
Maybe you should know about the project SpectrumOS, which seems to have extremely similar goals to yours.
I think instead of running persistent VMs for different roles, it spins up VMs very quickly to run individual apps in.