X2Go shows a full Linux desktop of your server in a window on your computer. It connects over SSH, so it needs no extra open port. When you close the window, your programs keep running on the server, and the next connection brings back the same desktop.

The steps below install the light XFCE desktop on Ubuntu. They were tested on Ubuntu 26.04 LTS.


1. Install the Desktop and X2Go Server

Connect to your server with SSH as root (see How to Connect to a Linux Server via SSH) and run:

apt update
apt install xfce4 xfce4-goodies xubuntu-wallpapers x2goserver x2goserver-xsession lightdm- light-locker-

This installs about 500 packages and takes a few minutes. The minus signs after lightdm and light-locker tell apt to leave these two out: a server needs no login screen for a monitor, and the light-locker screen locker is not needed with X2Go. Without xubuntu-wallpapers, the desktop background stays black. On Debian, leave xubuntu-wallpapers out of the command: Debian does not have this package, and apt stops with Unable to locate package xubuntu-wallpapers.

2. Create a User for the Desktop

Do not use root for the desktop. Create your own user and allow it to run administrator commands with sudo (replace alex with your name):

adduser alex
usermod -aG sudo alex

adduser asks for the new user's password twice. You can skip the other questions with Enter.

3. Install X2Go Client on Your Computer

  • Windows and macOS: download X2Go Client from the X2Go download page. On macOS it also needs XQuartz; the download page explains how to install it.
  • Ubuntu, Debian and similar: sudo apt install x2goclient

4. Add Your Server

Start X2Go Client. The first time, it opens the Session preferences window by itself; later you open it with Session → New session. Fill in:

  1. Session name: any name, for example My server.
  2. Host: your server's IP address.
  3. Login: the user you created in step 2.
  4. Session type: XFCE.
  5. Choose OK.

X2Go Client session preferences with name, host, login and session type

The desktop opens at 800 × 600 pixels unless you change it. On the Input/Output tab, choose Fullscreen (1), or Custom with a size that fits your screen (2).

The Input/Output tab with Fullscreen and a custom size

5. Connect

Click your server in the list on the right. Type the user's password (1) and choose Ok (2).

X2Go Client asks for the password

The first time, X2Go Client does not know your server's SSH key yet and asks whether you trust it. This is normal for a new connection. Choose Yes.

X2Go Client asks whether to trust the server's host key

The desktop of your server opens in a window. The first start takes about half a minute.

The XFCE desktop of the server in X2Go

From here you work as on any computer: the bar at the bottom opens a terminal, the file manager and a web browser, and Applications at the top left lists all programs.

A terminal and the file manager on the server's desktop

If Windows Have No Title Bar or Leave Black Areas

XFCE's window effects do not work well through X2Go. Switch them off once: open Applications → Settings → Window Manager Tweaks.

Applications, Settings, Window Manager Tweaks

On the Compositor tab, clear Enable display compositing (1) and close the window. New windows are drawn correctly at once.

Window Manager Tweaks with display compositing switched off

You can do the same in the desktop's terminal:

xfconf-query -c xfwm4 -p /general/use_compositing -s false

Close the Window or Log Out

  • Close the X2Go window: the session waits on the server, and your programs keep running. Next time you click your server in X2Go Client, you get the same desktop back.
  • Applications → Log Out: ends the session and closes all its programs.

After a while without use, the desktop locks itself, also while the X2Go window is closed. To unlock it, type the user's password (1) and choose Unlock (2).

The locked desktop asks for the user's password

If It Does Not Work

  • "SSH daemon could not be started" (X2Go Client on Linux): printing to your computer and shared folders need an SSH server on your computer. On the Media tab of the session, clear Client side printing support, or install openssh-server on your computer.
  • Only a black screen after connecting: close the X2Go window, connect with SSH as your user and end the old session. x2golistsessions shows the session ID (the second field), and x2goterminate-session followed by that ID ends it. Then connect again.
  • Wrong password or no answer: X2Go uses the same login as SSH. Check that you can connect with SSH as the same user first.
💡 Protect SSH

X2Go is as safe as your SSH access. Use a strong password, or better, an SSH key.


Related Guides

View all Ubuntu and Debian guides

Was this answer helpful? 0 Users Found This Useful (0 Votes)