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

Increase RDP clipboard size? #51917

Open
uedvt359 opened this issue Feb 6, 2025 · 3 comments
Open

Increase RDP clipboard size? #51917

uedvt359 opened this issue Feb 6, 2025 · 3 comments
Labels
desktop-access feature-request Used for new features in Teleport, improvements to current should be #enhancements

Comments

@uedvt359
Copy link

uedvt359 commented Feb 6, 2025

What would you like Teleport to do?

Teleport appears to enforce a 1MB limit for copy-pasting text. If this limit is hit, the following error is returned:

Image

Assuming text gets UCS-2/UTF-16 encoded, this limit is ~500.000 characters.

What problem does this solve?

I tried to copy-paste an SQL dump backup over Teleport-RDP. This works when using RDP directly, but fails when using Teleport. Saving the clipboard contents to a file and saving it as utf16 with notepad.exe, it's ~4MB large.

If a workaround exists, please include it.

I guess this limit is set here:

maxClipboardDataLength = 1024 * 1024 // 1MB

is there a reason this was set to 1MB or was this just a (reasonable) guess? If possible, I'd like to ask for it to be increased

@uedvt359 uedvt359 added the feature-request Used for new features in Teleport, improvements to current should be #enhancements label Feb 6, 2025
@uedvt359
Copy link
Author

uedvt359 commented Feb 6, 2025

it seems, microsoft themselves advertise up to 2gb: http://support.microsoft.com/kb/2258090

@zmb3
Copy link
Collaborator

zmb3 commented Feb 6, 2025

Thanks for filing this. Here's the nerdy explanation for those who care about the details:

Our protocol as it exists today isn't suitable for payloads as large as 2GB. A lot of remote desktop protocols (Teleport's included) use a pretty naive approach where any time data on the remote machine is copied (added to the clipboard), that data is sent to the client.

Microsoft RDP has an optimization called delayed rendering, so when you copy 2GB of data in a session, instead of sending all 2GB to the client, you send the client a notification which says that 2GB of data is available. This way, if the client never needs to actually paste the data then no network bandwidth was wasted moving those 2GB of data around, but if the client does need to paste the data it must make another request to fetch it.

This delayed rendering approach works great for Microsoft, but it requires some low-level integration on the RDP client side (you've got to be able to intercept system-level paste events). Our browser-based client is not capable of intercepting paste events that occur outside the browser, so delayed rendering is not an option for us.

tl;dr we probably won't be able to support 2GB in the browser based client, but we can probably push things a little further than 1MB. We are also working on adding desktop support to our native Teleport Connect client, which might help us bypass some of the restrictions we face due to running in a browser.

@uedvt359
Copy link
Author

uedvt359 commented Feb 7, 2025

Thank you for that great explanation. Of course, 2GB is way overkill. But maybe somewhere around 10MB will be feasible in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop-access feature-request Used for new features in Teleport, improvements to current should be #enhancements
Projects
None yet
Development

No branches or pull requests

2 participants