You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Mike Jumper <mi...@guac-dev.org> on 2017/08/13 16:32:06 UTC

Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Hello all,

There has been a long-outstanding issue in JIRA regarding RemoteApp which
I've been unable to find the time to investigate, and could use some
attention from a fresh pair of eyes:

https://issues.apache.org/jira/browse/GUACAMOLE-125

The issue reported is that the screen size of the RemoteApp session appears
to persist at a lower resolution after reconnecting. Though the screen size
is initially set correctly, and reconnecting produces a Guacamole
connection with the correct size, RemoteApp windows are clipped within the
screen area of the previous connection.

Since that reconnecting step guarantees that there is no shared state
between the Guacamole connections, I can think of at least the following
possibilities:

1) Windows itself was never designed to handle changes in client resolution
for a single RemoteApp session, or this is a bug which is generally not
encountered in practice (as the client resolution for a native client would
be the screen resolution, and the user would need to disconnect, change
their monitor settings, and reconnect for this to occur).

2) It is a bug in FreeRDP.

3) It is not a bug in FreeRDP, but there are some additional properties
which need to be set, functions which need to be called, or some other
undocumented magic which needs to be reverse-engineered from FreeRDP's X11
client and added to Guacamole's implementation of the same.

I have not been able to reproduce this yet myself, but it's clear that this
problem does occur, at least for some users.

Any assistance in nailing this down so this issue can move forward would be
appreciated.

Thanks,

- Mike

Re: Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Posted by Nicholas Couchman <ni...@yahoo.com.INVALID>.
I was just looking at this JIRA issue yesterday - I will try to replicate this and see what I can figure out.

-Nick

> On Aug 13, 2017, at 12:32, Mike Jumper <mi...@guac-dev.org> wrote:
> 
> Hello all,
> 
> There has been a long-outstanding issue in JIRA regarding RemoteApp which
> I've been unable to find the time to investigate, and could use some
> attention from a fresh pair of eyes:
> 
> https://issues.apache.org/jira/browse/GUACAMOLE-125
> 
> The issue reported is that the screen size of the RemoteApp session appears
> to persist at a lower resolution after reconnecting. Though the screen size
> is initially set correctly, and reconnecting produces a Guacamole
> connection with the correct size, RemoteApp windows are clipped within the
> screen area of the previous connection.
> 
> Since that reconnecting step guarantees that there is no shared state
> between the Guacamole connections, I can think of at least the following
> possibilities:
> 
> 1) Windows itself was never designed to handle changes in client resolution
> for a single RemoteApp session, or this is a bug which is generally not
> encountered in practice (as the client resolution for a native client would
> be the screen resolution, and the user would need to disconnect, change
> their monitor settings, and reconnect for this to occur).
> 
> 2) It is a bug in FreeRDP.
> 
> 3) It is not a bug in FreeRDP, but there are some additional properties
> which need to be set, functions which need to be called, or some other
> undocumented magic which needs to be reverse-engineered from FreeRDP's X11
> client and added to Guacamole's implementation of the same.
> 
> I have not been able to reproduce this yet myself, but it's clear that this
> problem does occur, at least for some users.
> 
> Any assistance in nailing this down so this issue can move forward would be
> appreciated.
> 
> Thanks,
> 
> - Mike


Re: Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Posted by Nick Couchman <ni...@yahoo.com.INVALID>.
> Thanks, Nick - I hope something jumps out. The fact that the problem
> disappears after upgrading and doing a reboot dance is troubling. On one
> hand, it does suggest that there is something FreeRDP-specific about this,
> but if the problem does not occur when xfreerdp is used, then there must be
> some way for Guacamole to achieve the same.
Well, I may have hit upon something, though I'm not certain, yet.  I decided to look at the difference in the RAIL library between 1.0 and 1.1, since the problem exists in 1.0 but is fixed in 1.1.  Take a look at the difference in these two pieces of code:
Stable-1.0:https://github.com/FreeRDP/FreeRDP/blob/b9fd0db009ac1bba19cf9049a7d556c120a03073/libfreerdp-rail/rail.c#L100

