FreeRDP shadow server for Windows: share this PC's screen over RDP
=====================================================================

The programs in this folder let an RDP client (FreeRDP Web in a browser,
FreeRDP's own client, or Windows' Remote Desktop Connection) see and use
this PC's own screen: the desktop of whoever is logged in, and, through the
service, the logon and lock screens, UAC prompts and Ctrl+Alt+Del too. It
shares the one console desktop, like Remote Assistance or VNC; it does not
start sessions of its own. The picture is encoded in AV1.

  freerdp-shadow-service.exe   runs the shadow server as a Windows service
  freerdp-shadow-cli.exe       the shadow server itself
  winpr-hash.exe               a line of a SAM file (only for passwords that
                               are not Windows accounts, see below)

Install the service (in an administrator's PowerShell, in this folder)
-----------------------------------------------------------------------

  .\freerdp-shadow-service.exe install --allow-sas -- /bind-address:127.0.0.1 /port:3388 /gfx-av1 /gfx-av2 -gfx-avc444

AV2 goes to the clients that offer it (the kit's FreeRDP clients and FreeRDP
Web), AV1 to the others. Smaller frames for the same picture, for more processor
time on both sides: this PC encodes with libavm, and FreeRDP Web decodes in the
page, in software. AV1 only: /gfx-av2:off instead of /gfx-av2 (AV2 is on by
default since FreeRDP 20261110.3).

H.264 goes to the clients without AV1 or AV2 (Windows' own Remote Desktop client, most
others) as AVC420: this PC encodes it with Windows' own Media Foundation encoder, no
OpenH264 needed. -gfx-avc444 leaves AVC444 out for now, because its picture turned blocky
with Media Foundation; the FreeRDP fixes for that are in, and AVC444 comes back once it
is seen sharp. On Windows Server the encoder may need the feature "Media Foundation"
(Install-WindowsFeature Server-Media-Foundation), though Server 2025 has it without.
H.264 on the graphics card is not tested yet.

AV1 4:2:0 is encoded on the graphics card when it has an AV1 encoder (Media
Foundation's hardware encoder, e.g. NVIDIA's; tested on an NVIDIA laptop GPU), and
with libaom (in software) otherwise; 4:4:4 is always libaom. /codec-first:software
keeps it in software, /codec-first:hardware:<id> picks a card, and /codec-list
shows the encoders this PC has (freerdp-shadow-cli.exe /codec-list). The log
names the one in use: "AV1 encoder: Media Foundation ... (hardware ...)".

It starts at once and with Windows, on port 3388, the kit's shadow port on
every OS: 3389 stays free for Windows' own Remote Desktop. Without /port the
server takes 3389. --allow-sas lets the service send
Ctrl+Alt+Del (it sets the policy SoftwareSASGeneration = 1); leave it out
if you do not want that. --log <folder> writes logs there. Remove it with

  .\freerdp-shadow-service.exe uninstall

It also puts back the Ctrl+Alt+Del policy as install found it (--allow-sas changes
it only when services could not send Ctrl+Alt+Del before).

Or, without a service, for the logged-on user's desktop only:

  .\freerdp-shadow-cli.exe /bind-address:127.0.0.1 /port:3388 /gfx-av1 /gfx-av2

The size of the picture
-----------------------

It shares this PC's own screen as it is: the monitors, their resolution and their scale
stay what Windows has set, and a client's window shows that screen, scaled if the window
is smaller. The server cannot take another size (no Display Control), so a client's
/dynamic-resolution, its /multimon layout and its HiDPI scale factors change nothing here,
and the client logs no "HiDPI:" line.
For a session that follows the client's windows and monitors, HiDPI included, use a server
that starts sessions of its own: xrdp, or Windows' own Remote Desktop on a Pro edition.

Connect
-------

Logins are Windows accounts (Network Level Authentication, through
Windows' own security packages). Keep the server on 127.0.0.1 as above and
reach it through SSH (Windows' optional feature "OpenSSH Server"):

  ssh -L 13388:127.0.0.1:3388 <user>@<this PC>

then connect to 127.0.0.1:13388. FreeRDP Web: start a WebSocket gateway on this PC
(pip install websockify, then websockify 127.0.0.1:3390 127.0.0.1:3388) and
forward 3390 instead.

A Unix socket instead of TCP: /ipc-socket:<path> (Windows 10 1803 or later;
who may connect is the socket file's ACL). Windows' own sshd cannot forward
to a socket file; a small relay on this PC can.

Passwords that are not Windows accounts: set WINPR_NATIVE_SSPI=0 for the
server and give it /sam-file:<file>, one line per user from
winpr-hash -u <user> -p <password> -f sam. An NT hash works like the
password itself: keep the file's ACL strict.

What is in it: MANIFEST (the sources and their versions), licenses\.
More: https://github.com/congzhangzh/rdp-release-kit
