Ubuntu Remote Desktop Complete Guide: RDP, VNC, xrdp, and Secure SSH Tunneling

目次

1. Introduction: Why Use Remote Desktop on Ubuntu

Remote operation of Ubuntu is becoming increasingly common

Linux-based operating systems such as Ubuntu have traditionally been associated with developers and server administrators, and were mainly used in local environments. However, in recent years, with the expansion of remote work and the increasing adoption of Ubuntu as a learning PC, the demand for remotely operating Ubuntu has grown significantly.

For example, many users remotely manage their home Ubuntu servers while away, or install Ubuntu on an older laptop and use it as a remote development machine. The range of use cases for remote desktop technology continues to expand.

How is it different from Windows? Advantages unique to Ubuntu

You may wonder, “Windows already has Remote Desktop—why use Ubuntu?” In fact, Ubuntu has several features that make it particularly suitable for remote operation.

  • Lightweight and stable, allowing smooth operation even on low-spec hardware
  • High security and strong compatibility with encrypted communication such as SSH
  • Free and open source, making it cost-effective for multi-device usage

For these reasons, Ubuntu is increasingly chosen for programming education and server use, and is actively utilized through remote connections.

Beginner-friendly despite its reputation for complexity

For users unfamiliar with Linux-based operating systems, remote connection setup may seem intimidating, often associated with command-line operations. In the past, setting up remote access on Ubuntu required manual VNC server configuration or SSH port forwarding, demanding a certain level of technical knowledge.

However, starting with Ubuntu 22.04 LTS, remote connections via RDP (Remote Desktop Protocol) are supported out of the box and can be configured entirely through the GUI. This improvement has made remote desktop usage far more accessible to beginners.

Purpose and structure of this article

This article provides a step-by-step, beginner-friendly explanation of how to enable remote desktop connections on Ubuntu. It covers the latest Ubuntu 22.04 features, xrdp configuration for older versions, and advanced security techniques using VNC and SSH tunneling.

By comparing the characteristics of each method, this guide helps you choose the approach that best fits your environment. We encourage you to read through to the end.

2. Comparison of Remote Desktop Methods on Ubuntu: VNC vs RDP

Multiple protocols are available for remote connections

There is more than one way to implement remote desktop access on Ubuntu. The three most common approaches are:

  • RDP (Remote Desktop Protocol)
  • VNC (Virtual Network Computing)
  • SSH (Secure Shell) with X forwarding or tunneling

Among these, RDP and VNC are primarily used to transfer the desktop screen itself, making them suitable for general remote operations. SSH is mainly used for command-line access or as a supplementary security mechanism.

This section focuses on RDP and VNC, which are particularly beginner-friendly, and compares their characteristics.

What is RDP (Remote Desktop Protocol)?

RDP is a protocol originally developed by Microsoft and widely used as a standard feature in Windows. On Ubuntu, remote access via RDP is possible using software such as xrdp.

From Ubuntu 22.04 onward, RDP functionality is built directly into the GNOME desktop environment, eliminating the need to install xrdp separately and allowing configuration entirely through the GUI.

Key features of RDP:

  • High compatibility with Windows and accessible using the standard Windows Remote Desktop client
  • Fast and smooth screen rendering
  • Built-in authentication and encryption for relatively strong security

Recommended for:

  • Users working with both Ubuntu and Windows
  • Beginners who want easy GUI-based configuration
  • Users who prioritize security and stability

What is VNC (Virtual Network Computing)?

VNC is a cross-platform remote desktop technology. On Ubuntu, it can be implemented using software such as vino or tightvncserver.

Unlike RDP, VNC transfers desktop images sequentially, which can result in slightly slower rendering. However, it offers greater flexibility, including session sharing, allowing multiple users to view and control the same desktop.

Key features of VNC:

  • Cross-platform compatibility (Linux, macOS, Android, and more)
  • Allows multiple users to share the same desktop session
  • Weaker native security, typically used together with SSH tunneling

Recommended for:

  • Remote collaboration involving multiple users
  • Access from non-Windows devices
  • Intermediate to advanced users who want more customization

Comparison Table: RDP vs VNC

ItemRDPVNC
Ease of setupExcellent (GUI-based, easy from Windows)Moderate (initial setup required)
Display performanceExcellent (smooth)Moderate (may feel sluggish)
SecurityExcellent (encryption enabled by default)Moderate (SSH tunneling recommended)
Session sharingNoYes (multiple users can share)
Platform supportMainly WindowsCross-platform (Linux, macOS, Android, etc.)

Which should you choose?