Stable-1.1https://github.com/FreeRDP/FreeRDP/blob/03ab68318966c3a22935a02838daaea7b7fbe96c/libfreerdp/rail/rail.c#L109

The comment above the 1.1 version is particularly interesting - this method deals specifically with screen locked situations, where there is a switch between RAIL monitoring the desktop and not monitoring it...such as would happen when disconnecting/reconnecting to a RAIL session with Guacamole.
I'm still wrapping my brain around the FreeRDP code, so does it look like I'm on the right track at all?  I haven't dug into the xfreerdp code, yet, to see if there's a place there where there's any sort of method or work-around for dealing with it.
-Nick  

Re: Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Posted by Mike Jumper <mi...@guac-dev.org>.
On Mon, Aug 14, 2017 at 10:39 AM, Nick Couchman <
nick.couchman@yahoo.com.invalid> wrote:

> So, I finally got FreeRDP updated on my system from 1.0.2 to 1.1, and the
> problem has disappeared, with one item worth noting...
> When I left the system last night, I had left a session opened that I had
> started with Guacamole and FreeRDP 1.0.2, and I had disconnected the
> session.  I upgraded FreeRDP and reconnected the session, and the issue was
> there.  I then killed the session off completely (send Ctrl-Alt-Delete to
> the remote desktop server, Sign Off) and restarted it at various
> resolutions, and the problem has completely disappeared.
> This seems to indicate that the issue is something in how Guacamole +
> FreeRDP establishes the initial session when you first connect to the
> RemoteApp.  So, it's either an issue in Guacamole with how Guacamole sets
> up the RemoteApp connection with the older FreeRDP version, or it's an
> issue in FreeRDP 1.0.2 with how FreeRDP establishes the RemoteApp session
> that xfreerdp somehow works around.
> I'll take a look at the xfreerdp code in the FreeRDP stable-1.0 branch and
> see if there's anything obvious that stands out as to how the RemoteApp
> sessions are initialized or maintained that might be missing from
> Guacamole.  Let me know if I can provide any more information.
>

Thanks, Nick - I hope something jumps out. The fact that the problem
disappears after upgrading and doing a reboot dance is troubling. On one
hand, it does suggest that there is something FreeRDP-specific about this,
but if the problem does not occur when xfreerdp is used, then there must be
some way for Guacamole to achieve the same.

- Mike

Re: Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Posted by Nick Couchman <ni...@yahoo.com.INVALID>.
So, I finally got FreeRDP updated on my system from 1.0.2 to 1.1, and the problem has disappeared, with one item worth noting...
When I left the system last night, I had left a session opened that I had started with Guacamole and FreeRDP 1.0.2, and I had disconnected the session.  I upgraded FreeRDP and reconnected the session, and the issue was there.  I then killed the session off completely (send Ctrl-Alt-Delete to the remote desktop server, Sign Off) and restarted it at various resolutions, and the problem has completely disappeared.
This seems to indicate that the issue is something in how Guacamole + FreeRDP establishes the initial session when you first connect to the RemoteApp.  So, it's either an issue in Guacamole with how Guacamole sets up the RemoteApp connection with the older FreeRDP version, or it's an issue in FreeRDP 1.0.2 with how FreeRDP establishes the RemoteApp session that xfreerdp somehow works around.
I'll take a look at the xfreerdp code in the FreeRDP stable-1.0 branch and see if there's anything obvious that stands out as to how the RemoteApp sessions are initialized or maintained that might be missing from Guacamole.  Let me know if I can provide any more information.
-Nick
On Sunday, August 13, 2017, 10:17:30 PM EDT, Nick Couchman <ni...@yahoo.com.INVALID> wrote:

