A professional GTK4-based application for managing Remote Desktop Protocol (RDP) sessions on Linux systems.
RDP Session Manager is a comprehensive desktop application designed for GNOME environments, providing centralized management of RDP user accounts and sessions. Built with GTK4 and libadwaita, it offers a native Linux experience for administering remote desktop access through the xrdp server.
- Create RDP user accounts with automated configuration
- Delete users with complete data removal
- Enable/disable user accounts via graphical toggle
- Automatic termination of active sessions during deletion
- Real-time input validation
- Active process detection per user
- Status monitoring (Connected/Enabled/Disabled)
Desktop Sessions - Full desktop environments with automatic installation:
- LXDE (250MB) - Lightweight
- LXQt (350MB) - Modern and lightweight
- XFCE (400MB) - Recommended for balance
- MATE (600MB) - Traditional desktop
- Cinnamon (800MB) - Feature-rich
- GNOME (1.2GB) - Complete desktop
- KDE Plasma (1.5GB) - Advanced features
RemoteApp - Launch single Linux applications:
- Execute individual applications (Firefox, LibreOffice, etc.)
- Maximized window mode with minimal window decorations
- Lightweight alternative to full desktop sessions
WineGE RemoteApp - Run Windows applications via WineGE:
- Execute Windows (.exe) applications through Wine-GE
- Automatic WineGE installation and configuration
- Support for installers and portable executables
- Wine Prefix isolation per user
- Better compatibility than standard Wine
Features include:
- Automated desktop environment installation
- Disk space verification before installation
- Detection of pre-installed environments
- Wine Prefix management for Windows apps
- Automatic FreeRDP client detection
- On-demand FreeRDP installation with progress tracking
- Graphical credential input dialog
- Support for Windows domain authentication
- Direct RDP client launching
- Automatic clipboard integration
- Connection string auto-copy
- Automatic xrdp server verification on startup
- Warning banner for missing dependencies
- One-click dependency installation
- Real-time installation progress
- On-demand dependency resolution
- Real-time session monitoring
- Server IP and port visualization
- Comprehensive structured logging
- Centralized log management
- Automatic log rotation
- PolicyKit integration for administrative operations
- User isolation via dedicated group (rdp-users)
- UID allocation starting at 5000
- Isolated home directories (/opt/rdp-users)
- Strong password validation
- Absolute path usage for all system commands
- Reduced privilege escalation prompts through helper scripts
- Ubuntu 20.04 LTS or later
- Debian 11 (Bullseye) or later
- Windows Subsystem for Linux (WSL) with Ubuntu/Debian
- Python 3.8 or higher
- GTK 4.0
- libadwaita 1.0
- PolicyKit (policykit-1)
- xrdp server (installable via application)
- FreeRDP client (installable via application)
# Clone the repository
git clone https://github.com/yourusername/rdp-session-manager.git
cd rdp-session-manager
# Run the installation script
./install.shThe installation script will:
- Detect your system (Ubuntu/Debian/WSL)
- Install system dependencies (GTK4, libadwaita, etc.)
- Install Python dependencies (PyGObject, psutil)
- Configure necessary permissions
- Optionally install xrdp and FreeRDP
- Create Python virtual environment (optional)
For detailed manual installation instructions, refer to INSTALL.md.
sudo apt-get install -y \
python3 python3-pip python3-venv python3-dev \
libgtk-4-1 libgtk-4-dev \
libadwaita-1-0 libadwaita-1-dev \
gir1.2-gtk-4.0 gir1.2-adw-1 \
python3-gi python3-gi-cairo \
policykit-1pip install -r requirements.txtRDP Session Manager can be used via graphical interface (GUI) or command line (CLI).
# With virtual environment
source venv/bin/activate
python3 src/main.py
# Without virtual environment
python3 src/main.py# Show all available commands
rdpsm --help
# Example: Create a desktop session user
rdpsm user create john -f "John Doe" -d xfce
# Example: Create a RemoteApp user (Linux application)
rdpsm user create firefox_user \
--session-type remoteapp \
--app-command firefox \
--fullname "Firefox User"
# Example: Create a WineGE RemoteApp user (Windows application)
rdpsm user create notepad_user \
--session-type winege-remoteapp \
--app-command /path/to/notepad++.exe \
--fullname "Notepad++ User"
# Example: List all users
rdpsm user list
# Example: View server information
rdpsm server infoFor complete CLI documentation, see CLI.md.
For WineGE RemoteApp detailed guide, see docs/WINEGE_REMOTEAPP.md.
- Click the "+" button in the header bar
- Enter user details:
- Username (lowercase letters, numbers, hyphens, underscores)
- Full name
- Password (minimum 8 characters)
- Confirm password
- Select desktop environment
- Optionally enable desktop environment installation
- Authenticate when prompted
- Wait for user creation to complete
- Click the network icon on the user card
- Select "Open FreeRDP"
- Enter credentials:
- Domain (optional, for Windows domains)
- Password
- Click "Connect"
Alternative connection methods:
# Linux (FreeRDP)
xfreerdp /v:SERVER_IP:3389 /u:USERNAME /cert:ignore
# Windows (Remote Desktop Connection)
# Enter in client: SERVER_IP:3389- Click the trash icon on the user card
- Confirm deletion
- Authenticate when prompted
Note: All user data including home directory, configuration files, and active processes will be removed.
- Toggle the switch next to the user status
- Authenticate when prompted
- Status will update to reflect the change
Disabled users cannot authenticate via RDP until re-enabled.
RDP Session Manager includes a comprehensive CLI that provides access to all GUI functionality via terminal.
The CLI is automatically available after installing the .deb package. The rdpsm command will be available system-wide.
User Management:
rdpsm user create USERNAME # Create user
rdpsm user delete USERNAME # Delete user
rdpsm user list # List all users
rdpsm user info USERNAME # User details
rdpsm user enable USERNAME # Enable user
rdpsm user disable USERNAME # Disable user
rdpsm user password USERNAME # Change passwordSession Management:
rdpsm session list # Active sessions
rdpsm session info USERNAME # Session details
rdpsm session kill USERNAME # Kill sessionDesktop Environments:
rdpsm de list # Available DEs
rdpsm de install DE_ID # Install DE
rdpsm de check DE_ID # Check if installedServer & Configuration:
rdpsm server info # Server information
rdpsm server status # Check xrdp status
rdpsm config get port # Get RDP port
rdpsm config set port 3390 # Set RDP portDependencies:
rdpsm deps check # Check dependencies
rdpsm deps install xrdp # Install xrdp
rdpsm deps install freerdp # Install freerdpMost commands support JSON output for scripting:
# Table format (default)
rdpsm user list
# JSON format
rdpsm user list --format json
# Use with jq for parsing
rdpsm user list --format json | jq -r '.[].username'Batch user creation:
for user in alice bob charlie; do
rdpsm user create "$user" -p "TempPass123" -d xfce
doneMonitor sessions:
watch -n 5 'rdpsm session list'System health check:
rdpsm server status && rdpsm deps checkTest all CLI commands after installing the application:
# Run automated test suite (tests all safe read-only commands)
bash tests/test_cli.sh
# Manual testing
rdpsm --version
rdpsm user list
rdpsm server infoFor complete CLI documentation, testing guide, and GUI-to-CLI equivalents, see:
- CLI.md - Complete CLI reference and usage guide
- CLI_TESTING.md - Comprehensive testing guide with all commands and expected outputs
RemoteApps-RDP/
├── src/
│ ├── core/ # Core functionality modules
│ │ ├── user_manager.py # User account management
│ │ ├── rdp_config.py # RDP configuration
│ │ ├── de_installer.py # Desktop environment installer
│ │ ├── system_deps.py # System dependency management
│ │ ├── session_monitor.py # Session monitoring
│ │ └── config.py # Application configuration
│ ├── ui/ # GTK4 interface
│ │ ├── main_window.py # Main application window
│ │ ├── user_dialog.py # User creation dialog
│ │ └── preferences_dialog.py # Settings dialog
│ ├── utils/ # Utility modules
│ │ ├── logger.py # Logging system
│ │ ├── validator.py # Input validation
│ │ └── polkit.py # PolicyKit integration
│ ├── cli.py # Command-line interface
│ ├── application.py # Main application class
│ └── main.py # GUI entry point
├── data/
│ ├── ui/ # GTK Builder UI files
│ └── icons/ # Application icons
├── helpers/ # Privileged helper scripts
│ ├── install-packages.sh # Package installation
│ ├── create-rdp-user.sh # User creation
│ ├── delete-rdp-user.sh # User deletion
│ ├── toggle-user-lock.sh # User enable/disable
│ └── set-user-password.sh # Password management
├── docs/ # Documentation
├── tests/ # Unit tests
│ └── test_cli.sh # CLI test suite
├── CLI.md # CLI documentation
├── CLI_TESTING.md # CLI testing guide
└── requirements.txt # Python dependencies
The application uses PolicyKit (pkexec) for secure privilege escalation:
- User creation:
pkexec useradd - User deletion:
pkexec userdel - User lock/unlock:
pkexec usermod - Package installation:
pkexec apt-get - Process termination:
pkexec pkill
Helper scripts in the helpers/ directory group multiple privileged operations to minimize authentication prompts while maintaining security.
- RDP users are created in a dedicated group (rdp-users)
- UIDs start at 5000, outside the normal user range
- Home directories are isolated in /opt/rdp-users/
- Each user operates on a dedicated RDP port
- Username pattern:
^[a-z][a-z0-9_-]{2,31}$ - Password requirements: minimum 8 characters, alphanumeric
- Port validation: range 1-65535, availability check
- All system commands use absolute paths
# Application logs
~/.local/share/rdp-session-manager/logs/rdp-session-manager.log
# xrdp logs
/var/log/xrdp/
# Monitor logs in real-time
tail -f ~/.local/share/rdp-session-manager/logs/rdp-session-manager.log- User creation and deletion operations
- Package and desktop environment installations
- RDP connections and disconnections
- Error messages and warnings
- Process terminations
- System dependency checks
Symptom: Warning banner displayed in application window
Solution:
- Click "Install Now" in the banner, or
- Manual installation:
sudo apt install xrdp xorgxrdp
Symptom: Installation prompt when attempting to connect
Solution:
- Click "Install FreeRDP" in the dialog, or
- Manual installation:
sudo apt install freerdp2-x11
Symptom: Black screen after RDP connection
Solution:
- Check xrdp logs:
tail /var/log/xrdp/xrdp.log - Test desktop environment:
su - username -c "startxfce4" - Reinstall desktop environment via application
Symptom: Error during user creation
Solution: The application automatically detects and assigns available ports. Check firewall rules if issues persist.
# Using pytest
pytest tests/ -v
# With coverage
pytest tests/ --cov=src --cov-report=htmlThe project follows PEP 8 guidelines. Use the following tools:
# Format code
black src/
# Check style
flake8 src/
# Type checking
mypy src/Contributions are welcome. Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/description) - Commit your changes (
git commit -m 'Add feature description') - Push to the branch (
git push origin feature/description) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
- Documentation: docs/
- Bug Reports: GitHub Issues
- Discussions: GitHub Discussions
Current Version: 0.3.0 Status: Production Ready Last Updated: 2025-10-30
Copyright (C) 2025 - RDP Session Manager Contributors