16 ms·
Firefox on Unix is moving away from X11-based remote control
- zajio1am 5y agoHmm, so it would not work on systems without DBus? If that is unix app, why not just use unix socket?
- bitwize 5y agoNo, it wouldn't, because why would you run a system without dbus? That's just silly.
- yissp 5y agoCan you use Wayland without DBus? I guess in theory yes, but in practice most compositors rely pretty heavily on it for various other things.
- guerrilla 5y agoDoes Sway use D-Bus? I would not guess that. Enlightenment? I have hard time seeing that.
- IiydAbITMvJkqKf 5y agoSway does not use d-bus. It listens on a unix socket (different from the wayland socket) for control messages. Gnome/Kde compositors don't use d-bus either, they instead use wayland extensions for control (since both the compositors and clients have to implement wayland already anyway, this is easier than using d-bus).
- md8z 5y agoThe GNOME compositor does actually use D-Bus and it is actually much easier to use D-Bus in it than to add new wayland extensions.
- emmp 5y agoSway itself may not use dbus, I think that's right, but a desktop workflow built around sway for day-to-day use will typically utilize DBus for e.g., pipewire, a notification daemon, xdg-desktop-portal (screen sharing) at the least. But you are right of course that these are not sway and you don't need to use them. A typical user would need to be motivated to actively avoid it.
- deleted 5y ago[deleted]
- guerrilla 5y agoIt says if it's built with D-Bus, so presumably you can still just build it without it for now.
- viraptor 5y agoDbus is available on most systems now. I don't know what's the reason for the authors, but in practice with UNIX socket, you have issues like "which instance owns the socket", "how are the requests distributed", "how does an instance know the current handler died", "how to serialise and version the remote requests", etc. Dbus solves a lot of that without (effectively) designing your own custom underspecified version of half of dbus.
- zajio1am 5y ago> but in practice with UNIX socket, you have issues like "which instance owns the socket", "how are the requests distributed", "how does an instance know the current handler died" While bus-based publish-subscribe paradigm may have some merit in desktop setting, for direct control the client-server is much more straightforward, and in this case these answers are easy. Each instance owns one socket, if there are multiple instances and not a default one, a client needs to know which to connect to (as they are generally not interchangable), and even if they are, a client can just enumerate sockets and open the first alive. > "how to serialise and version the remote requests" These issues are irrelevant for connection-oriented and reliable unix sockets. > Dbus solves a lot of that without (effectively) designing your own custom underspecified version of half of dbus. Not really. Connection-oriented client-server solution is just much simpler that dbus and offers some advantages like implicit state associated with connection. Dbus makes things much more complicated and then solves some of these complications.
- md8z 5y ago"These issues are irrelevant for connection-oriented and reliable unix sockets." This comment is really confusing to me. It's not irrelevant, you need to serialize the messages somehow. And if you ever decide you want to add some new messages, then you have to deal with versioning. It's not simple. What you have described is just a cut down implementation of D-Bus. And you are leaving some other things out: - race-free name resolution, the solution you described has a lot of race conditions - message ordering, the best way to do this reliably across 3 or more processes is to use a bus-based method - security, auditing, rate limiting, i.e. how does a system admin manage your service. This is all solved with D-Bus I've seen lots of complaining about D-Bus over the years about how it's "too complex" but everything in it is there for a reason, and I've never seen anyone actually able to make a simpler design that works as well. If you implement all the stuff I just talked about then your solution will be about as complex as D-Bus. So in terms of message buses I actually think it is quite simple compared to other things like ActiveMQ. Please stop implementing ad-hoc protocols over a socket unless you have a really good reason to do that, it drives me nuts to see that stuff getting deployed and people going through the motions fixing the same bugs over and over. At the very least you could use protocol buffers, or use ASN.1, or re-use the D-Bus wire format, or do anything besides rolling your own.
- jmclnx 5y agoI am curious about this too. On OpenBSD I set export DBUS_SESSION_BUS_ADDRESS="no" to avoid Firefox from starting dbus, which is a Linuxism ported to BSD just to allow people to execute some applications. That works fine for me. So since this is removed and Firefox is the only app that I use which needs dbus, I wonder if I will be required to use yet another useless (ie: not needed by OpenBSD) process just to use Firefox.
- phone8675309 5y agoIt's weird watching the Linux development community go from the position that Windows apps tightly coupling to Windows was bad because it made those programs more of a pain to run under Linux (most of the time requiring Wine) to deciding that sticking with cross-UNIX platforms was just no longer worth their time because Linux "won" the UNIX wars.
- pxc 5y agoDBus (the software, rather than the protocol) isn't required on Linux anymore than it is on OpenBSD. It's required by the Plasma and GNOME desktop environments, most KDE and GNOME applications, and any other desktop environments or applications that want to use it. It's also cross-platform, and runs natively on OpenBSD, NetBSD, and FreeBSD. It does not leverage a compatibility layer, and depending on it is in no way comparable to requiring an emulation layer like WINE.
- TingPing 5y agoDon't compare Linux and Windows, thats in bad faith. Developers just want to accomplish the best software they can, its all done in the open, but that doesn't mean they have to design software for other systems with different capabilities.
- rjsw 5y agoI build Firefox without dbus for NetBSD, current version works fine.
- md8z 5y agoI would be really interested to know why people seem to think D-Bus is a "Linuxism". It's a pretty small daemon with an Apache-style license and upstream support for BSD. The only thing I've heard are comments like this where people find that D-Bus is required to run some GTK or Qt application, and those toolkits are viewed as being "Linuxisms", so people put it in that bucket transitively. Is there another reason I missed here?
- josephcsible 5y agoWhy couldn't this have instead been fixed by having Firefox listen on both, and then having remote control check X11 first and then if it didn't find it there, then fall back to D-Bus? Wouldn't that have fixed the problem that motivated the change, but without breaking the use case with X11 forwarding?
- m45t3r 5y agoIt seems for me that this remote control using the X based protocol was never meant to be a feature. Probably the mechanism was created before D-bus existed, was meant to be dropped once a better solution was created, but never was done until now. If anything else, D-bus seems to be the proper protocol for something like this, since as the author itself said, it is simpler and more reliable.
- dragosmocrii 5y agoDon't know why, but Firefox on my Ubuntu is slow AF. Scrolling pages is just a pain. Graphics acceleration seem to be enabled.. Chrome is buttery smooth though, so no idea how to fix FF
- sp332 5y agoYou could try disabling acceleration and see if that helps. Sometimes there are just driver issues.
- guerrilla 5y agoMake a thread on Ask Ubuntu or the forums and try to get help figuring out the cause?
- capitainenemo 5y agoWhat version of Firefox? Graphics acceleration may be enabled in X11 but not in Firefox. Check the about:support page for status of that in the Graphics section. Last year I believe they enabled it by default in Linux due to improved driver stability, but there is still a blacklist. Chrome and Firefox both have blacklists, each with different card strings in it. Over here it is: Compositing WebRender (I have layers.acceleration.force-enabled;true and gfx.webrender.all;true) There's a far less common problem where you are running firefox in XRDP or ssh -YC and it is being sluggish - for that you have to force-enable xrender https://bugzilla.mozilla.org/show_bug.cgi?id=1263222 https://bugzilla.mozilla.org/show_bug.cgi?id=1263222 )
- dragosmocrii 5y agoAll the flags to force using acceleration are enabled, but the section with the Graphics driver shows that no driver was found. I do have the latest Nvidia Drivers installed, and my graphic card is a GeForce GTX 1660 Ti Mobile. * Running Firefox 93.0 *Update: I've rebooted my system, and it shows that my Graphic Card is now in use. Not sure which flag I enabled helped, but pages are buttery smooth as with Chrome. Many thanks!
- 5y ago
- ATsch 5y agoVery glad to hear this, the X11 mechanism has been causing issues for me for a long time, as detailed in the article.
- short12 5y agoI hear all the pushback on Wayland with boastful claims about x11 X11 has been crap since I started exclusively using Linux in 1998 Is junk, it's unstable, slow and bloated. Why people grasp onto the network aspect is beyond me. The model is horrendous and outdated and little used at that. Better alternatives have blown x forwarding out of the water years
- marginalia_nu 5y agoI've personally never experienced any problems with X11. What exactly are its problems? Being old isn't always a bad thing, quite the contrary, often times the things get old is by being quite good and working well.
- evmar 5y agoAt least as of >10 years ago when I worked on the code, the equivalent feature in Linux Chrome uses a unix socket in your Chrome profile directory. It was a little subtle to implement in that you need to also handle the case where a crashed browser leaves a socket behind.
- jacobmischka 5y agoI've run into the mentioned issue often when an X application in XWayland will fail to open a link in my Wayland Firefox process. I hope they resolve it soon, but I've updated Nightly since this article was written and it still happens, so it looks like not yet. Maybe my installation wasn't built with the necessary flags.
- yuri91 5y agooh yes! this is the single most frustrating thing on Wayland for me right now (not a huge deal, but almost anything else just works these days).
- Jnr 5y agoI remember there being a variable that you can pass that fixes it for Firefox.
- yuri91 5y agoI dug a bit on this just now, and apparently you can force firefox to use dbus always by setting the env variable MOZ_DBUS_REMOTE=1 . Finally I can click to links in slack instead of copying them.
- marcellus23 5y agoIs it the year of Linux on the desktop yet?
- jacobmischka 5y agoThank you very much!
- mftb 5y agoHmm... I had this working, but then it stopped. I think I have that variable set all over the place, but I must not... or something. Must investigate! (I'm on Wayland/Sway)
- tyingq 5y agoI suppose you could leverage the Firefox remote agent protocol that things like puppeteer use and make yourself a wrapper that emulates the behavior that was deprecated. I had a somewhat similar situation with WSL where I wanted xdg-open to open Chrome tabs in Windows instead of WSL. Was able to get that working with just WSL->Windows built-in functionality and a *.desktop file.
- snthd 5y agoDoes that mean you can send links to different instances of Firefox under different profiles, or even particular windows (eg sending a link to the same screen/workspace as the programming passing the URL)? Historically I think the last Firefox to open received all the link-opening requests.
- tomohawk 5y agoI always start firefox with `-no-remote` to avoid having it talk with other firefox's
- emersion 5y agoUsing X11 as some kind of client-to-client IPC was really just a hack in the first place.
- caslon 5y agoWhat's wrong with hacks? Hackers, unlike Mozilla, don't put ads in their software.
- bool3max 5y agoDepends on the kind of hacker. Some do worse.
- caslon 5y agoNo! You're thinking of "crackers." There's a very serious difference. The word "hacker" being co-opted by writers who don't understand it is like the literally-as-figuratively phenomenon. Literally doesn't mean figuratively, they're just using the word incorrectly. https://www.techrepublic.com/blog/it-security/hacker-vs-cracker/ https://www.techrepublic.com/blog/it-security/hacker-vs-crac... http://www.stallman.org/articles/on-hacking.html http://www.stallman.org/articles/on-hacking.html http://www.catb.org/jargon/html/C/cracker.html http://www.catb.org/jargon/html/C/cracker.html
- II2II 5y agoAs far as I can tell, the word "cracker" has close to zero uptake outside of the food industry (and, perhaps, people who produce cracks for software). You're far better off letting the context distinguish between the type of hacker, or mentioning it explicitly if the context does not make it clear, since more people will understand what you're talking about.
- krapp 5y ago>Literally doesn't mean figuratively, they're just using the word incorrectly. Literally has been used to mean figuratively since at least the 1700s[0], and words mean whatever people decide they mean. [0]https://blogs.illinois.edu/view/25/96439 https://blogs.illinois.edu/view/25/96439
- yissp 5y agoI suspect trying to maintain a remote-X11-based workflow is going to become increasingly annoying as more applications prioritize the Wayland / Xwayland use-case like Firefox has done here.
- 1MachineElf 5y agoI worry about how this trend could impact BSDs which typically rely more on FireFox (and derivatives) as a modern browser. Neither Wayland nor Dbus are native to those systems.
- md8z 5y agoWhat exactly does "native" mean on BSD here? In my experience, that usually just means something that is written in C, uses BSD make, uses the BSD license, and follows some patterns used in the BSD libc. Which seems to apply to very little popular desktop software including Firefox and all other web browsers. BSD users seem to be fine with running ports though, which include Firefox, D-Bus and Wayland.
- azalemeth 5y agoI'm very ignorant about Xwayland – but I frequently use "ssh -Y" or "ssh -X". Is there a simple alternative? Will this move break lots of things needlessly? The wayland / X debate is one of those things that I fear will become a bit like vim vs emacs...
- capitainenemo 5y agoI'm still a big fan, personally, of ssh -YC - it works pretty efficiently with Eclipse and other simple GTK text based apps. With Firefox, it doesn't work as well, and I can understand why. Browsers demand a lot of graphics acceleration. That said, you can still get decent performance by force-enabling xrender as long as they still support it.gfx.xrender.enabled;true Personally, gonna be a bit sad when Wayland breaks all my things (my xdotool scripts, my ssh -YC, my XSDL on Android)
- MayeulC 5y agoAnother approach would be to integrate Firefox-specific D-Bus proxying inside of waypipe. Have waypipe listen to where Firefox normally does, if one is spawned on the remote host. I can imagine this being useful for more things, like portals going forward: one could imagine forwarding sound, video (both trough pipewire, negociated over D-Bus) and files this way.
- johnklos 5y agoMakes perfect sense - stop using X11 because XWayland needs to be fixed.
- bitwize 5y agoActually it does make perfect sense because X is deprecated by the community and largely abandoned except for XWayland, which is kept around for legacy apps only. Update your workflow to the modern stuff, don't expect the maintainers to keep supporting your use case from decades ago.
- superkuh 5y ago> X is deprecated by the community and largely abandoned Old and functional does not mean deprecated. In most distros and for most users X is not deprecated. It sounds like you've been living on the bleeding edge for a long time and have lost touch with the reality of linux for most users. The GUI toolkits like Gtk and Qt fully support X. They do not fully support Wayland. When this changes you can call X deprecated.
- McWobbleston 5y agoYes, it's weird seeing the X is dead sentiment considering some of the most popular distros are still using X, and Wayland has only recently caught up with comparability for workflows like screen capture. I'm unfortunately stuck on X because of my NVIDIA system, but I hadn't been all that interested in Wayland until recently. AFAIK there is also some work to be done on the gaming side no?
- markstos 5y agoSounds like he was considering re-inventing SSH tunneling, which is built-into SSH.
- solarkraft 5y agoIt’s really nice to see X11 slowly die out.
- yjftsjthsd-h 5y agoSomewhat less nice for those of us who are using it and don't appreciate people trying to break our setups.
- iso8859-1 5y agoSoftware breaks itself simply by being unmaintained. If people were serious about Xorg, it would see more activity.
- yjftsjthsd-h 5y ago> Software breaks itself simply by being unmaintained. It really doesn't; unmaintained software breaks when the world changes around it. Sometimes this is fair, like needing to keep up with changes in how the kernel exposes graphics capabilities, and sometimes it really isn't, like applications deciding to only support wayland when they aren't doing anything that wouldn't work fine on X11. > If people were serious about Xorg, it would see more activity. Oh, like people funding new work which allows a new maintainer to work on it? https://news.ycombinator.com/item?id=29017498 https://news.ycombinator.com/item?id=29017498
- selfhoster11 5y agoAye, I love suddenly not having X forwarding through SSH. Oh, wait.
- jdlyga 5y agoX11 and Wayland is like when the previous API is deprecated, but the new API is in beta
- bravetraveler 5y agoI find it hard to disagree - and I'm (finally) on a full Wayland setup (that's honestly pretty stable/good -- Sway for anyone curious) The amount of 'lift' involved was absurd. Half of the applications I launch need tickled/informed that Wayland is in use. If I don't do this, most of these things default to XWayland and copying/pasting between that and native things is absolutely broken (often one direction)
- Taywee 5y agoI'm in a similar boat as you. I switched from X11 to Wayland (also Sway) and from PulseAudio+Jack2 to Pipewire a couple weeks ago. I am in the extra difficult boat of doing it on a high DPI display (I assume you aren't, or you would have mentioned it, given how annoying it is to get everything working). GDK_DPI_SCALE, ELM_SCALE, QT_SCALE_FACTOR, MOZ_ENABLE_WAYLAND, QT_QPA_PLATFORM, XDG_CURRENT_DESKTOP, XDG_SESSION_TYPE and a few other things are necessary to get everything working. Then you have little things like having to do xdg-desktop-portal to do screencasting, little nits like not being able to screen-share a window at a time (only a full desktop). It's definitely not a super easy and comfortable transition at the moment. I'd recommend most anybody who wants to do it use a DE that takes care of as much of the pain as possible, like modern Gnome or something. Sway itself is nice. I've never used i3, but I've used Awesome for like a decade, so Sway is not a big jump. Moving to Pipewire was really easy, on the other hand. Mostly drop-in, and I had some annoying audio issues both with PulseAudio and Jack2 that Pipewire completely fixes for me. I absolutely love it, and feel like Linux audio is in an acceptable place for the first time in my life. edit: oh, and before Firefox 93, I had to force Firefox to run in X11, because extension popup windows were broken on Sway due to a Firefox bug. Much of the testing for Wayland applications is done only on Gnome.
- bravetraveler 5y ago