Okay, some initial observations on this:- I am able to reproduce the issue, and xfreerdp appears to behave correctly while Guacamole exhibits the behavior described in the JIRA issue (more or less).  That doesn't mean I'm pointing the finger at Guacamole, at least, not totally - it actually looks to me like there's some sort of bug or limitation in either the RDP protocol or the FreeRDP core that has been worked around by xfreerdp in order to make it work correctly.  See the following commit and pull request, in the xf_monitor.c file, the comment starts with "WORKAROUND" - that's awfully telling - and includes information about window sizing.
https://github.com/FreeRDP/FreeRDP/pull/2386/commits/ee8d0a64405dbd13b1b83835c64e049fde18866b
https://github.com/FreeRDP/FreeRDP/pull/2386

- The "bug" is a little more subtle than the JIRA issue makes it out to be - there's a lot of fixation on 1024x768 geometry and the RemoteApps being held to that.  First, I think it's important to note that, in xfreerdp, when you enable app mode, the default resolution of 1024x768 *is not used.*  It switches to workarea as the geometry, which then involves several calculations on the work area from the X11 monitor size.  Furthermore, the behavior I observed in Guacamole is that, on my 1600x900 monitor, when I reproduce this issue, I am able to fully size vertically (900, which is > 768), and I can drag most of the way over horizontally - certainly at least 1200, if not more like 1400 - but then a maximize operation snaps it to something closer to 1024x768.  This is hard to describe, but very that's very much how it behaves - you can actually drag it to areas of the screen that are beyond the "maximize" point of the screen.  This, to me, screams Windows window manager or RDP server bug - but, whatever the case, xfreerdp seems to have worked around it to get the window to behave correctly.
- On the JIRA issue I see a lot of references to CentOS7, and, if everyone else's CentOS7 installs are anything like mine, then the folks on the JIRA issue are consistently using FreeRDP 1.0.x (1.0.2 in my case).  I've not, yet, managed to upgrade FreeRDP to the point where I can get guacd pointed at a 1.1 install - if I can get that going, I'll be able to verify that the issue still occurs in FreeRDP 1.1.  Mike, you said you've been unable to reproduce the issue - I'd be very interested to know if you're using FreeRDP 1.0 or 1.1 with guacd.
- Using the full screen flag with xfreerdp results in really strange behavior - the inability to drag the window at all, and odd maximization.  I don't think this is particularly relevant to this issue, though, since Guacamole doesn't set the full screen flag - it just sends the geometry of the screen.  Just worth noting, especially if it shows up anywhere on the JIRA issue - full screen in browser using Guacamole is not the same as specifying the full screen flag in xfreerdp.
Mike, let me know if there are any specific tests you want me to do or anything you want me to capture - screen shots, network data, etc.
Below is some more detail on my exact steps to test with both xfreerdp and Guacamole, and my environment.
Guacamole Server: CentOS 7RDP Server: Windows 10 EnterpriseGuacamole Version: 0.9.13-incubatingFreeRDP Version: 1.0.2 (package included with CentOS7)
Preconfig Step: Get Kim Knight's RemoteAppTool and configure Notepad as a remote app pointing to c:\windows\notepad.exe
==Steps in xfreerdp==1) Set display to 1024x768 resolution.2) Launch xfreerdp in RemoteApp mode with Notepad as the application3) Put in some text in Notepad to verify that I'm going to get the same session back - do not save it.4) Disconnect xfreerdp by pressing Ctrl-C on the command line5) Set display to max resolution (1600x900 on my laptop)6) Launch xfreerdp in RemoteApp mode with Notepad as the application7) Verify text entered before is back.8) Drag window around screen, maximize it, unmaximize, verify behavior, etc.
Command line for xfreerdp: xfreerdp -d domain -u nick --from-stdin --no-tls --no-nla --app --plugin rail --data '||Notepad' -- windows10.example.com
==Steps in Guacamole==1) Configure a connection to the same system as used above, and specify "||Notepad" as the remote app in the connection.2) Size the browser window to something small-ish - 800x600.3) Launch the connection to the Windows system with the remote app.4) Enter some text in Notepad, do not save, and then use Ctrl-Shift-Alt to disconnect the session.5) Maximize the browser window.6) Connect to the same connection with the remote app7) Observe that text entered before is still present.8) Attempt to drag window to the right of the screen - window "stops" at somewhere between 1200 and 1400 pixels and does not go all the way to the edge of the screen.9) Press "maximize" button and observe that window maximizes to a size that appears to be roughly 1024x768, though it's hard to tell exactly - it's smaller than both the horizontal and veritical limits of the screen.10) Send Chrome to full-screen and repeat, and observe very similar behavior.
-NickOn Sunday, August 13, 2017, 12:32:53 PM EDT, Mike Jumper <mi...@guac-dev.org> wrote:

