Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open browser from menu bar app or notification on Ubuntu 23 with Wayland, PopOS 22.04, potentially others #1537

Open
RebeccaMahany opened this issue Jan 9, 2024 · 12 comments
Assignees

Comments

@RebeccaMahany
Copy link
Contributor

RebeccaMahany commented Jan 9, 2024

For Ubuntu 23 with Wayland: we rely on Xwayland to be running in order to grab the DISPLAY, which we need to be able to open URLs from the menu bar app and from notifications. I updated some software on Ubuntu 23.04 and now I don't have an xwayland process, just gdm-wayland-session, which does not have DISPLAY as an arg.

We've also had reports of the browser not opening on PopOS 22.04.

Overall, the way(s) that we're finding and setting DISPLAY is feeling increasingly brittle. We've had issues come up like this on the last several releases. This issue is for, at the very least, fixing the issue on Ubuntu 23.04 with wayland and PopOS, but ideally to find a less brittle way to set DISPLAY in general.


Workarounds

Consolidating some workarounds from the comments here:

Ubuntu-specific workarounds

Switching from wayland to x11 temporarily should let you open links from the menu bar app, and from notifications. After switching to x11, you will have to restart the launcher service via sudo systemctl restart launcher.kolide-k2.service first to get the menu bar app to show up.

Registering your device when you can't access the registration URL from the menu bar app

Any route through auth will also force registration on an unregistered device, so attempting to log in to any Kolide-protected app should get you to the correct registration URL.

@rolandoscott
Copy link

I can confirm this is also happening for me on Ubuntu 23.10.. the tray icon appears.. the menu option appear.. but nothing happens when I click on them..

In the meantime, is there any way to trigger the "Register Device" option somehow else.. either via terminal or is it a specific URL that I can just go to?

@RebeccaMahany
Copy link
Contributor Author

I know we discussed on #1543, just adding info on the workaround here for ease of access in case anyone else runs into it --

Switching from wayland to x11 temporarily should let you open links from the menu bar app, and from notifications. After switching to x11, you will have to restart the launcher service via sudo systemctl restart launcher.kolide-k2.service first to get the menu bar app to show up.

@RebeccaMahany RebeccaMahany changed the title Set DISPLAY on Ubuntu with wayland when Xwayland isn't running Can't open browser from menu bar app or notification on Ubuntu 23 with Wayland Jan 16, 2024
@RebeccaMahany RebeccaMahany changed the title Can't open browser from menu bar app or notification on Ubuntu 23 with Wayland Can't open browser from menu bar app or notification on Ubuntu 23 with Wayland, PopOS 22.04, potentially others Jan 25, 2024
@tobybellwood
Copy link

Just popping in here to say that I had the same issue as Rolando, except that my system is X11 (and has never been on Wayland). I ended up capturing the process call from the menubar click and visiting the registration URL myself.

Is it possible to get these URLs via the CLI anyway, or is the menubar icon the only option?

@RebeccaMahany
Copy link
Contributor Author

Hey @tobybellwood, thanks for reporting -- would you mind passing along your OS/OS version too so we can make sure it's covered when we address this?

It's not possible to get these URLs via the CLI -- I will check to see if it's possible to get the URL another way and update.

@bomoko
Copy link

bomoko commented Jan 29, 2024

I'm having the same issues as described by @tobybellwood - I'm running X11 on Pop!_OS 22.04 LTS.

@tobybellwood
Copy link

Thanks @RebeccaMahany - I'm also running X11 on Pop!_OS 22.04 LTS

@RebeccaMahany
Copy link
Contributor Author

@bomoko @tobybellwood -- You can grab the registration URL from a JSON file that stores the menu data, which is located at /var/kolide-k2/k2device.kolide.com/menu.json. (Thank you @James-Pickett for the proposed workaround. 🙂 ) I re-registered my device to confirm -- I think jq -r '.items[0].action.action.url' /var/kolide-k2/k2device.kolide.com/menu.json should do the trick.

@bomoko
Copy link

bomoko commented Jan 29, 2024

Thanks @RebeccaMahany - that worked like a charm.

@RebeccaMahany
Copy link
Contributor Author

For anyone else experiencing this issue specifically with device registration in the future, an easier workaround: any route through auth will also force registration on an unregistered device, so attempting to log in to any Kolide-protected app should get you to the correct registration URL. 🙂

@RebeccaMahany RebeccaMahany self-assigned this Feb 6, 2024
@RebeccaMahany
Copy link
Contributor Author

At least for Ubuntu+wayland, I'm having success per this if I set WAYLAND_DISPLAY and XDG_RUNTIME_DIR in addition to the other env vars

@RebeccaMahany
Copy link
Contributor Author

RebeccaMahany commented Feb 8, 2024

Leaving a note here for the next time I or someone else comes back to this: for finding DISPLAY, @Micah-Kolide suggested tracking down the display sockets in use (ss -xlnp) -- after a little bit of research, this is looking promising.

We're already searching for the Xwayland/Xorg process for the given user => I think we can tie that process's PID to the appropriate socket from ss -xlnp, which is a well-known file that we can map to the appropriate DISPLAY.

@RebeccaMahany
Copy link
Contributor Author

At least for Ubuntu and Debian, this issue should be addressed by today's release https://github.com/kolide/launcher/releases/tag/v1.5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants