FreeRDP Configuration Manual
FreeRDP Configuration Manual
Marc-Andr Moreau
Awake Coding Consulting Inc.
Contents
1 Introduction
1.1
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Network Tracing
2.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2
Certificate Generation . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1
WinPR . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2
MakeCert . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.3
OpenSSL . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3
Certificate Conversion . . . . . . . . . . . . . . . . . . . . . . . .
2.4
Certificate Installation . . . . . . . . . . . . . . . . . . . . . . . .
2.4.1
Terminal Server . . . . . . . . . . . . . . . . . . . . . . . .
10
2.4.1.1
10
2.4.1.2
Windows 7 . . . . . . . . . . . . . . . . . . . . .
10
TS Gateway . . . . . . . . . . . . . . . . . . . . . . . . . .
11
Protocol Configuration . . . . . . . . . . . . . . . . . . . . . . . .
11
2.5.1
TLS 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
2.5.1.1
11
2.5.1.2
12
2.5.2
UDP Transport . . . . . . . . . . . . . . . . . . . . . . . .
12
2.5.3
Compression . . . . . . . . . . . . . . . . . . . . . . . . .
12
2.5.4
RDP Security . . . . . . . . . . . . . . . . . . . . . . . . .
13
2.4.2
2.5
2.5.5
2.6
13
Packet Capturing . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
2.6.1
Message Analyzer . . . . . . . . . . . . . . . . . . . . . .
13
2.6.2
Network Monitor . . . . . . . . . . . . . . . . . . . . . . .
14
2.6.2.1
Installation . . . . . . . . . . . . . . . . . . . . .
14
2.6.2.2
Capturing . . . . . . . . . . . . . . . . . . . . . .
14
Wireshark . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
2.6.3.1
Installation . . . . . . . . . . . . . . . . . . . . .
14
2.6.3.2
Compilation . . . . . . . . . . . . . . . . . . . .
15
2.6.3.3
Configuration . . . . . . . . . . . . . . . . . . . .
15
2.6.3.4
Capturing . . . . . . . . . . . . . . . . . . . . . .
15
2.6.3
17
Adding Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
3.1.1
17
3.1.1.1
Local Users . . . . . . . . . . . . . . . . . . . . .
17
3.1.1.2
Domain Users . . . . . . . . . . . . . . . . . . .
18
4 Active Directory
4.1
4.2
19
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
19
4.1.1
19
4.1.2
22
Client Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
23
4.2.1
23
4.2.2
23
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
25
5.1.1
25
25
26
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
26
6.1.1
26
7.2
27
Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
27
7.1.1
27
Client Configuration . . . . . . . . . . . . . . . . . . . . . . . . .
28
7.2.1
28
Windows 7 . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 1
Introduction
This document specifies various configuration procedures for common RDP deployment scenarios. These instructions should be used as a reference to help RDP
developers configure a proper test setup to help them in their implementation.
1.1
Glossary
To be expanded.
1.2
References
1 https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/
FreeRDP-User-Manual.pdf?raw=true
2 https://github.com/awakecoding/FreeRDP-Manuals/blob/master/Configuration/
FreeRDP-Developer-Manual.pdf?raw=true
3 https://github.com/awakecoding/FreeRDP-Manuals/blob/master/Testing/
FreeRDP-Testing-Manual.pdf?raw=true
Chapter 2
Network Tracing
2.1
Introduction
2.2
Certificate Generation
The following sections specify how to generate valid certificates that can be used
with an RDP server.
2.2.1
WinPR
For the sake of simplicity, a replacement of the commonly used makecert tool
has been implemented as part of the WinPR tools as winpr-makecert. The tool
offers the same command-line interface as the original makecert and can generate
valid RDP certificates.
In the FreeRDP source tree, the winpr-makecert executable can be found in
winpr/tools/makecert/cli. The core of the winpr-makecert tool is built as
a reusable library which is used by many of the FreeRDP-based servers for
automatic generation of a self-signed certificate when no other certificate was
previously installed.
The flexibility of an open source makecert replacement usable as both a redistributable excutable or an embeddedable library is such that third parties who
implement solutions that have nothing to do with RDP may still want to use it.
To generate a default self-signed RDP certificate, use the -rdp option:
winpr-makecert -rdp
Information regarding the generated certificate will be shown. The certificate
and private key files will be outputted in the current working directory with a
name that matches the current machines hostname. In this case, my machines
name is system76, so the generated files are system76.crt and system76.key.
A non-default file output name can be specified using the last command-line
argument:
winpr-makecert -rdp server
In this case, winpr-makecert will name the files server.crt and server.key.
The files generated by winpr-makecert are readily usable by the FreeRDP servers
but need to be converted to pfx for usage with the Microsoft RDP server. Please
consult the section of this manual on certificate conversion to learn how this can
be done.
2.2.2
MakeCert
MakeCert is a tool that is included with the Windows SDK or the Windows
DDK that can generate certificates in the pfx file format.
If you have the Windows DDK installed, makecert.exe can be found at:
<DDK_path>\WinDDK\<version>\bin\<arch>\makecert.exe
If you have the Windows SDK installed, makecert.exe can be found at:
%programfiles%\Microsoft SDKs\Windows\<version>\bin\makecert.exe
MakeCert is currently not distributed separately from the Windows DDK or the
Windows SDK. Since it is a small and stand-alone tool, it can be easily copied
to another machine without the need for installing large software development
packages. Keeping a copy for later use can therefore save a lot of time when
configuring new machines.
To generate a self-signed certificate, invoke MakeCert with the following options:
6
2.2.3
OpenSSL
extensions = x509v3
[ x509v3 ]
keyUsage = keyEncipherment,dataEncipherment
extendedKeyUsage = serverAuth
Create an OpenSSL config file named rdp.cfg:
[ req ]
default_bits
= 2048
distinguished_name = req_DN
string_mask
= nombstr
[ req_DN ]
countryName = "1. Country Name (2 letter code)"
countryName_default = CA
countryName_min = 2
countryName_max = 2
stateOrProvinceName = "2. State or Province Name (full name)
"
stateOrProvinceName_default = Quebec
localityName = "3. Locality Name (eg, city)
"
localityName_default = Montreal
0.organizationName = "4. Organization Name (eg, company)
"
0.organizationName_default = Awake Coding Consulting Inc.
organizationalUnitName = "5. Organization Unit Name (eg, section)
commonName = "6. Common Name (CA name or FQDN)"
commonName_max = 64
commonName_default = awakecoding.com
emailAddress = "7. Email Address (eg, name@FQDN) "
emailAddress_max = 40
emailAddress_default = [email protected]
"
Execute the following commands in the directory where rdp.ext and rdp.cfg are
located:
openssl
openssl
openssl
openssl
2.3
Certificate Conversion
2.4
Certificate Installation
2.4.1
Terminal Server
2.4.1.1
Configure RDP server to use certificate: * Launch the Server Manager * In the
left pane, expand Roles, Remote Desktop Services, and then select RD Session
Host Configuration * In the middle pane, right-click the connection to configure,
such as RDP-Tcp and select Properties. The Connection Properties dialog will
appear. * In the General tab, click Select. A list of usable certificates will appear,
select the appropriate one and click OK. * Click OK to apply the changes and
close the Connection Properties dialog
2.4.1.2
Windows 7
The RDP server should now be configured to use the new certificate.
2.4.2
TS Gateway
2.5
Protocol Configuration
Certain protocol features such as encryption and compression can make packet
analysis harder.
2.5.1
TLS 1.0
Recent versions of Windows like Windows 8 will negotiate TLS 1.2 by default, a
version of TLS which is not supported by Network Monitor. For easier packet
decryption, it is recommended to force TLS 1.0 to be negotiated by disabling
TLS 1.1 and TLS 1.2 on clients that support it.
2.5.1.1
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TL
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TL
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
11
2.5.1.2
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TL
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TL
"Enabled"=dword:00000000
"DisabledByDefault"=dword:00000001
2.5.2
UDP Transport
2.5.3
Compression
To disable compression with mstsc, create a .rdp file and use the following option:
compression:i:0
With FreeRDP, simply do not turn on compression, or explicitly turn it off either
with a .rdp file or with the compression command-line option.
If you want to force a specific version of the compression, the MaxRdpCompressionLevel registry key can be used:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Terminal Server Client]
"MaxRdpCompressionLevel"=dword:00000000
MaxRdpCompressionLevel
Protocol Version
RDP4 (8K)
RDP5 (64K)
RDP6.1 (XCRUSH)
RDP8
12
2.5.4
RDP Security
When using RDP security, lowering the encryption level may be useful:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"MinEncryptionLevel"=dword:00000001
2.5.5
Value
Level
Low
Medium
High
To disable NLA with mstsc, create a .rdp file and use the following option:
enablecredsspsupport:i:0
To disable NLA with FreeRDP, you can use either the .rdp file or the sec-nla
command-line option.
2.6
Packet Capturing
There are two major packet capturing tools that can be used to capture RDP
traffic: Network Monitor and Wireshark. The former has the advantage of
being able to analyze a lot of the protocols of interest, but is not supported on
non-Windows environments. The latter is open source and is supported on a
wide variety of operating systems, but lacks good protocol analyzers for the vast
majority of RDP.
2.6.1
Message Analyzer
Message Analyzer is Microsofts replacement for the older Network Monitor tool.
At the time of writing these lines, Message Analyzer is still only a beta, but it
shows a lot of potential. Unlike Network Monitor, it will support live analysis. It
also replaces Network Monitors Network Parser Language (NPL) with the new
Open Parser Notation (OPN) which is superior is many aspects. For instance,
Message Analyzer will enable extremely precise filters based on protocol message
13
sequencing. The usage of a parser language such as OPN also makes writing
new parsers vastly easier than Wireshark, which uses an impractical C API for
parsing.
Message Analyzer is currently available on the Message Analyzer Connect Site1
For further information, refer to the Microsoft Message Analyzer Operating
Guide2
2.6.2
Network Monitor
2.6.2.1
Installation
Capturing
2.6.3
Wireshark
2.6.3.1
Installation
14
2.6.3.2
Compilation
This step is only required if the wireshark package that comes with your distribution is not built with proper SSL support (certain versions of openSUSE, for
instance). If this is the case, the SSL dissector will lack necessary configuration
options.
Building is straightforward. Download and extract the latest wireshark sources.
Install required build dependencies (libpcap-devel, libgnutls-devel). Configure
with an isolated installation prefix, and enable ssl support, and then build and
install:
./configure --prefix=/opt/wireshark --with-ssl=yes
make install
2.6.3.3
Configuration
Launch Wireshark
On the Edit menu, click Preferences
In the left pane, expand Protocols and select SSL
In the right pane, click Edit besides RSA keys list
In the SSL Decrypt dialog, click New
In the SSL Decrypt: New dialog, enter the following:
IP address of the RDP server
Port used by the RDP server
Protocol dissector to use with decrypted packets. When in doubt, use
the data dissector.
Full path to the SSL private key file (.key extension)
Password used to protect the private key file, if there is one.
Click OK to get back to the SSL Decrypt dialog, and click OK again
2.6.3.4
Capturing
Capture traffic:
Launch Wireshark
On the Capture menu, click Interfaces
In the Capture Interfaces dialog, click Options besides the interface to
capture from. If you do not know which interface to choose, it is normally
the one with the highest amount of traffic as indicated in the Packets
column.
15
In the Capture Options dialog, type port 3389 in the Capture Filter field.
The filter may be different depending on the port(s) used by the server.
Filtering the capture is optional, but helps filtering out packets which are
not of interest.
Click Start
Perform tasks generating network traffic of interest, and click Stop either
from the top menu bar or on the Capture menu
16
Chapter 3
Adding Users
3.1.1
3.1.1.1
Local Users
Domain Users
In the Password and Confirm password fields, enter a password like Password123!
Unselect User must change password at next logon, select Password never
expires and then click Next
Click Finish
18
Chapter 4
Active Directory
4.1
Server Configuration
4.1.1
19
On the Name the Forest Root Domain page enter a FQDN such as
lab1.awake.local and click Next. For testing purposes, avoid using a
name which could potentially conflict with other existing names. Using
the .local suffix is a good way to avoid conflicts.
On the Set Forest Functional Level page, select the desired forest functional
level from the list and then click Next. If you do not intend to have
backwards compatibility in a particular lab environment, you may select
the highest functional level, such as Windows Server 2008 R2.
On the Add Domain Controller Options page, leave the DNS server option
selected and click Next
A dialog box will appear warning that a delegation for the DNS server
cannot be created. Ignore this warning and click Yes.
On the Location for Database, Log Files, and SYSVOL page, click Next
On the Directory Services Restore Mode Administrator Password enter a
password such as Password123! and then click Next
On the Summary page, review the information and then click Next. Optionally, the summary information can be saved to a text file by clicking
Export settings.
Wait for installation to complete. You may select Reboot on completion, or
click Finish manually later. In both cases, the server needs to be rebooted
before continuing further.
Installing the Active Directory Certificate Services and DHCP Server roles:
21
4.1.2
4.2
4.2.1
Client Configuration
Windows 7 and Windows Server 2008
4.2.2
The Computer
Under Member Of, select Domain, enter the domain name to join
(lab2.awake.local) and click OK
A password prompt will appear. Authenticate using an account with
permission to join the domain, and click OK. A message box welcoming
you to the domain should appear, click OK. Another message box will
inform you that you must restart the computer, click OK again.
23
A dialog will then ask you to restart the computer now or later. In both
cases, you need to restart the computer before going further.
24
Chapter 5
Remote Desktop
Connection Broker
5.1
5.1.1
Server Configuration
Windows Server 2008
25
Chapter 6
Server Configuration
Windows Server 2008
26
Chapter 7
Server Configuration
7.1.1
7.2
7.2.1
Client Configuration
Windows 7
Ensure that both the client and the RD Gateway are on the same network, and
that the client can connect to the server using its hostname, not its IP address.
In this case, the server is called WIN20008R2SP1. The Administrator account is
used for both authentication against the gateway and the remote desktop session
host.
Configuring Remote Desktop Connection for RD Gateway connection:
Launch Remote Desktop Connection (mstsc.exe)
Enter WIN2008R2SP1 in the Computer field, and Administrator in the
User name field
28
Click Options at the bottom left of the Remote Desktop Connection window
to expand advanced options
In the Advanced tab, click Settings in the Connect from anywhere section.
The RD Gateway Server Settings dialog will appear
Under Connection Settings, select Use these RD Gateway server
settings. In the Server name field, enter WIN2008R2SP1 and select
Ask for password (NTLM) as the Logon method. Unselect the Bypass
RD Gateway server for local addresses option to ensure usage of the
RD Gateway in a test environment.
Under Logon settings, select Use my RD Gateway credentials for the
remote computer
Click OK to return to Remote Desktop Connection
Click Connect
In the Windows Security dialog, enter your credentials for the Administrator
account. This dialog should say that the credentials will be used for a list
of two computers, where one of them is listed as being an RD Gateway
server.
If you are using a self-signed certificate or an untrusted certificate, which is
most likely the case in a test environment, a Remote Desktop Connection
warning dialog will inform you that the identity of the RD Gateway cannot
be verified. Do not click OK, since it will abort the connection sequence.
The certificate needs to be saved and imported in the proper certificate
store before we can successfully connect. Open the Certificate dialog by
clicking View Certificate.
In the Details tab, click Copy to File to open the Certificate Export
Wizard
In the Welcome to the Certificate Export Wizard page, click Next
In the Export File Format page, select DER encoded binary
X.509 (CER) and click Next
In the File to Export page, specify a destination file name and
path, such as gateway.cer in the Documents folder and click Next
In the Completing the Certificate Export Wizard page, click
Finish to close the wizard
Close the Certificate dialog by clicking OK
Close the Remote Desktop Connection warning dialog by clicking OK. The
connection sequence will be aborted, but the RD Gateway certificate has
been saved first. The certificate can now be imported in the Trusted Root
Certification Authorities store for the client to accept identify the server
on the next connection.
Installing RD Gateway certificate for trust:
Double-click the RD Gateway certificate (gateway.cer in Documents from
the previous steps). The Certificate dialog will appear.
29
In the General tab, click Install Certificate. The Certificate Import wizard
will appear.
In the Welcome to the Certificate Import Wizard page, click Next
In the Certificate Store page, select Place all certificates in the following store. Click Browse to open the Select Certificate Store dialog
Select Trusted Root Certification Authorities and click OK
Click Next, and then Finish in the Completing the Certificate Import
Wizard page. A Security Warning dialog will appear asking to confirm
the installation of the certificate, click Yes and then OK.
Click OK to close the Certificate dialog
30