ubuntu

ubuntu tigervnc与xrdp如何配合

小樊
46
2025-10-31 23:40:02
栏目: 智能运维

Integrating TigerVNC with xrdp on Ubuntu for Remote Desktop Access
TigerVNC and xrdp are often used together to enable remote desktop access to Ubuntu systems. TigerVNC serves as the VNC server, handling graphical display and input, while xrdp acts as an RDP (Remote Desktop Protocol) gateway, allowing Windows and other RDP clients to connect to the Ubuntu desktop. Below is a step-by-step guide to configuring them for seamless integration.

1. Install Required Packages

First, install TigerVNC Server and xrdp on your Ubuntu system. Open a terminal and run:

sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common xrdp -y

This installs TigerVNC (for VNC functionality) and xrdp (for RDP compatibility).

2. Configure TigerVNC for Desktop Environment

TigerVNC requires a startup script (~/.vnc/xstartup) to launch the desktop environment. Without proper configuration, remote connections may fail or display a blank screen.

3. Configure xrdp to Use TigerVNC

xrdp needs to know which VNC server to use for remote sessions. By default, xrdp uses its own session manager, but we’ll point it to TigerVNC.

4. Set a VNC Password

TigerVNC requires a password for remote access. Run:

vncpasswd

Enter and confirm a password (note: this is separate from your Ubuntu login password). The password must be between 6–8 characters long.

5. Configure Firewall for Remote Access

If you’re using UFW (Ubuntu’s default firewall), allow traffic on the RDP port (3389) and TigerVNC ports (5901+). Run:

sudo ufw allow 3389/tcp  # RDP port for xrdp
sudo ufw allow 5901/tcp  # TigerVNC port (display :1)
sudo ufw enable          # Enable firewall if not already active

6. Restart Services for Changes to Take Effect

Restart both xrdp and TigerVNC to apply configurations:

sudo systemctl restart xrdp
vncserver -kill :1  # Stop any running TigerVNC instances
vncserver :1        # Restart TigerVNC

7. Connect to Ubuntu via RDP

On a Windows machine, open the Remote Desktop Connection client (built into Windows). Enter the Ubuntu system’s IP address (e.g., 192.168.1.100) and click Connect. When prompted, enter your Ubuntu username and the VNC password you set earlier. You should now see the Ubuntu desktop.

Troubleshooting Common Issues

By following these steps, you can integrate TigerVNC with xrdp on Ubuntu to enable secure, cross-platform remote desktop access. This setup leverages TigerVNC’s performance and xrdp’s compatibility with RDP clients, providing a flexible solution for remote administration or user access.

0
看了该问题的人还看了