When connecting to a Windows server using tl-run-rdesktop the user might want to resize the window and the Windows session. This is currently only possible when running tl-run-windesk or tl-run-rdesktop in fullscreen inside a ThinLinc session. It will then follow the size of the ThinLinc session. This should be possible even when using windowed mode.
Fixed with rdesktop vendordrop done in r32951.
https://github.com/rdesktop/rdesktop/pull/206
Pressing Ctrl+Alt+Enter when running tl-run-rdesktop in windowed mode in a ThinLinc crashes rdesktop: > X Error of failed request: BadMatch (invalid parameter attributes) > Major opcode of failed request: 42 (X_SetInputFocus) > Serial number of failed request: 5158 > Current serial number in output stream: 5161 > Connection error: The connection to the Remote Desktop failed with error 1 Windows server 2016, nightly ThinLinc-rdesktop.
(In reply to comment #3) > > Connection error: The connection to the Remote Desktop failed with error 1 Also note that rdesktop exits with value 1. This is weird, rdesktop aims to return the RDP exit codes plus some of it's own. This exit code means that an administrator disconnected the session: https://msdn.microsoft.com/en-us/library/cc240544.aspx
(In reply to comment #3) > Pressing Ctrl+Alt+Enter when running tl-run-rdesktop in windowed mode in a > ThinLinc crashes rdesktop: > > > X Error of failed request: BadMatch (invalid parameter attributes) > > Major opcode of failed request: 42 (X_SetInputFocus) > > Serial number of failed request: 5158 > > Current serial number in output stream: 5161 > > Connection error: The connection to the Remote Desktop failed with error 1 > > Windows server 2016, nightly ThinLinc-rdesktop. thinlinc-rdesktop-4.8.0post-5646.r32962.i686 on 32-bit RHEL6 works great with Windows Server 2016.
Running rdesktop with '-g workarea' triggers a reconnect loop bug.
Further info about the case where I see the crash: Server: ThinLinc server build 5646, Fedora 27, running XFCE4 inside the session, starting tl-run-rdesktop manually from a terminal within the session Client: ThinLinc client build 5646, Fedora 27 (same machine as server), running Wayland
I can reliably reproduce it when running inside a ThinLinc session, but I can not reproduce the crash when doing the same procedure locally outside of ThinLinc.
> Running rdesktop with '-g workarea' triggers a reconnect loop bug. This was identified as an bug in the original dynamic resize commit were ui_init_connection() was called within the connect while loop, and not only once. [1] https://github.com/rdesktop/rdesktop/pull/232/commits/8ef9f39aa815968caf39de8a549956f3d88726e5 > I can reliably reproduce it when running inside a ThinLinc session, but I can > not reproduce the crash when doing the same procedure locally outside of > ThinLinc. I could also only reproduced this X11 BadMatch crash, but the problem could also be that the rdesktop window disappeared. The bug is an regression and it has been fixed upstream in commit [1] [1] https://github.com/rdesktop/rdesktop/pull/232/commits/a6d82619ee7ef5c1853869e56315e80a10d76f9b
(In reply to comment #9) > > I can reliably reproduce it when running inside a ThinLinc session, but I can > > not reproduce the crash when doing the same procedure locally outside of > > ThinLinc. > > I could also only reproduced this X11 BadMatch crash, but the problem could > also be that the rdesktop window disappeared. The bug is an regression and it > has been fixed upstream in commit [1] > > [1] > https://github.com/rdesktop/rdesktop/pull/232/commits/a6d82619ee7ef5c1853869e56315e80a10d76f9b > Verified that i could not reproduce this problem using jenkins build #1042 which includes the vendordrop of rdesktop.
(In reply to comment #9) > > Running rdesktop with '-g workarea' triggers a reconnect loop bug. > > This was identified as an bug in the original dynamic resize commit were > ui_init_connection() was called within the connect while loop, and not > only once. > > [1] > https://github.com/rdesktop/rdesktop/pull/232/commits/8ef9f39aa815968caf39de8a549956f3d88726e5 > > I couldn't reproduce a reconnect loop using `-g workarea` or by the equivalent `-g 100%`
I also verified basic functionality with seamless rdp and resizing the vncviewer window, works as expected.
Found a problem with Windows 2008 and the Unity DE on Ubuntu 16.04: If you request a size bigger than the session (or don't give -g at all), there will be 2 resizes ie 3 connection attempts. Sometimes, this results in an error message: Windows Server: Remote Desktop Error: The task you are trying to do can't be completed because Remote Desktop Services is currently busy (See https://social.technet.microsoft.com/wiki/contents/articles/28636.windows-server-remote-desktop-error-the-task-you-are-trying-to-do-can-t-be-completed-because-remote-desktop-services-is-currently-busy.aspx) I've also seen that you'll end up in the login/authentication dialog, even though I submitted the password on the command line prompt.
Known "unfixable" problem: With a 2008 Windows Server, if you rapidly toggle in and out of full screen you might be logged out. This is caused by 2008 not supporting RDPEDISP and is using reconnects when changing window sizes. To avoid manual logins a cookie from the server is used. With rapid toggling the cookie might expire between reconnects and the client fails to fetch a new cookie. As long as reconnects and cookies are used this problem will potentially exist.
Found a problem with seamless with a 2008R2 server causing the session size to be wrong. Create a seamless notepad enlarge the root window. The session size is still the original size causing clipping (not refreshing) of the notepad window. The window is also docked at the session window border and not on the root window border.
https://social.technet.microsoft.com/Forums/windows/en-US/927b33a9-4368-4007-86cc-ba0ab9daae32/the-task-you-are-trying-to-do-cant-be-completed-because-remote-desktop-services-is-currently-busy?forum=winserverDS leading to: https://support.microsoft.com/en-us/help/3014783/-remote-desktop-services-is-currently-busy-or-the-group-policy-client?sd=rss&spid=14134
(In reply to comment #14) > Found a problem with Windows 2008 and the Unity DE on Ubuntu 16.04: If you > request a size bigger than the session (or don't give -g at all), there will be > 2 resizes ie 3 connection attempts. Sometimes, this results in an error > message: > > Windows Server: Remote Desktop Error: The task you are trying to do can't be > completed because Remote Desktop Services is currently busy > > (See > https://social.technet.microsoft.com/wiki/contents/articles/28636.windows-server-remote-desktop-error-the-task-you-are-trying-to-do-can-t-be-completed-because-remote-desktop-services-is-currently-busy.aspx) > > I've also seen that you'll end up in the login/authentication dialog, even > though I submitted the password on the command line prompt. The problem is not related to unity, it just provokes the issue better. I can reproduce the same problem using MSTSC or running rdesktop on any platform. The key is that it is only reproducible if there is no session started and the server needs to bring up a session. The problem seems to be related to profiles due to the problem is reproducible when using local user on the Window 2008 R2 server. I have search relevant information on the web and found a lot of indication to the source of the problem beeing slow winlogin due to roaming profiles or communication with the domain controller. To reproduce the problem do this: - Launch a RDP client and when you see "Welcome" screen, disconnect from the server by closing the window, this seems to put the session in a "busy" state and if you connect a second time you will be prevented with that message. Even if you connect using a different machine. Also you need to reconnect relative fast due to the session seems to recover from this state, normally within a few seconds but I have seen cases up to a minute before you can connect again.
(In reply to comment #15) > Known "unfixable" problem: > > With a 2008 Windows Server, if you rapidly toggle in and out of full screen you > might be logged out. > > This is caused by 2008 not supporting RDPEDISP and is using reconnects when > changing window sizes. To avoid manual logins a cookie from the server is used. > With rapid toggling the cookie might expire between reconnects and the client > fails to fetch a new cookie. > > As long as reconnects and cookies are used this problem will potentially exist. Not fully really unfixable and might also be a bug: rdesktop puts username/password into global variables, and when the first Data PDU is received the password is cleared. If a pending reconnect is carried out before a login info pdu packet has been received, the packet that carries a auto reconnect cookie from the server and a data pdu has been received that clears the password, the reconnect will carried out using no password and no cookie and therefor a login screen is shown. The simplest solution to this might just be to hold the password in memory until we have received a auto reconnect cookie in the logon info pdu packet.
(In reply to comment #19) > rdesktop puts username/password into global variables, and when the first Data > PDU is received the password is cleared. If a pending reconnect is carried out > before a login info pdu packet has been received, the packet that carries a > auto reconnect cookie from the server and a data pdu has been received that > clears the password, the reconnect will carried out using no password and no > cookie and therefor a login screen is shown. > > The simplest solution to this might just be to hold the password in memory > until we have received a auto reconnect cookie in the logon info pdu packet. > Or defer pending resize request until we actually got the autoreconnect cookie. I favor this due to its makes disconnect/reconnect independent of password and we could then probably move the clear of password from memory to an earlier stage in the connect sequence for even better security. However not before the redirect disconnect/reconnect sequence which needs the password.
(In reply to comment #16) > Found a problem with seamless with a 2008R2 server causing the session size to > be wrong. > > Create a seamless notepad enlarge the root window. The session size is still > the original size causing clipping (not refreshing) of the notepad window. The > window is also docked at the session window border and not on the root window > border. Rdesktop is definitely confused of what resolution it should resize to during a root window triggered resize, 1920x1136 is the origin session size in this log: UI(debug): ui_set_cursor(): g_current_cursor = 0x3000149, new = 0x300012a Core(debug): seamless_process_line(), got 'ACK,498,10' UI(debug): xwin_process_events(), ConfigureNotify: Root window changed to 1024x768 Window resize detected, reconnecting to new size 1920x1136 Disconnecting... Resize reconnect loop triggered, new size 1920x1136 Connecting to server using NLA... Failed to initialize NLA, do you have correct Kerberos TGT initialized ? Failed to connect using NLA, trying with SSL Core(debug): GSS error [0:13:0]: cssp_connect(), negotiation failed. Core(debug): - Unspecified GSS failure. Minor code may provide more information Connection established using SSL. UI(debug): ui_create_window() width = 1920, height = 1136 UI(warning): Broken Window Manager: doesn't handle restack (window was moved to bottom)
Regression: no window is shown while being redirected to another server (tested with 2012R2, 2016) when using CredSSP/Kerberos. This has been fixed upstream. https://github.com/rdesktop/rdesktop/commit/54c38f7f62c2a0341132db007bf2dfcf6886c910
After toggling from fullscreen to window mode, you (rarely) get a black screen/window.
SeamlessRDP does not resize its background window after a root window resize, leading to windows that are larger/smaller than the screen when maximized.
Resizing a 2008 session during session startup can lead to the session being stuck in a "hanged" state, preventing login. This is common with Unity, which is happy to reconfigure/resize the rdesktop window on startup.
(In reply to comment #23) > After toggling from fullscreen to window mode, you (rarely) get a black > screen/window. We have not been able to reproduce this scenario with the latest iteration of the code. We've decided to leave this unsolved until we have a reliable way to reproduce the problem.
(In reply to comment #22) > Regression: no window is shown while being redirected to another server (tested > with 2012R2, 2016) when using CredSSP/Kerberos. > > This has been fixed upstream. > > https://github.com/rdesktop/rdesktop/commit/54c38f7f62c2a0341132db007bf2dfcf6886c910 Brought to ctc in r33032.
Another problem found on CentOS 6 with XFCE, using the latest rdesktop against VirtualBox (which does not accept resize): $ RDESKTOP_DEBUG=Core,UI ./rdesktop scilla -f Autoselecting keyboard map 'sv' from locale Password: UI(debug): RDP depth: 24, display depth: 24, display bpp: 32, X server BE: 0, host BE: 0 Core(debug): dvc_channels_add(), Added hash=67f73722, channel_id=-1, name=Microsoft::Windows::RDS::DisplayControl, handler=0x4385d0 Connecting to server using SSL... Protocol(warning): Protocol negotiation failed with reason: no valid authentication certificate on server Retrying with plain RDP. UI(debug): ui_create_window() width = 3200, height = 1200 UI(debug): ui_create_cursor(): xhot=0, yhot=0, width=1, height=1, bpp=24 UI(debug): ui_resize_window(), Changing window 3200x1200 to match new session 720x400 size Connection successful UI(debug): xwin_process_events(), Window mapped with size 720x400 UI(debug): xwin_process_events(), ConfigureNotify: session: 720x400, new window: 720x400 (adj: 720x400) Clipboard(error): xclip_handle_SelectionNotify(), unable to find a textual target to satisfy RDP clipboard text request A window is created in the upper left corner and does not cover the entire desktop. It is possible to interact both with the rdesktop window and the rest of the desktop, even though in "fullscreen mode".
(In reply to comment #29) > Another problem found on CentOS 6 with XFCE, using the latest rdesktop against > VirtualBox (which does not accept resize): > > [...] > > A window is created in the upper left corner and does not cover the entire > desktop. It is possible to interact both with the rdesktop window and the rest > of the desktop, even though in "fullscreen mode". Fixed by vendor drop in r33056.
The vendor drops made on this bug has pulled following three unrelated bug fixes that needs testing... e112b69 Use proper user-initiated disconnect sequence "A correct user initated disconnect sequence should send a MCS Disconnect Provider Ultimatum PDU defined in T.128 upon a disconnect. This commit adds the implementation the mentioned PDU and the actual write of the packet." c58d91c Fix file sizes for redirected disks Previously, max file size was truncated to 32bit, eg 4Gb size file, with this commit, it now uses 64bit file sizes. Theoretically judging by code, a test could be just showing a directory with a file bigger that 5Gb and you should see difference int the file sizes in explore before and after this fix. e3fbadf Fix scard handling of PCSCv2 Part 10. This is a fix for smartcard readers with pinpad, however it touches code that we believed was require. We need to do a regression test using normal smart card operations such as login and redirect (encrypt/decrytp) file.
The current nighlty build (5708) is not working well at all for me: - Connections to rds10 fail with error code 76 (protocol error). Nothing printed to stderr. The other servers work fine. Only happens when CredSSP is used. - SSO in tl-run-rdesktop doesn't work. I get a server side prompt for password. Without CredSSP I get a prompt for smart card auth. - Pressing escape in the server side prompt just reconnects and I'm stuck until I close the rdesktop window instead.
(In reply to comment #33) > > - Connections to rds10 fail with error code 76 (protocol error). Nothing > printed to stderr. The other servers work fine. Only happens when CredSSP is > used. > This no longer happens after a reboot of rds10.
(In reply to comment #33) > > - SSO in tl-run-rdesktop doesn't work. I get a server side prompt for > password. Without CredSSP I get a prompt for smart card auth. > See bug 7100 where we did the local workaround for SSO handling.
(In reply to comment #33) > > - Pressing escape in the server side prompt just reconnects and I'm stuck > until I close the rdesktop window instead. > Fix brought via vendor drop in revision r33084
One subtle change from this is that -g with percentages behaves slightly different: 1. Since you can resize the window it might not keep the specified percentage forever, and it is now about the initial size 2. It no longer updates the window size when the resolution changes (e.g. when resizing the ThinLinc client window) Might not be an issue in practice, but the man page needs to be updated as it states: > If the specified geometry depends on the screen size, and the > screen size is changed, rdesktop will automatically reconnect > using the new screen size. This requires that rdesktop has been > compiled with RandR support. However this also affects "-g workarea", which is used by tl-run-winapp. But that seems to be broken in the latest release as well as it doesn't track workarea reliably (tested with 4.8.0 on RHEL 6 with GNOME). And perhaps tl-run-winapp should stop using that argument now that we have more dynamic resizing.
(In reply to comment #39) > > 2. It no longer updates the window size when the resolution changes (e.g. when > resizing the ThinLinc client window) > Another issue here is that it still reconnects when this happens, even though it keeps the same size.
Tested Windows 2008 R2, 2012 R2 and 2016 with Ubuntu 16.04 and Unity in ThinLinc. Tested full screen, various -g arguments, resizing of rdesktop and the session. 2012 and 2016 work really well without any issues. 2008 has some positioning problems when reconnecting, but they are not regressions so we'll open new bugs for those.
Tested SeamlessRDP with 2008 R2 and 2016 with Ubuntu 16.04 and Unity in ThinLinc. Could not find any issues where it would misbehave when the session resizes.
(In reply to comment #36) > ------------------------------------------------------------------------ > r33084 | pairstation | trunk/ctc/rdesktop/rdesktop/ > > Bring vendor drop to CTC > > This brings a fix for a reconnect loop reported on bug #7094 > comment #33. > > > ------------------------------------------------------------------------ I'm still getting a reconnect loop with 2008. :/ This command line: > /opt/thinlinc/bin/rdesktop -k sv -d LAB -u ossman rds2008.lab.lkpg.cendio.se
Found two issues with 2008 and Unity: - For a very small screen (800x600), the rdesktop window gets maximised by default, and I am unable to un-maximize it. Every attempt triggers a resize, which re-maximizes it. - On a local display (not ThinLinc), I get a server login prompt after the first resize
(In reply to comment #43) > > I'm still getting a reconnect loop with 2008. :/ > > This command line: > > > /opt/thinlinc/bin/rdesktop -k sv -d LAB -u ossman rds2008.lab.lkpg.cendio.se Seen on two different Ubuntu 16.04 machines. Happens with both Unity and Xfce. Happens with both a new session, and reconnecting. Neither redirection nor CredSSP seem to affect things. With full debugging, this is the only thing seen between the Escape and disconnect: > Keyboard(debug): KeyPress for keysym (0xff1b, Escape) > Keyboard(debug): xkeymap_translate_key(), found scancode translation, scancode=0x1, modifiers=0x400 > Keyboard(debug): rdp_send_scancode(), sending scancode=0x1, flags=0x0 > Protocol(debug): rdp_send_input() > Protocol(debug): rdp_send_input() > Protocol(debug): rdp_send_input() > Protocol(debug): rdp_send_input() > Protocol(debug): rdp_send_input() > Protocol(debug): rdp_recv(), RDP packet #6, type 0x7 > Protocol(debug): process_ts_set_error_info_pdu(), error info = 0 > Protocol(debug): rdp_recv(), RDP packet #7, type 0x6 > Protocol(debug): rdp_loop(), RDP_PDU_DEACTIVATE packet received > Disconnecting... > Protocol(debug): rdp_disconnect()
(In reply to comment #44) > > - On a local display (not ThinLinc), I get a server login prompt after the > first resize This happens in ThinLinc as well. It is a bit random though, so it just seems the local display was better att triggering it. Debug output shows it getting the cookie: > Protocol(debug): rdp_recv(), RDP packet #14, type 0x7 > Protocol(debug): process_data_pdu(), received Logon PDU > Protocol(debug): process_pdu_logon(), Received TS_LOGIN_INFO_EXTENDED > Protocol(debug): process_ts_logon_info_extended() > Protocol(debug): process_ts_logon_info_extended(), saving Auto-Reconnect cookie, id=5 And using it during the reconnect: > Protocol(debug): rdp_send_logon_info(), sending RDP5-style Logon packet > Protocol(debug): rdp_send_logon_info(), called sec_init with packetlen 350 > Protocol(debug): rdp_send_logon_info(), Sending auto-reconnect cookie.
After some more debugging we think we've figured out the issue; a cookie is only valid for the server that issued it. We cannot use it for another server and hope to be redirected. This explains why things were a bit random. We had the following scenarios: a) Ubuntu 1, using a named DNS: - Connect to rds2008, resolved to rds2008-1 - Redirect to rds2008-2, store that address - Resize - Reconnect to rds2008-2 OK b) Ubuntu 1, using a named DNS: - Connect to rds2008, resolved to rds2008-2 - Resize - Reconnect to rds2008, resolved to rds2008-1 FAIL c) Ubuntu 2, using a Microsoft DNS: - Connect to rds2008, resolved to rds2008-1 - Redirect to rds2008-2, store that address - Resize - Reconnect to rds2008-2 OK d) Ubuntu 2, using a Microsoft DNS: - Connect to rds2008, resolved to rds2008-2 - Resize - Reconnect to rds2008, resolved to rds2008-2 OK e) Ubuntu 2, using a Microsoft DNS, bad timing: - Connect to rds2008, resolved to rds2008-2 - Resize - Reconnect to rds2008, resolved to rds2008-1 FAIL named uses a per request round robin, so you always got swapped results for each request. Microsoft's DNS however swaps every second, no matter the number of requests. So you had to time things just right to provoke the bug.
(In reply to comment #44) > - On a local display (not ThinLinc), I get a server login prompt after the > first resize (In reply to comment #44) > named uses a per request round robin, so you always got swapped results for > each request. Microsoft's DNS however swaps every second, no matter the > number of requests. So you had to time things just right to provoke the bug. https://github.com/rdesktop/rdesktop/pull/249 would appreciate feedback before merging, not feeling very confident about this
(In reply to comment #43) > > I'm still getting a reconnect loop with 2008. :/ > Works well now. I also did the following as regression test: - Disconnecting and logging out the session as an admin - Reconnect after network errors This worked well on 2008 R2. However not so much on 2012 R2: a) I get a reconnect loop there now b) Throwing out the user as admin results in an immediate reconnect (probably same issue as a)) c) The reconnect after network error results in an incorrectly resized and clipped session. It seems to revert to the session size it started with. b) also happens on 2016
(In reply to comment #44) > > - On a local display (not ThinLinc), I get a server login prompt after the > first resize This works well now. I can confirm using the debug output that it will reuse the same IP address on every reconnect.
Re-tested: - Aborting server side login - name resolution on reconnect - Disconnect/logout by admin - Network problems (including resize) Tested with 2008 R2, 2012 R2, 2016.
All window placement issues have been forked off to bug 7140.
Everything is now working and tested.