RDP is recommended for beginners and Windows users. It is easy to configure and provides stable performance, making it ideal for first-time Ubuntu remote desktop users.

On the other hand, VNC offers greater flexibility for users who need advanced customization or access from non-Windows devices. In such cases, it is essential to combine VNC with SSH tunneling for security.

3. [Latest] How to Enable RDP (Remote Desktop) on Ubuntu 22.04

Built-in RDP support in Ubuntu 22.04

Starting with Ubuntu 22.04 LTS, the default GNOME desktop environment includes built-in remote desktop support. This means you can use RDP without installing external tools such as xrdp.

This feature allows you to connect directly from the standard Windows Remote Desktop client (mstsc.exe), making it extremely user-friendly for beginners.

Prerequisites and checks

Before enabling RDP, please confirm the following:

  • Your Ubuntu version is 22.04 or later
  • You are using the GNOME desktop environment
  • You are logged in using an X.org session, not Wayland (important)

The last point—logging in with X.org instead of Wayland—is especially important. Currently, RDP connections are not supported under Wayland. Follow the steps below to switch sessions.

How to log in using an X.org session

  1. On the Ubuntu login screen, select your username
  2. Before entering your password, click the gear icon (⚙) in the lower-right corner
  3. Select “Ubuntu on Xorg”
  4. Enter your password and log in

Steps to enable Remote Desktop

  1. Open the Settings application
  2. Select Sharing from the left menu
  3. Click Remote Desktop
  4. Turn on Enable Remote Desktop
  5. Set the authentication method to Password and enter a connection password
  6. Under Network, check Allow connections from users on the local network

This completes the configuration on the Ubuntu side.

How to connect from Windows to Ubuntu

  1. Press Windows key + R, type mstsc, and press Enter
  2. Enter the Ubuntu IP address in the Computer field
  3. When prompted, enter the Ubuntu username and password
  4. Connection established

You can find the Ubuntu IP address under Settings → Wi-Fi or Wired. Alternatively, use the following command in the terminal:

ip a

Firewall configuration (if required)

If Ubuntu’s UFW (Uncomplicated Firewall) is enabled, you must allow the RDP port (TCP 3389 by default).

sudo ufw allow 3389/tcp

Then verify the firewall status:

sudo ufw status

Common issues and solutions

IssueSolution
Black screen after connectingConfirm that you are logged in using X.org
Connection refusedCheck firewall settings and ensure both devices are on the same network
No response after entering passwordVerify that Remote Desktop is enabled in GNOME Sharing settings

Note: Intended for LAN usage

This method is primarily designed for use within the same local network (LAN). To connect from outside the network, you will need additional measures such as VPN, port forwarding, or SSH tunneling, which are covered in later sections.

4. How to Connect Remotely Using xrdp on Ubuntu 20.04 and Earlier

xrdp is required on Ubuntu 20.04 and earlier

Ubuntu 20.04 and earlier versions do not include built-in RDP functionality like Ubuntu 22.04. To enable remote access from Windows, you must install xrdp, which adds RDP server capabilities to Ubuntu.

xrdp is compatible with Microsoft’s RDP protocol, allowing easy access from the standard Windows Remote Desktop client.

Installing and configuring xrdp

Run the following commands in the terminal to install xrdp:

sudo apt update
sudo apt install xrdp -y

After installation, the xrdp service starts automatically. Check its status with:

sudo systemctl status xrdp

If you see “active (running)” in green, the service is operating correctly.

Selecting a desktop environment (Xfce recommended)

The default GNOME desktop environment does not work well with xrdp and may result in black screens or failed sessions.

For better compatibility, it is recommended to install and use the lightweight Xfce desktop environment.

Installing Xfce

sudo apt install xfce4 -y

Configuring the session

Create or edit the following file to instruct xrdp to use Xfce:

echo "startxfce4" > ~/.xsession

Set appropriate permissions:

chmod +x ~/.xsession

In most local use cases, this configuration is sufficient.

Firewall settings

xrdp uses TCP port 3389. If UFW is enabled, allow this port:

sudo ufw allow 3389/tcp

Connecting from Windows

  1. Press Windows key + R and run mstsc
  2. Enter the Ubuntu IP address
  3. When the xrdp login screen appears, enter your Ubuntu username and password
  4. The Xfce desktop session will start

You can confirm the IP address using ip a or hostname -I.

Common problems and fixes

SymptomCause and solution
Black screen after loginUse Xfce instead of GNOME; ensure startxfce4 is set in .xsession
“Session ended” messageDesktop environment mismatch; confirm Xfce installation
Connection drops after password entryPossible polkit or security issue; check system logs

Enable xrdp at system startup (optional)

