xrdp Documentation

repository·devel·Indexed 27 days ago

https://github.com/neutrinolabs/xrdp

An open-source RDP server allowing remote access to Linux desktops via the Microsoft Remote Desktop Protocol. It supports session resizing, clipboard sharing, drive redirection, and RDP/VNC proxying. The documentation covers installation on Ubuntu, Debian, Fedora, and RHEL, source compilation, firewall configuration, and details on the fv1 font format, keymap generation, and the tomlc99 C99-compliant TOML parser.

Tokens
2.7K
Snippets
10
Records
20
Agent score
92%

What's inside xrdp

  1. Overview of xrdp features

    devel

    xrdp is an open-source RDP server that provides graphical login to remote machines.

    Key Capabilities:

    • Remote Desktop Access: Connect to Linux desktops (requires xorgxrdp), reconnect to existing sessions, and perform session resizing.
    • RDP/VNC Proxy: Connect to other RDP or VNC servers via xrdp.
    • Resource Redirection: Supports two-way clipboard transfer (text, bitmap, file) and drive redirection (mounting local client drives on the remote machine).
    • Audio/Microphone Redirection: Supported, but requires building additional modules (see wiki for instructions).
  2. Build vrplayer

    devel

    To build the vrplayer media player, you must first install the required development packages and then follow a specific build sequence involving make and qmake within the repository structure.

    Required packages:

    • libqt4-gui
    • qt4-dev-tools
    • libavutil-dev
    • libavformat-dev
    cd ../xrdpvr
    make
    cd ..
    qmake
    make
  3. Create a new xrdp keymap file

    devel

    To create a new keymap file for the xrdp login screen or VNC server, you must extract the mappings from a running X server. It is recommended to use an Xvfb dummy X server to avoid interference from your current session's window manager.

    Follow these steps:

    1. Start an X server (e.g., Xvfb).
    2. Use the setxkbmap command to configure the keyboard layout for that X server.
    3. Run the xrdp-genkeymap utility to extract the mappings.
    4. Copy the resulting .toml file to /etc/xrdp/.
    ./xrdp-genkeymap ./km-00000409.toml
  4. Include new third-party libraries in the license documentation

    devel

    When adding new third-party libraries to the project, you must update the license documentation to ensure all terms are displayed. Follow these steps:

    1. Install adobe/bin2c to your development environment.
    2. Write all third-party license terms into the COPYING-THIRD-PARTY file.
    3. Run the specific copying Makefile to generate the header file: make -f Makefile.copying.
    4. Commit the generated copying_third_party.h file to the repository.
  5. Install xrdp on Ubuntu or Debian

    devel

    To install the xrdp server on Ubuntu or Debian-based systems, use the apt package manager. For the best experience, ensure xorgxrdp is also installed, as it allows connecting to a Linux desktop via Xorg.

    apt install xrdp
  6. Compile xrdp from source

    devel

    To build xrdp from a checked-out git repository, ensure you have cloned the submodules recursively. You will need a compiler (gcc or clang), make, and several development libraries (openssl-devel, pam-devel, libX11-devel, libXfixes-devel, libXrandr-devel). If building from a git repo, also install autoconf, automake, libtool, and pkg-config.

    Follow these steps to compile and install:

    # If using git, ensure submodules are present:
    git clone --recursive https://github.com/neutrinolabs/xrdp
    
    # Build and install:
    ./bootstrap
    ./configure
    make
    sudo make install
  7. Generate all xrdp keymap files using dump-keymaps.sh

    devel

    The dump-keymaps.sh script can be used to auto-generate all keymap files. While it currently runs on Linux, the generated files are compatible with any xrdp platform.

    To add a new mapping to the project repository:

    1. Edit dump-keymaps.sh and add a line towards the end of the file to include your mapping (follow the existing pattern in the file).
    2. Run ./dump-keymaps.sh to generate the new file in the instfiles/ directory.
    3. Add your new mapping to the list in instfiles/Makefile.am.
    4. Submit a pull request with these changes.
  8. Parse and access TOML files with tomlc99

    devel

    tomlc99 is a C99-compliant TOML parser (v1.0.0). To use it, follow these steps:

    1. Parse the file: Use toml_parse_file(FILE* fp, char* errbuf, size_t errbuf_size) to create a toml_table_t*.
    2. Traverse tables: Use toml_table_in(toml_table_t* tab, const char* key) to locate specific tables.
    3. Extract values: Use type-specific functions to retrieve data.
    4. Free memory: Use toml_free(toml_table_t* conf) to release the parsed table.

    Important Memory Management: If you access a string or a timestamp via a toml_datum_t, you must manually call free(datum.u.s) or free(datum.u.ts) respectively after use.

    #include "toml.h"
    
    // ... setup file pointer ...
    
    // 1. Parse
    toml_table_t* conf = toml_parse_file(fp, errbuf, sizeof(errbuf));
    
    // 2. Traverse
    toml_table_t* server = toml_table_in(conf, "server");
    
    // 3. Extract
    toml_datum_t host = toml_string_in(server, "host");
    if (host.ok) {
        printf("host: %s\n", host.u.s);
        free(host.u.s); // Required for strings
    }
    
    // 4. Free
    toml_free(conf);