mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-02 19:26:56 -05:00
Unsupported display server type tty when running without display manager #72
Labels
No labels
bug
documentation
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
question
unreproducible
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rustdesk-rustdesk#72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mtoohey31 on GitHub (Jun 18, 2021).
Hello! I'm starting my window manager with
startxinstead of with a display manager, and the display server type is incorrectly identified asttyinstead ofx11. I took a look at the method being used to detect the display server and the issue isn't in the implementation of the method you're using to check it, but with the result of theloginctlcommand. One alternative method might be checking theWAYLAND_DISPLAYandDISPLAYenvironment variables, as suggested here: https://unix.stackexchange.com/a/559950I haven't tested it much at all, here's a mockup of what that might look like (in
src/platform/linux.rs), I haven't been able to test it though cause it won't build on my system for other reasons even without these modifications.Let me know if there's any other information I can provide, or testing I can do!
@rustdesk commented on GitHub (Jun 18, 2021):
noted with thanks
@rustdesk commented on GitHub (Jun 18, 2021):
Wondering if you can work on it. You do not need to work on this big project. You can write standalone functions
get_display_server,get_envandget_active_useridfor non-display-manager.@mtoohey31 commented on GitHub (Jun 18, 2021):
Sure, I can try giving it a go tomorrow.
@mtoohey31 commented on GitHub (Jun 19, 2021):
Alright, here's a new version of
get_display_server_of_sessionthat works without a display-manager:Basically it just adds a check for whether the session type is tty, and if it is, it checks if Xorg is running on that tty. It's a bit of a mess of nested if statements so feel free to refactor that if you have a neater way of doing things. I believe this fixes the issue, let me know if changes to those are functions are necessary though. I haven't gotten to testing it in the main application, but I've tested it on its own and it correctly identifies the display server now on my setup which is Arch and startx (x11), stock Manjaro KDE (x11), and stock Fedora 34 (wayland).
Lmk if that looks ok and if you'd like me to open a PR or if you have something else in mind. Also, random fun fact, it looks like Teamviewer has this same issue according to this comment: https://aur.archlinux.org/packages/teamviewer/?O=40&PP=10#comment-763211.
@rustdesk commented on GitHub (Jun 19, 2021):
Good job, but you also need to modify
get_active_userid, andget_env, RustDesk usesget_envto get$DISPLAYand$XAUTHORITYto make xdo and screen capture work.get_active_useridget the user id of the active X session.@rustdesk commented on GitHub (Jun 19, 2021):
Have you test if you can get correct
$DISPLAYand$XAUTHORITYwith old get_env and your newget_display_server_of_session?@rustdesk commented on GitHub (Jun 19, 2021):
Seems
get_active_useridcan work, but I am not sure ifget_envworks with your newget_display_server_of_session.@mtoohey31 commented on GitHub (Jun 19, 2021):
No I have not tried that approach cause I assumed it would encounter issues when the program is running as a systemd service. I'm currently building the full application so I can test it properly to see what works and what doesn't.
@rustdesk commented on GitHub (Jun 19, 2021):
Thanks
@mtoohey31 commented on GitHub (Jun 19, 2021):
K I've got it built and I did some testing and it works just fine without changing any other functions. I don't think the bug was anything in the actual functionality, it was just these checks here that were preventing the program from trying to connect, because
get_display_serverwas returningttyinstead ofx11, which is now fixed:I've got the changes in this branch here. Let me know if there's anything else you'd like me to check before opening a PR.
@rustdesk commented on GitHub (Jun 19, 2021):
Awesome work Mattherw. pr please. If you can help, please also look into #56, much more challenge. Although now RustDesk is growng, we don't have enough cash but I can sponsor u anyway, Thanks for your time!
@mtoohey31 commented on GitHub (Jun 19, 2021):
👍 PR created, I can maybe take a look tomorrow, I'd want to figure out how I'd go about it or whether it's even doable before agreeing to anything though. One other thing I was wondering is whether you'd be interested in including a Dockerfile for building the application, in case people want to use that method. I put a rough one together based on the build scripts in the README to test these changes and I figure it might be easier than trying to follow the scripts manually for a lot of people, it might also cut down on the number of build-related issues. Lmk if you're interested, if so I can clean it up and add documentation.
@rustdesk commented on GitHub (Jun 20, 2021):
Please go ahead. Very interested.
@rustdesk commented on GitHub (Jun 20, 2021):
Thanks :)
@rustdesk commented on GitHub (Jun 20, 2021):
There is Wayland support (screen capture and input control) in https://github.com/H-M-H/Weylus/ with rust, I believe it is doable.
@lstep commented on GitHub (May 21, 2022):
Hello,
I just downloaded version 1.1.9 (latest, as of today), on an Ubuntu Linux, starting from tty with
startx, I thought the bug would be corrected on version 1.1.9, but I still get the error messageUnsupported display server tty, x11 expected:-(.I guess that's because I switched to
tty2before runningstartx, and your code only checks the tty that has the login process (as I see from the patch).@rustdesk commented on GitHub (May 22, 2022):
Really? @mtoohey31 could you please take a look?
@mtoohey31 commented on GitHub (May 22, 2022):
Sorry, I've been using Wayland (and haven't been using rustdesk) for a while now, so I'm probably not the best person to test this as it would require a lot of setup. However, I could be wrong, but I don't think from looking at it that
get_display_server_of_sessionis limited operating on any specific tty, I'm pretty sure it will operate on the session its called with, regardless of what tty it corresponds to. The function that calls it (get_display_server) will always call it with the session of seat0 though, so maybe that's related?Looking back on the code for
get_display_server_of_sessionthis many months later it could definitely use a rewrite; there's got to be a way to accomplish this without running so many shell commands. But again, I don't have the setup to test it...@rustdesk commented on GitHub (May 22, 2022):
Thanks
@lstep commented on GitHub (May 23, 2022):
From what I see in the code (but I'm not a Rust user), it gets the tty where the login process is running, but from what I see from my list of processes, I only have a login process on tty1, but (I don't know why), none shown on tty2, although I am logged in on tty2 (did a ALT-F2 to change).
@schrmh commented on GitHub (Feb 16, 2025):
Looks like it is still an issue. (Also tried the flatpak, as recommended in the Artix issue.)
Also using startx,
then Arch Linux as a distro (so systemd)
and FVWM3 as a WM.
And it would be nice if there was any option to ignore that (setting, button, command line switch) since it blocks incoming connections....
@drlat commented on GitHub (Jun 6, 2025):
I'm also using startx on archlinux. I use stumpwm. I'm surprised that this isn't fixed, since the code to fix has already been written. Is there any way around this problem.
@GameKyuubi commented on GitHub (Jun 10, 2025):
Still busted. With XFCE via startxfce4, RustDesk is unusable. Not sure why this is such a problem; a lot of people who would use RDP also use TTY for stuff.
@JSouthGB commented on GitHub (Dec 4, 2025):
@schrmh @drlat @GameKyuubi
I also use startx. Setting
XDG_SESSION_TYPE=x11eliminated the error.I found this comment posted by @DrewRidley