Hello all,

There has been a long-outstanding issue in JIRA regarding RemoteApp which
I've been unable to find the time to investigate, and could use some
attention from a fresh pair of eyes:

https://issues.apache.org/jira/browse/GUACAMOLE-125

The issue reported is that the screen size of the RemoteApp session appears
to persist at a lower resolution after reconnecting. Though the screen size
is initially set correctly, and reconnecting produces a Guacamole
connection with the correct size, RemoteApp windows are clipped within the
screen area of the previous connection.

Since that reconnecting step guarantees that there is no shared state
between the Guacamole connections, I can think of at least the following
possibilities:

1) Windows itself was never designed to handle changes in client resolution
for a single RemoteApp session, or this is a bug which is generally not
encountered in practice (as the client resolution for a native client would
be the screen resolution, and the user would need to disconnect, change
their monitor settings, and reconnect for this to occur).

2) It is a bug in FreeRDP.

3) It is not a bug in FreeRDP, but there are some additional properties
which need to be set, functions which need to be called, or some other
undocumented magic which needs to be reverse-engineered from FreeRDP's X11
client and added to Guacamole's implementation of the same.

I have not been able to reproduce this yet myself, but it's clear that this
problem does occur, at least for some users.

Any assistance in nailing this down so this issue can move forward would be
appreciated.

Thanks,

- Mike

Re: Reported issues with RemoteApp screen size / clipping (GUACAMOLE-125)

Posted by Nick Couchman <ni...@yahoo.com.INVALID>.
Okay, some initial observations on this:- I am able to reproduce the issue, and xfreerdp appears to behave correctly while Guacamole exhibits the behavior described in the JIRA issue (more or less).  That doesn't mean I'm pointing the finger at Guacamole, at least, not totally - it actually looks to me like there's some sort of bug or limitation in either the RDP protocol or the FreeRDP core that has been worked around by xfreerdp in order to make it work correctly.  See the following commit and pull request, in the xf_monitor.c file, the comment starts with "WORKAROUND" - that's awfully telling - and includes information about window sizing.
https://github.com/FreeRDP/FreeRDP/pull/2386/commits/ee8d0a64405dbd13b1b83835c64e049fde18866b
https://github.com/FreeRDP/FreeRDP/pull/2386

