Applies to Ubuntu 24.04 and Ubuntu 22.04 when connecting with Microsoft Remote Desktop (mstsc).
1. Quick Summary
If clipboard is enabled in the RDP client but Ctrl+C / Ctrl+V still does not work inside Ubuntu, the most common cause on XRDP is that the channel server process (xrdp-chansrv) is not starting or is installed in a different path than XRDP expects. Without xrdp-chansrv, the clipboard (cliprdr) channel cannot connect.
2. Symptoms
Typical symptoms include:
· Clipboard option is enabled in mstsc, but paste does nothing inside Ubuntu.
· XRDP logs contain errors like: xrdp_mm_chansrv_connect: ... error
· The xrdp-chansrv process is not present in the RDP session.
3. Windows (mstsc) Checks
Before changing Ubuntu, confirm the Windows client is configured correctly.
1. Step-by-step:
2. Open Remote Desktop Connection (mstsc).
3. Go to Local Resources.
4. Ensure Clipboard is checked.
5. Reconnect to Ubuntu.
Screenshot: mstsc > Local Resources (Clipboard enabled).
Figure 1 - Microsoft Remote Desktop (mstsc) Local Resources tab with Clipboard enabled.
If you are doing a double-hop (PC -> Windows VM -> Ubuntu), clipboard must work on both hops. Fix clipboard in the first hop before troubleshooting Ubuntu.
4. Ubuntu-Side Diagnosis (XRDP)
Run the following checks inside Ubuntu (locally or via an existing RDP session).
4.1 Confirm XRDP is running:
systemctl status xrdp --no-pager
4.2 Check whether xrdp-chansrv is running in your session (after you log in via RDP):
ps aux | grep -E "xrdp-chansrv|chansrv" | grep -v grep
4.3 Search for the xrdp-chansrv binary (common mismatch cause):
sudo find /usr /usr/local -type f -name xrdp-chansrv -executable 2>/dev/null
4.4 Review XRDP logs for channel errors:
sudo tail -n 200 /var/log/xrdp.log
sudo tail -n 200 /var/log/xrdp-sesman.log
Screenshot: XRDP status and logs showing channel server errors.
Figure 2 - Example output showing XRDP running and errors related to chansrv connection.
Screenshot: locating xrdp-chansrv under /usr/local.
Figure 3 - Example find output showing xrdp-chansrv present only under /usr/local.
5. Fix: xrdp-chansrv Path Mismatch (Most Common)
If find shows xrdp-chansrv only under /usr/local (for example /usr/local/sbin/xrdp-chansrv) and XRDP logs show xrdp_mm_chansrv_connect errors, create a symlink to the expected Ubuntu path.
5.1 Create the expected folder and symlink:
sudo mkdir -p /usr/lib/xrdp
sudo ln -sf /usr/local/sbin/xrdp-chansrv /usr/lib/xrdp/xrdp-chansrv
sudo chmod 755 /usr/local/sbin/xrdp-chansrv
sudo systemctl restart xrdp xrdp-sesman
5.2 Disconnect and reconnect your RDP session (clipboard channels often initialize on login).
6. Verify the Fix
After reconnecting to Ubuntu via RDP:
6. 1) Try copying plain text from your local machine and pasting into a text editor inside Ubuntu.
7. 2) Confirm the symlink:
ls -l /usr/lib/xrdp/xrdp-chansrv
8. 3) Confirm xrdp-chansrv is running:
ps aux | grep -E "xrdp-chansrv|chansrv" | grep -v grep
7. Alternative Fix: Reinstall Ubuntu-Packaged XRDP (Stability Option)
If XRDP was built from source under /usr/local, you may prefer to revert to the Ubuntu-packaged XRDP (more predictable file locations and channels). This is especially useful if you see repeated channel failures.
Commands:
sudo apt update
sudo apt install --reinstall -y xrdp xorgxrdp xclip
sudo systemctl restart xrdp xrdp-sesman
8. Ubuntu 22.04 Notes
Ubuntu 22.04 uses the same XRDP clipboard architecture (cliprdr via xrdp-chansrv). The diagnosis and fixes are the same: ensure Clipboard is enabled in mstsc, XRDP is running, and xrdp-chansrv can be launched from the expected location.
Recommended checks on Ubuntu 22.04:
systemctl status xrdp --no-pager
sudo find /usr /usr/local -type f -name xrdp-chansrv -executable 2>/dev/null
ls -l /usr/lib/xrdp/xrdp-chansrv
ps aux | grep -E "xrdp-chansrv|chansrv" | grep -v grep
sudo tail -n 200 /var/log/xrdp.log
sudo tail -n 200 /var/log/xrdp-sesman.log
If xrdp-chansrv is only under /usr/local on Ubuntu 22.04, apply the same symlink fix:
sudo mkdir -p /usr/lib/xrdp
sudo ln -sf /usr/local/sbin/xrdp-chansrv /usr/lib/xrdp/xrdp-chansrv
sudo systemctl restart xrdp xrdp-sesman
Disconnect and reconnect via RDP, then retest copy/paste.
9. Tips and Common Pitfalls
· Clipboard redirection is most reliable for plain text. File copy via clipboard may not work; use drive redirection or SCP for files.
· If you are connected through a Windows jump box (double-hop), fix the clipboard on the first hop first.
· If you change XRDP config or channel binaries, always reconnect the session to reinitialize channels.
Comments
0 comments
Please sign in to leave a comment.