Add Linux desktop support (#65841)

* Implement support for TDPB in Desktop Agent.

* Add LinuxDesktop gRPC and backend

* Add LinuxDesktop resource to unified resources

* Add Linux desktop service

* Remove CloneResource

* Review comments

* Unifide fix

* routing

* Fix logins

* Fix logins

* Fix CA cache and write basic loop

* Review comment

* Fix components and handleConnection

* Review comment

* Add ClonableResourceWithLabels

* Fix missing CloneResource

* Add Xvfb handlers

* Add Xephyr

* Add Xvfb controller

* Add QOI encoder

* encoder + xsession

* reexec

* ChildLogConfig

* session

* add forceloginshell

* update frontend + fix session

* Review comments

* Fix code, update docs

* Fix TARGETS format, reuse waiting

* Remove direct mode

* Update lib/auth/linuxdesktop/linuxdesktopv1/service.go

Co-authored-by: Zac Bergquist <[email protected]>

* Add MFA and cert usage support

* Add RemoteAddr

* Revert Uacc setup

* Add session selector

* Refactor code

* Add session recording, tracking and events

* Add session recording, tracking and events

* Refactor command reexecution

* Review comments

* Use reexec.ConfigureCommand

* Proto changes for Linux Desktop

* Proto changes for Linux Desktop

* Add locks support for Linux desktop

* Add guard around m.ScreenSpec

* Cleanup

* Add activity monitor

* Cleanup

* Fix compilation

* Cleanup unified view

* Refactor linux session

* Add logging

* Add logging

* go mod tidy

* Adjust logging

* go mod tidy

* Grab stderr from reexec

* Fix UACC

* pass remote addr to uacc

* TMP: debug images

* Fix panic

* TMP: debug images

* limit change size

* Monitor resolution and restore it

* TMP: debug images

* TMP: debug images

* TMP: debug images

* Modify screen resize

* TMP: debug images

* TMP: debug images

* Add XDG env variable

* Use dbus-run-session

* pam

* variables fix

* variables fix

# Conflicts:
#	lib/srv/desktop/x11/xsession.go

* revert uacc

* cleanup

* EncodeQOIZ noop

* EncodeQOIZ noop

* Fix auditing

* Cleanup

* Fix type check

* Fix formatting

* Fix licenses

* Fix lint

* go mod tidy

* Fix audit reference

* Fix log

* Fix tests

* Fix tests

* Remove testing from xgb

* go mod tidy

* Fix tests

* xgb 1.3.1

* Handle multiple SessionSelection messages

* Add filters for sessions

* fix events

* Fix compilation + events

* Fix test

* Fix test

* Fix UI

* cleanup

* review comments

* Rework poll eq

* Fix bounds clipping

* fix imports

* lint

* lint

* err

* Fix locking in resize

* Fix ReadChildError

* remove dependabot exclusion

* Fix session end

* Cleanup metedata

* Fix session events

* Ignore multiple ClientHello

* Use slices.IndexFunc in setScreenSize

* Cleanup unused code

* Update lib/service/linux_desktop.go

Co-authored-by: Zac Bergquist <[email protected]>

* Use slices.Clone

* Update lib/srv/desktop/x11/xsession.go

Co-authored-by: Zac Bergquist <[email protected]>

* Fix import

* Use filepath.Glob

* Simplify testdata path calculation

* Cleanup comment

* Cleanup endpoints

* Update lib/web/apiserver.go

Co-authored-by: Zac Bergquist <[email protected]>

* Update lib/web/desktop.go

Co-authored-by: Zac Bergquist <[email protected]>

* Cleanup createDesktopConnection signature

* Cleanup createDesktopConnection signature

* Use server capabilities

* Remove dep override

* Add bounds check

* Cleanup

* Add EndTime to reconstructed event

* use cleanupCtx

* cleanup

* Add configuration test

* Add horizontal scroll

* Review comments

* Fix scrolling

* Fix scrolling

* Sort available sessions

* Fix build

* Add bounds check

* Fix tests

* Move expiry

* lint

* Add back metadata nil check

* lint

* Add usage reporting

* Fix error handling

* Fix resizing, add lock prevention

* Move backend creation after authorization

* Fix possible panic in handleSessionSelection

* Check if clipboard is allowed

* Cleanup errors during normal session ending

* use errgroup for all backround tasks

* Review comments

* fix heartbeat

* add guard for root

* fix tests

* add negative check in changes

* cleanup

* cleanup

* add guard

* Review comments

* Review comments

* Review comments

* Review comments

* Review comments

* Read only access for RoleLinuxDesktop

* use dbus-launch

* Add Linux Desktops to inventory UI

* Use X11 launcher script to start sessions

Use a launch script instead of executing the Exec= line from the
Xsession file directly. This handles the "default" case on Debian
systems where the Xsession file reads `Exec=default`.

The launcher can be explicitly configured at the agent level or
left blank, in which case we probe a set of well-known launchers.

* Compositing support

* Fix dbus launcher

Support both `dbus-run-session` and the older `dbus-launch`.

* Fix error messages when Xvfb is not installed

* Add non-root warning

* Use forceFullDamage for resize

* Fix Open API usage

* invalid user test fix

* remove commented code

* Complete TLS handshake

* Improve error message

* Logged wrapped command

* Add dbus-daemon as dependency for dbus-launch

* Update dbus warning and add llvm check to macos build

* Add LinuxDesktop to role list in new token dialog

* Fix teleport start role validation

* Run messageLoop in separate goroutine

* Add LinuxDesktop labels to Admin role

* Add handling for extended keys and ID reuse

* Cleanup shut down logs

* Xsession cleanup

* Rework llvm requirement in Makefile

---------

Co-authored-by: Ryan Hammonds <[email protected]>
Co-authored-by: Zac Bergquist <[email protected]>
This commit is contained in:
Przemko Robakowski
2026-07-09 07:41:47 +00:00
committed by GitHub
co-authored by Ryan Hammonds Zac Bergquist
parent ebfffb5403
commit cf91ada533
117 changed files with 5181 additions and 304 deletions
+2
View File
@@ -929,6 +929,8 @@ github.com/jellydator/ttlcache/v3 v3.4.0 h1:YS4P125qQS0tNhtL6aeYkheEaB/m8HCqdMMP
github.com/jellydator/ttlcache/v3 v3.4.0/go.mod h1:Hw9EgjymziQD3yGsQdf1FqFdpp7YjFMd4Srg5EJlgD4=
github.com/jeremija/gosubmit v0.2.8 h1:mmSITBz9JxVtu8eqbN+zmmwX7Ij2RidQxhcwRVI4wqA=
github.com/jeremija/gosubmit v0.2.8/go.mod h1:Ui+HS073lCFREXBbdfrJzMB57OI/bdxTiLtrDHHhFPI=
github.com/jezek/xgb v1.3.1 h1:NQCAEfQyzN+3RjWUSHBuVIxQcy2YfG3/mNvKfs/0rEg=
github.com/jezek/xgb v1.3.1/go.mod h1:nrhwO0FX/enq75I7Y7G8iN1ubpSGZEiA3v9e9GyRFlk=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs=