Allow connecting to a Hyper-V virtual machine (VMConnect) by setting the new `vmconnect` field of the connector `Config` to the target VM ID. When set, the connection sequence follows the flow expected by Hyper-V hosts instead of the regular one: 1. A V2 preconnection blob containing "<vm-id>;EnhancedMode=1" is sent (new `PreconnectionBlob` initial connector state). 2. The security upgrade (TLS) and CredSSP are performed immediately. 3. The X.224 connection initiation is only performed afterwards, over the secured channel, without a routing cookie. The regular (non-VMConnect) sequence is unchanged. Additionally, the extended client info packet now always encodes the auto-reconnect cookie length (empty when unset) and the reserved1 and reserved2 fields once the performance flags are present, as some servers (e.g. Hyper-V hosts) expect them. The decoder already accepted them. The `--vmconnect <ID>` CLI option is added to ironrdp-viewer, and a `vmconnect` config setter is exposed through the FFI. https://claude.ai/code/session_01YR2dvq8AVtyMb6F4XKeZAZ
IronRDP
A collection of Rust crates providing an implementation of the Microsoft Remote Desktop Protocol, with a focus on security.
Demonstration
https://user-images.githubusercontent.com/3809077/202049929-76f42471-aeb0-41da-9118-0dc6ea491bd2.mp4
Video Codec Support
Supported codecs:
- Uncompressed raw bitmap
- Interleaved Run-Length Encoding (RLE) Bitmap Codec
- RDP 6.0 Bitmap Compression
- Microsoft RemoteFX (RFX)
Examples
ironrdp-viewer
A full-fledged RDP client based on IronRDP crates suite, and implemented using non-blocking, asynchronous I/O.
It is built on top of the reusable ironrdp-client library crate.
cargo run --bin ironrdp-viewer -- <HOSTNAME> --username <USERNAME> --password <PASSWORD>
screenshot
Example of utilizing IronRDP in a blocking, synchronous fashion.
This example showcases the use of IronRDP in a blocking manner. It demonstrates how to create a basic RDP client with just a few hundred lines of code by leveraging the IronRDP crates suite.
In this basic client implementation, the client establishes a connection with the destination server, decodes incoming graphics updates, and saves the resulting output as a BMP image file on the disk.
cargo run --example=screenshot -- --host <HOSTNAME> --username <USERNAME> --password <PASSWORD> --output out.bmp
How to enable RemoteFX on server
Run the following PowerShell commands, and reboot.
Set-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services' -Name 'ColorDepth' -Type DWORD -Value 5
Set-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows NT\Terminal Services' -Name 'fEnableVirtualizedGraphics' -Type DWORD -Value 1
Alternatively, you may change a few group policies using gpedit.msc:
-
Run
gpedit.msc. -
Enable
Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/RemoteFX for Windows Server 2008 R2/Configure RemoteFX -
Enable
Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008 R2 SP1 -
Enable
Computer Configuration/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Session Host/Remote Session Environment/Limit maximum color depth -
Reboot.
Rust version (MSRV)
IronRDP libraries follow a conservative Minimum Supported Rust Version (MSRV) policy.
The MSRV is the oldest stable Rust release that is at least 6 months old, bounded by the Rust version available in Debian stable-backports and Fedora stable.
The pinned toolchain in rust-toolchain.toml is both the project toolchain and the MSRV validated by CI.
See ARCHITECTURE.md for the full policy.
Architecture
See the ARCHITECTURE.md document.
Getting help
- Report bugs in the issue tracker
- Discuss the project on the matrix room