- The "bug" is a little more subtle than the JIRA issue makes it out to be - there's a lot of fixation on 1024x768 geometry and the RemoteApps being held to that.  First, I think it's important to note that, in xfreerdp, when you enable app mode, the default resolution of 1024x768 *is not used.*  It switches to workarea as the geometry, which then involves several calculations on the work area from the X11 monitor size.  Furthermore, the behavior I observed in Guacamole is that, on my 1600x900 monitor, when I reproduce this issue, I am able to fully size vertically (900, which is > 768), and I can drag most of the way over horizontally - certainly at least 1200, if not more like 1400 - but then a maximize operation snaps it to something closer to 1024x768.  This is hard to describe, but very that's very much how it behaves - you can actually drag it to areas of the screen that are beyond the "maximize" point of the screen.  This, to me, screams Windows window manager or RDP server bug - but, whatever the case, xfreerdp seems to have worked around it to get the window to behave correctly.
- On the JIRA issue I see a lot of references to CentOS7, and, if everyone else's CentOS7 installs are anything like mine, then the folks on the JIRA issue are consistently using FreeRDP 1.0.x (1.0.2 in my case).  I've not, yet, managed to upgrade FreeRDP to the point where I can get guacd pointed at a 1.1 install - if I can get that going, I'll be able to verify that the issue still occurs in FreeRDP 1.1.  Mike, you said you've been unable to reproduce the issue - I'd be very interested to know if you're using FreeRDP 1.0 or 1.1 with guacd.
- Using the full screen flag with xfreerdp results in really strange behavior - the inability to drag the window at all, and odd maximization.  I don't think this is particularly relevant to this issue, though, since Guacamole doesn't set the full screen flag - it just sends the geometry of the screen.  Just worth noting, especially if it shows up anywhere on the JIRA issue - full screen in browser using Guacamole is not the same as specifying the full screen flag in xfreerdp.
Mike, let me know if there are any specific tests you want me to do or anything you want me to capture - screen shots, network data, etc.
Below is some more detail on my exact steps to test with both xfreerdp and Guacamole, and my environment.
Guacamole Server: CentOS 7RDP Server: Windows 10 EnterpriseGuacamole Version: 0.9.13-incubatingFreeRDP Version: 1.0.2 (package included with CentOS7)
Preconfig Step: Get Kim Knight's RemoteAppTool and configure Notepad as a remote app pointing to c:\windows\notepad.exe
==Steps in xfreerdp==1) Set display to 1024x768 resolution.2) Launch xfreerdp in RemoteApp mode with Notepad as the application3) Put in some text in Notepad to verify that I'm going to get the same session back - do not save it.4) Disconnect xfreerdp by pressing Ctrl-C on the command line5) Set display to max resolution (1600x900 on my laptop)6) Launch xfreerdp in RemoteApp mode with Notepad as the application7) Verify text entered before is back.8) Drag window around screen, maximize it, unmaximize, verify behavior, etc.
Command line for xfreerdp: xfreerdp -d domain -u nick --from-stdin --no-tls --no-nla --app --plugin rail --data '||Notepad' -- windows10.example.com
==Steps in Guacamole==1) Configure a connection to the same system as used above, and specify "||Notepad" as the remote app in the connection.2) Size the browser window to something small-ish - 800x600.3) Launch the connection to the Windows system with the remote app.4) Enter some text in Notepad, do not save, and then use Ctrl-Shift-Alt to disconnect the session.5) Maximize the browser window.6) Connect to the same connection with the remote app7) Observe that text entered before is still present.8) Attempt to drag window to the right of the screen - window "stops" at somewhere between 1200 and 1400 pixels and does not go all the way to the edge of the screen.9) Press "maximize" button and observe that window maximizes to a size that appears to be roughly 1024x768, though it's hard to tell exactly - it's smaller than both the horizontal and veritical limits of the screen.10) Send Chrome to full-screen and repeat, and observe very similar behavior.
-NickOn Sunday, August 13, 2017, 12:32:53 PM EDT, Mike Jumper <mi...@guac-dev.org> wrote:

Hello all,

There has been a long-outstanding issue in JIRA regarding RemoteApp which
I've been unable to find the time to investigate, and could use some
attention from a fresh pair of eyes:

https://issues.apache.org/jira/browse/GUACAMOLE-125

The issue reported is that the screen size of the RemoteApp session appears
to persist at a lower resolution after reconnecting. Though the screen size
is initially set correctly, and reconnecting produces a Guacamole
connection with the correct size, RemoteApp windows are clipped within the
screen area of the previous connection.

Since that reconnecting step guarantees that there is no shared state
between the Guacamole connections, I can think of at least the following
possibilities:

1) Windows itself was never designed to handle changes in client resolution
for a single RemoteApp session, or this is a bug which is generally not
encountered in practice (as the client resolution for a native client would
be the screen resolution, and the user would need to disconnect, change
their monitor settings, and reconnect for this to occur).

2) It is a bug in FreeRDP.

3) It is not a bug in FreeRDP, but there are some additional properties
which need to be set, functions which need to be called, or some other
undocumented magic which needs to be reverse-engineered from FreeRDP's X11
client and added to Guacamole's implementation of the same.

I have not been able to reproduce this yet myself, but it's clear that this
problem does occur, at least for some users.

Any assistance in nailing this down so this issue can move forward would be
appreciated.

Thanks,

- Mike