description: How I fixed ToDesk crashes, repeated local connection errors, and an incorrect Intel VA-API
configuration on an AMD system.
tags: linux, archlinux, kde, troubleshooting
# Fixing ToDesk Flickering and Crashes on Arch Linux with KDE Wayland and AMD Graphics
## Environment
- Arch Linux x86_64
- KDE Plasma running on Wayland
- AMD Radeon graphics using the
amdgpukernel driver - ToDesk 4.8.6.2 installed from the AUR package
todesk-bin
## Symptoms
ToDesk would flicker, close unexpectedly, or repeatedly reconnect to its local service.
The logs repeatedly contained messages such as:
text
Local Conn Error
X11 session not found
Several crash dumps were also created under:
~/.local/share/todesk/*.dmp
Checking the ToDesk service showed that it was not running:
systemctl is-active todeskd
systemctl is-enabled todeskd
Output:
inactive
disabled
## Root Causes
There were three separate problems.
### 1. The ToDesk background service was not running
The ToDesk GUI communicates with the privileged todeskd service. When the service is stopped, the client
repeatedly attempts to reconnect and logs Local Conn Error.
### 2. ToDesk was forcing an Intel video driver on an AMD GPU
The installed launcher and systemd unit contained these variables:
LIBVA_DRIVER_NAME=iHD
LIBVA_DRIVERS_PATH=/opt/todesk/bin
iHD is Intel’s VA-API media driver. However, this machine uses AMD Radeon graphics.
On Arch Linux, the appropriate Mesa VA-API driver for AMD is normally:
/usr/lib/dri/radeonsi_drv_video.so
Forcing the Intel driver on an AMD system can cause hardware video decoding or encoding failures,
flickering, and crashes.
### 3. ToDesk has limited Wayland support
The ToDesk interface can run through XWayland, but screen capture and remote input may still fail when the
Linux machine is used as the controlled host.
ToDesk’s own documentation recommends switching the controlled Linux machine to an X11 session:
ToDesk documentation: using an X11 desktop on Linux (https://www.todesk.com/helpcenter/questions-416.html)
In this case, I first fixed the service and AMD driver configuration without replacing the current Wayland
session.
> This guide is specifically for AMD Radeon GPUs using Mesa. Intel and NVIDIA users should not copy the
> radeonsi configuration.
## Step 1: Override the ToDesk Service Configuration
Create a systemd drop-in:
sudo systemctl edit todeskd.service
Add:
[Service]
Environment="LIBVA_DRIVER_NAME=radeonsi"
Environment="LIBVA_DRIVERS_PATH=/usr/lib/dri"
Save the file, then reload systemd and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now todeskd.service
If you do not want ToDesk to start automatically at boot, use this instead:
sudo systemctl start todeskd.service
Verify the effective configuration:
systemctl show todeskd \
--property=ActiveState,SubState,UnitFileState,Environment
Expected output:
ActiveState=active
SubState=running
UnitFileState=enabled
Environment=LIBVA_DRIVER_NAME=radeonsi LIBVA_DRIVERS_PATH=/usr/lib/dri
## Step 2: Override the Application Launcher
Do not edit the package-managed desktop file directly. Copy it into the user application directory:
install -Dm644 \
/usr/share/applications/todesk.desktop \
~/.local/share/applications/todesk.desktop
Open the copied file:
nano ~/.local/share/applications/todesk.desktop
Replace its Exec= line with:
Exec=env LIBVA_DRIVER_NAME=radeonsi LIBVA_DRIVERS_PATH=/usr/lib/dri GDK_BACKEND=x11 /opt/todesk/bin/ToDesk
This makes the ToDesk interface use the AMD Mesa driver while continuing to run through XWayland.
Refresh the desktop application database:
update-desktop-database ~/.local/share/applications
kbuildsycoca6
## Step 3: Fix the Autostart Entry
If ToDesk starts automatically when you log in, edit:
nano ~/.config/autostart/todesk.desktop
Change its Exec= line to:
Exec=env LIBVA_DRIVER_NAME=radeonsi LIBVA_DRIVERS_PATH=/usr/lib/dri GDK_BACKEND=x11 /opt/todesk/bin/ToDesk
Otherwise, the autostart entry may continue launching ToDesk with the incorrect Intel driver.
## Optional: Fix the Terminal Command
The package’s /usr/bin/todesk wrapper may also export the Intel driver variables.
Create a user-level wrapper:
mkdir -p ~/.local/bin
nano ~/.local/bin/todesk
Add:
#!/bin/bash
export LIBVA_DRIVER_NAME=radeonsi
export LIBVA_DRIVERS_PATH=/usr/lib/dri
export GDK_BACKEND=x11
exec /opt/todesk/bin/ToDesk "$@"
Make it executable:
chmod +x ~/.local/bin/todesk
Ensure that ~/.local/bin appears before /usr/bin in your PATH:
command -v todesk
Expected output:
/home/your-user/.local/bin/todesk
## Step 4: Restart ToDesk
Completely exit ToDesk from the system tray and reopen it from the application menu.
Alternatively:
pkill -INT -x ToDesk
Then launch ToDesk again.
Do not run this command during an active remote session.
## Verification
Find the ToDesk process:
pid="$(pgrep -n -x ToDesk)"
Inspect the relevant environment variables:
tr '\0' '\n' < "/proc/$pid/environ" |
grep -E '^(LIBVA_DRIVER_NAME|LIBVA_DRIVERS_PATH|GDK_BACKEND)='
Expected output:
LIBVA_DRIVER_NAME=radeonsi
LIBVA_DRIVERS_PATH=/usr/lib/dri
GDK_BACKEND=x11
Also confirm that both processes are running:
ps -C ToDesk,ToDesk_Service -o pid,comm,stat,etime
## Result
After applying these changes:
- ToDesk remained running normally
- The repeated local service connection errors stopped
- todeskd started correctly
- Both the client and service used the AMD radeonsi driver
- No ToDesk downgrade was required
- No system-wide graphics settings were changed
- Installing a Plasma X11 session was not immediately necessary
## Wayland Limitation
This fix makes the ToDesk interface usable under KDE Wayland through XWayland. It does not provide full
native Wayland support.
If other devices cannot properly control this Linux machine, or the remote session still shows a black,
corrupted, or flickering screen, switching the login session to Plasma X11 may still be necessary.
Installing an older ToDesk version is unlikely to solve that limitation and may introduce security or
server compatibility problems.
## Security Note
todeskd runs as root. Enabling it at boot means a privileged remote-access service will always be
available.
Use a strong unattended-access password, enable additional verification where possible, and stop the
service when it is not needed:
sudo systemctl disable --now todeskd.service
Also avoid publishing raw ToDesk logs. They may contain device IDs, account information, IP addresses,
phone numbers, or authentication tokens.
## Rollback
Remove the systemd override:
sudo rm /etc/systemd/system/todeskd.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart todeskd.service
Remove the user application override:
rm ~/.local/share/applications/todesk.desktop
Finally, restore or remove the modified autostart entry and refresh KDE’s application cache:
kbuildsycoca6
Top comments (0)