sudo systemctl enable xrdp

5. Connecting with a VNC Server (vino / tightvnc)

What is VNC?

VNC (Virtual Network Computing) is a cross-platform protocol for sharing desktop screens. Ubuntu supports VNC through various server implementations, enabling access from PCs, smartphones, and other devices.

Although VNC may be slower and more complex than RDP, it offers flexible session sharing and broad platform support.

Popular VNC servers on Ubuntu

ServerFeatures
vinoIntegrated with GNOME; easy GUI-based setup
tightvncserverLightweight, command-line focused
x11vncAccess the active logged-in session; ideal for screen sharing

Using vino in GNOME (Ubuntu 20.04–22.04)

Install vino if needed

sudo apt install vino -y

Enable screen sharing

  1. Open Settings
  2. Select Sharing → Screen Sharing
  3. Turn on Screen Sharing
  4. Enable network access
  5. Set a password for authentication

X.org login is required for vino to function properly.

Test the connection

Use a VNC client such as RealVNC Viewer or TigerVNC to connect to:

192.168.1.100:5900

Using tightvncserver for lightweight setups

Install

sudo apt install tightvncserver -y

Initial startup

vncserver

Start a VNC session

vncserver :1

This starts a session on port 5901.

Configure a lightweight desktop (optional)

#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
chmod +x ~/.vnc/xstartup

Security note: use SSH tunneling

VNC traffic is not encrypted. For use outside a local network, it should always be combined with SSH tunneling.

ssh -L 5901:localhost:5901 your-user@remote-ubuntu

6. How to Connect from Windows to Ubuntu

Client software is required on the Windows side

Even if Ubuntu is properly configured, the client machine—usually Windows—must have compatible software.

Using Windows built-in Remote Desktop (RDP)

Steps

  1. Press Windows key + R and enter mstsc
  2. Enter the Ubuntu IP address
  3. Enter your credentials

Advantages

  • No additional software required
  • Fast and stable performance
  • Familiar interface for Windows users

Limitations

  • Requires RDP support on Ubuntu
  • Designed for LAN usage unless combined with VPN or SSH tunneling

7. Troubleshooting Japanese Input and Keyboard Issues

Common issues with Japanese input during remote sessions

When operating Ubuntu remotely, you may encounter issues such as being unable to input Japanese text, the Half-width/Full-width key not working, or the backslash (\) key not functioning correctly. These problems are caused by differences in session environments between local and remote access.

This section explains common Japanese input and keyboard issues encountered during remote connections and how to resolve them.

Japanese input does not work / IME is inactive

Common causes

  • The input method (IME) is not running in the remote session
  • Frameworks such as fcitx or ibus are not properly linked to the session
  • Compatibility issues between GNOME sessions and RDP

Solution 1: Explicitly restart Mozc + fcitx

The most common Japanese input environment on Ubuntu is fcitx-mozc. If it does not start automatically during a remote session, manually restarting it often resolves the issue.

fcitx-autostart

or

fcitx -r

Solution 2: Reconfigure input sources per session

  1. Open Settings → Region & Language → Input Sources
  2. Confirm that “Japanese (Mozc)” is enabled
  3. If missing, click “+” to add Japanese input

Logging out and logging back in may be required for changes to take effect.

Half-width/Full-width key not working or incorrect key mapping

Remote desktop sessions may misinterpret keyboard layouts, especially when switching between Japanese (JIS) and US keyboards. This often causes issues with keys such as backslash (\) and at-sign (@).

Solution: Explicitly define the keyboard layout

  1. Settings → Region & Language → Input Sources
  2. Select “Japanese” or “Japanese (OADG 109A)”
  3. Apply the layout using the following command if needed:
setxkbmap -model jp106 -layout jp

Adding this command to .xsession or .bashrc ensures it is applied automatically during remote login.

Backslash (\) or pipe (|) cannot be entered

This issue is common with RDP connections and is caused by xrdp keymap mismatches.

Workaround: Adjust xrdp key mappings

  1. Edit the following file:
sudo nano /etc/xrdp/km-0411.ini
  1. This file defines Japanese keyboard mappings. Advanced users may manually adjust differences between JIS and US layouts.

A more practical solution is to switch to a different protocol such as VNC, which avoids this issue entirely.

Alternative input shortcuts when switching fails

Mozc (fcitx) defaults:

  • Ctrl + Space
  • Shift + Space (configurable)

These shortcuts can be customized via the fcitx configuration tool.

Last resort: Copy and paste from the local machine

If Japanese input is completely unavailable, copying text from the local Windows machine and pasting it into Ubuntu can serve as a temporary workaround.

