# Fix RDP Immediate Drop **Repository Path**: charlize/fix-rdp-immediate-drop ## Basic Information - **Project Name**: Fix RDP Immediate Drop - **Description**: Debug 和修复 RDP 登录后立即断开现象 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-14 - **Last Updated**: 2025-11-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # xrdp Emergency Fix Files This directory contains working configurations to fix xrdp connection issues. ## Files: ### `xorg.conf` - Essential xrdp X server configuration - Copy to: `/etc/xrdp/xorg.conf` - Required for xrdp to create virtual displays ### `startwm.sh` (Basic working version) - Simple window manager startup (most reliable) - Copy to: `/home/leo/startwm.sh` (if user window manager enabled) - Copy to: `/etc/xrdp/startwm.sh` (if system default) ### `startwm-xfce4.sh` (Xfce4 version) - Full Xfce4 desktop environment with proper DBUS setup - More complex but provides complete desktop experience - Use if you want Xfce4 instead of basic window manager ## Quick Recovery Commands: ### 1. Copy xorg.conf to system location: ```bash sudo cp xorg.conf /etc/xrdp/xorg.conf sudo chown root:root /etc/xrdp/xorg.conf sudo chmod 644 /etc/xrdp/xorg.conf ``` ### 2. Set up working window manager: ```bash # Basic version (most reliable) cp startwm.sh ~/startwm.sh chmod +x ~/startwm.sh # OR for Xfce4 desktop: cp startwm-xfce4.sh ~/startwm.sh chmod +x ~/startwm.sh ``` ### 3. Ensure user in xrdp group: ```bash sudo usermod -aG xrdp leo ``` ### 4. Restart services: ```bash sudo systemctl restart xrdp sudo systemctl restart xrdp-sesman ``` ### 5. Check firewall: ```bash sudo ufw allow 3389 ``` ### 6. Check services: ```bash sudo systemctl status xrdp xrdp-sesman netstat -tlnp | grep :3389 ``` ## Common Issues: - **Error 0x904**: Window manager exits immediately → Use basic startwm.sh first - **No display**: Missing xorg.conf → Copy xorg.conf to /etc/xrdp/ - **Permission denied**: User not in xrdp group → Add user to xrdp group - **Connection refused**: Firewall or service down → Check firewall and restart services ## Troubleshooting Logs: ```bash # Check recent errors (requires sudo): sudo tail -50 /var/log/xrdp.log sudo tail -50 /var/log/xrdp-sesman.log # Check your session logs: ls -la ~/.xorgxrdp*.log tail -20 ~/.xorgxrdp.10.log ```