Connect to an Existing Linux Desktop via RDP (xrdp + x11vnc)
Most remote desktop setups on Linux using xrdp
or xfreerdp
create new X sessions, which isn't ideal when you want to reconnect to your console session (display :0
) — especially in OSINT, red teaming, or remote admin environments.
Here’s how to configure Manjaro Linux (or any Linux distro) to RDP directly into the active user session using xrdp
with x11vnc
— no more new sessions.
🧠 Why This Setup Matters
Whether you're doing OSINT on remote systems, managing a headless Linux box, or resuming a physical session remotely, reconnecting to an active X11 desktop session is essential. This approach avoids issues with session duplication, lockouts, and broken workflows.
🔧 Prerequisites
- Manjaro or another Linux distro with X11
- Installed:
xrdp
,x11vnc
,xfreerdp
- Access to the Linux machine via SSH or terminal
🛠️ Step-by-Step Setup
1. Install Required Packages
sudo pacman -S xrdp x11vnc
Or on Ubuntu:
sudo apt install xrdp x11vnc
2. Set a VNC Password (One-Time)
x11vnc -storepasswd
3. Start x11vnc for the Current X Session
x11vnc -display :0 -auth guess -rfbauth ~/.vnc/passwd -forever -shared &
This shares the current physical session over VNC on port 5900.
4. Configure xrdp to Use x11vnc
Edit /etc/xrdp/xrdp.ini
:
[xrdp1]
name=Console Session (x11vnc)
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=5900
💡 Tip: Make this the first session block to avoid the session selection screen.
Optionally delete other [xrdpN]
blocks to force this as the only option.
5. Restart xrdp
sudo systemctl restart xrdp
6. Connect from Your Client with xfreerdp
xfreerdp /u:your_username /p:your_password /v:your_linux_ip
You'll now connect directly to the active desktop session (no new login).
🛡️ Secure It: Auto-Start x11vnc with systemd (Optional)
Create a systemd service to launch x11vnc
at boot:
sudo nano /etc/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc at startup
After=display-manager.service
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -auth guess -rfbauth /home/YOURUSER/.vnc/passwd -forever -shared
User=YOURUSER
[Install]
WantedBy=multi-user.target
Enable it:
sudo systemctl enable x11vnc.service
✅ Recap
Component | Role |
---|---|
x11vnc |
Shares the active X session (:0 ) via VNC |
xrdp + libvnc.so |
Bridges RDP client to x11vnc |
xfreerdp |
RDP client connecting to your system |
📦 OSINT Use Case
Red teamers and OSINT analysts often need GUI access to a VM or remote desktop while maintaining OPSEC. This setup ensures persistent access to a graphical session that’s already configured — ideal for:
- Recon dashboards (e.g., Spiderfoot, Maltego)
- Browser-based collection
- PDF and metadata review tools
🔍 Keywords & SEO Highlights
Keywords: xrdp x11vnc console session, RDP to Linux active session, xfreerdp reconnect existing session, Linux remote desktop, OSINT GUI access, Manjaro RDP, persistent RDP to display :0, VNC via RDP Linux
🧩 Final Thoughts
This method offers a clean and reliable RDP workflow that doesn’t spawn extra sessions or lose your context. Perfect for daily administration, remote support, or long-term OSINT engagements.
🧠 Want to dockerize this setup or bundle it into a portable red team toolkit? Drop a comment or contact us — we’re building modular Linux access labs too.