Xpra: Ticket #2711: support mswindows 10 openssh server to start shadow

After installing the openssh server for windows 10 through the "additional features", one must go through extra hoops to actually make it work (...) Windows SSH: Permissions for 'private-key' are too open:

:: # Remove Inheritance ::
Cmd /c Icacls %Key% /c /t /Inheritance:d

See also: Troubleshooting Steps.


Once that's working properly, I can start a shadow server on the Winlogon secure desktop using psexec:

windows 10 test@DESKTOP-Q4IVN7P C:\Users\Windows 10 Test>psexec -x -s  "C:\\Program Files\\Xpra\\xpra.exe" "shadow" "--bind-tcp=0.0.0.0:10000"

Problem with this is that the shadow server stops working (blank screen) as soon as we login. But this may still help with #1527.

If the user is logged in, then we need:

psexec -i 1 "C:\\Program Files\\...

(after using quser to locate the session id) It sort of works: the xpra process is started and we can connect to it (xpra stop, xpra info etc), but the screen dimensions are bogus so we can't xpra attach to it. When using xpra_cmd.exe or clicking on About in the shadow systray, the cmd.exe and about windows are all black so clearly something is still missing to access the GUI session properly.



Tue, 07 Apr 2020 16:27:19 GMT - Antoine Martin: status changed

Minor fixes: r26018, r26019, r26021, r26022.

The solution to the black window is just to add -s (system privileges), as suggested here: PsExec runs remote GUI as black screen - Windows7. Maybe the same solution can be applied to #1527.

Some problems with using psexec:


Thu, 23 Apr 2020 16:35:44 GMT - Antoine Martin:

Almost works as of r26171 + r26172.

Still TODO:

Installation paths issues: maybe generate a "run-xpra" script in %APPDATA%? (that way we don't have to assume xpra is installed in C:\Program Files\Xpra) This can also take care of invoking the paexec wrapper. (but needs to be done as a post-install step to ensure it is always present?)


Sat, 25 Apr 2020 15:45:33 GMT - Antoine Martin:

Updates:

It almost works using:

xpra shadow "ssh://user:password@IP/" --remote-xpra=xpra.exe -d ssh --bind-tcp=0.0.0.0:10000

the shadow server starts and we can connect to it via TCP. But the fdproxy errors out because stdin and stdout are not connected. (we run Xpra.exe which is a GUI process). Running Xpra_cmd.exe does not help: the CMD window shows up, but the stdin and stdout pipes are silent..

(paexec is not bundled in by default since this does not work fully yet)


Sun, 26 Apr 2020 15:13:39 GMT - Antoine Martin: status changed; resolution set

Finally working as of r26182 + r26183. ie:

xpra shadow "ssh://user:password@IP/" -d ssh
(..)
Authentication (password) successful!
(..)
run_test_command('which $XDG_RUNTIME_DIR/xpra/run-xpra')
(..)
using 'C:\\Program Files\\Xpra\\Xpra_cmd.exe'
channel exec_command("C:\\Program Files\\Xpra\\Xpra_cmd.exe" "_proxy_shadow_start" "--password=password" "--debug=ssh")

Sat, 23 Jan 2021 05:58:43 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2711