Summary: Japanese input behavior depends on the protocol

IssueCauseSolution
Japanese input unavailableIME not runningRestart fcitx-mozc, add input source
Incorrect key layoutKeyboard mismatchUse setxkbmap
Backslash not workingxrdp keymap issueEdit keymap or switch to VNC

8. Secure Remote Access Using SSH Tunneling

Security risks of remote desktop connections

While RDP and VNC are convenient, exposing them directly to the internet is dangerous. Without proper protection, they are vulnerable to unauthorized access and traffic interception.

SSH tunneling provides a secure solution by creating an encrypted channel for remote desktop traffic.

[Windows] --(SSH encrypted)--> [Ubuntu]
   |
   +--> (Internal port forwarding for RDP or VNC)

What is an SSH tunnel?

An SSH tunnel uses the Secure Shell protocol to securely forward other types of network traffic. This allows even unencrypted protocols like VNC to operate safely over encrypted channels.

Prerequisites: Enable SSH on Ubuntu

sudo apt update
sudo apt install openssh-server -y
sudo systemctl status ssh
sudo ufw allow ssh

Create an SSH tunnel from Windows (VNC example)

Using the command line

ssh -L 5901:localhost:5901 your-user@ubuntu-ip

Then connect your VNC client to:

localhost:5901

Using GUI SSH clients

  • Tera Term or PuTTY can configure port forwarding via GUI
  • Suitable for users who prefer graphical tools

Using SSH tunneling with RDP

ssh -L 3389:localhost:3389 your-user@ubuntu-ip

Then connect using Windows Remote Desktop to localhost:3389.

Improve security with public key authentication

ssh-keygen
ssh-copy-id your-user@ubuntu-ip
PubkeyAuthentication yes
PasswordAuthentication no
sudo systemctl restart ssh

Pros and cons of SSH tunneling

ItemDescription
✔ AdvantagesEncrypted communication with high security
✔ AdvantagesNo need to expose RDP/VNC ports directly
✖ DisadvantagesInitial setup complexity
✖ DisadvantagesTunnel must remain open during use

Conclusion: SSH tunneling is essential for external access

When accessing Ubuntu remotely from outside the local network, SSH tunneling is strongly recommended. It provides a secure and flexible remote access solution.

9. FAQ: Common Questions About Ubuntu Remote Desktop

Q1. Why does my remote connection fail?

A. Check the following:

  • Correct IP address
  • Same LAN connection
  • Firewall settings
  • X.org session for RDP
  • Running services (xrdp, VNC, SSH)

Q2. The screen is laggy or unstable

A. Try:

  • Lower bandwidth mode in RDP
  • Use Xfce for VNC
  • Avoid heavy graphics
  • Use wired LAN

Q3. Can Ubuntu connect to Windows?

A. Yes. Use Remmina:

sudo apt install remmina -y

Q4. How do I connect from outside my network?

A. Use VPN or SSH tunneling. Port forwarding is not recommended.

Q5. Can I avoid password entry?

A. SSH supports public key authentication. RDP/VNC auto-login increases risk and should be avoided.

Q6. Why does Japanese input fail?

A. IME or keyboard layout issues. Restart fcitx or apply setxkbmap.

Q7. Is remote desktop free?

A. Yes. Ubuntu, xrdp, VNC, and Remmina are open source and free.

Q8. Can multiple users share the same screen?

A. VNC allows shared sessions; RDP uses separate sessions.

Q9. Ubuntu enters sleep mode during remote access

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

Q10. Should I use RDP or VNC?

A. RDP for performance, VNC for sharing and flexibility.

10. Conclusion: Master Secure and Efficient Remote Access on Ubuntu

Remote desktop on Ubuntu is easier than you think

Ubuntu remote desktop is practical and accessible, even for beginners. Ubuntu 22.04 provides built-in RDP, while older versions work well with xrdp or VNC.

Choose the right method for your needs

Use caseRecommended methodNotes
Home LAN accessRDPFast and easy from Windows
External secure accessRDP/VNC + SSH tunnelEncrypted communication
Shared screen sessionsVNCIdeal for collaboration
CLI administrationSSHLightweight and robust

Security starts with one extra step

Always combine remote desktop access with SSH tunneling or VPN when accessing Ubuntu externally.

Troubleshooting is part of the process

Most issues—black screens, input problems, connection failures—have known solutions. Refer back to this guide whenever needed.

Take the first step

Start with RDP on the same LAN and experience how simple Ubuntu remote desktop can be.

This concludes the complete guide to Ubuntu remote desktop connections.
Thank you for reading.