Okay, let's get X2Go set up! It's a great choice for performance, especially with a lightweight window manager like DWM on X11 over a LAN.
We'll break this down into two parts:
- Server Setup (Your Ubuntu Laptop)
- Client Setup (Your Windows PC)
Part 1: Server Setup (Ubuntu 24.04 Laptop with DWM)
-
Install SSH Server (if not already installed): X2Go relies on SSH for secure connections and tunneling. Ubuntu Desktop doesn't always install the SSH server by default. Let's make sure it's there and running. Open a terminal on your Ubuntu laptop:
sudo apt update sudo apt install openssh-server
Now, let's enable and start the SSH service:
sudo systemctl enable ssh sudo systemctl start sshYou can check its status to be sure:
sudo systemctl status ssh
(It should show "active (running)")
-
Install X2Go Server Components: Now install the necessary X2Go server packages:
sudo apt install x2goserver x2goserver-xsession
This will pull in the required dependencies.
-
Firewall Configuration (Important!): Even on a LAN, Ubuntu's default firewall (
ufw) might be active and blocking incoming SSH connections. We need to allow SSH traffic (which uses port 22 by default).sudo ufw allow ssh
Or, equivalently:
sudo ufw allow 22/tcp
If
ufwwasn't active, you might get a message saying "Firewall not enabled". If it was active, make sure to check the status:sudo ufw status
(It should show port 22 or ssh listed as ALLOW IN)
-
Find Your Laptop's IP Address: You'll need this for the client configuration on your Windows machine. Run one of these commands in the terminal on your laptop:
ip a
(Look for the
inetaddress under your active network interface, likelyeth0for wired orwlan0for wireless. It will look something like192.168.1.Xor10.0.0.X). Or a quicker way sometimes:hostname -I
(This often prints just the IP address(es)). Note down this IP address. Let's assume for example it's
192.168.1.105.
Server setup should now be complete! X2Go server doesn't usually require much configuration itself; it leverages SSH and hooks into the X session system.
Part 2: Client Setup (Windows PC)
-
Download the X2Go Client: Go to the official X2Go Wiki download page: https://wiki.x2go.org/doku.php/download:start Download the latest stable installer for Windows.
-
Install the X2Go Client: Run the downloaded
.exefile. The installation is straightforward – accept the license agreement and follow the prompts. It might ask to install PuTTY (an SSH client) if you don't have it; let it do so if needed. -
Configure a New Session:
-
Launch the X2Go Client application on your Windows PC.
-
Go to the menu:
Session->New session... -
You'll see a configuration window with several tabs. Fill them out as follows:
-
Session Tab:
- Session name: Give it a descriptive name (e.g.,
My Ubuntu Laptop,DWM Session). - Host: Enter the IP address of your Ubuntu laptop that you noted down earlier (e.g.,
192.168.1.105). - Login: Enter your username on the Ubuntu laptop.
- SSH port: Keep this as
22unless you have specifically changed the SSH port on your laptop. - Session type: This is crucial for DWM! Since DWM isn't one of the standard desktop environments listed, select
Custom desktop. - Command: In the field below "Custom desktop", enter the command that starts DWM. This is often simply
dwm. If you normally start it with a script orexec dwmin your.xinitrc, you might need that command here. Let's trydwmfirst.- Question for you: How do you normally launch your DWM session when you log in locally? Is it just
dwm, or do you use a script? Knowing this might help if the simpledwmcommand doesn't work.
- Question for you: How do you normally launch your DWM session when you log in locally? Is it just
- Session name: Give it a descriptive name (e.g.,
-
Connection Tab:
- Connection speed: You're on a LAN, so this isn't critical, but you can set it to
LANif you like. The default ADSL might be fine too. - Compression: The defaults (e.g.,
16m-jpegimage compression, quality9) are usually a good starting point for LAN. You can experiment later if needed, but defaults should feel very responsive locally.
- Connection speed: You're on a LAN, so this isn't critical, but you can set it to
-
Input/Output Tab:
- Display: Choose whether you want it to run
Fullscreenor set a specific custom resolution. Fullscreen often provides the most immersive experience. - Set display DPI: Keep at default (96) unless you know you need something different.
- Keyboard: Keep "Auto-detect" or set your specific layout if auto-detect fails.
- Display: Choose whether you want it to run
-
Media Tab:
- You mentioned you don't need audio or printing. Uncheck
Enable sound supportandClient side printing support. This might save a tiny bit of overhead.
- You mentioned you don't need audio or printing. Uncheck
-
Shared folders Tab:
- You mentioned you don't need file transfer. You can ignore this tab.
-
-
Click OK to save the session configuration.
-
-
Connect!
- You should now see a "card" for the session you just created in the main X2Go Client window.
- Click on this session card.
- It will prompt you for your Ubuntu user's password. Enter it and click OK.
- First Connection Only: You will likely see a warning about the host key authenticity ("The authenticity of host '[IP address]' can't be established..."). This is normal for the first SSH connection to a new server. Verify the fingerprint if you're paranoid, but on a trusted LAN, you can usually just click Yes to accept and save the host key.
-
Enjoy Your Remote DWM Session! If everything works, a window should appear showing your DWM session, running remotely from your laptop but displayed on your Windows PC. You should have keyboard, mouse control, and clipboard sharing should work between the two machines.
Troubleshooting / Potential Issues:
- Connection Refused: Double-check the IP address. Ensure the SSH server is running (
sudo systemctl status ssh) and the firewall allows port 22 (sudo ufw status) on the laptop. - Authentication Failed: Double-check your username and password. Linux usernames are case-sensitive.
- Black Screen or Session Ends Immediately: This often points to the
Session typeorCommandbeing incorrect.- Try changing the
Commandfromdwmtoexec dwm. - Make sure DWM is actually installed and runnable for your user. Can you run
dwmfrom a TTY on the laptop? - Is there a specific script you use to launch DWM (e.g., something in
~/.xinitrcor~/.xsession)? If so, you might need to point theCommandfield to that script, or replicate its essential parts. For example, if DWM needs other programs running (likeslstatusornitrogenfor wallpaper), you might need a small script.- Create a script like
~/.x2go/startdwm.shon the laptop:#!/bin/bash # Add any programs you need to start alongside dwm here, backgrounded # Example: slstatus & # Example: nitrogen --restore & exec dwm
- Make it executable:
chmod +x ~/.x2go/startdwm.sh - Use the full path
/home/your_username/.x2go/startdwm.shas theCommandin X2Go Client.
- Create a script like
- Try changing the
- Keyboard/Mouse Issues: Check the Keyboard settings in the Input/Output tab. Ensure DWM isn't grabbing the keyboard in a way that conflicts (unlikely, but possible).
- Clipboard Not Working: Usually works out of the box. Ensure it's not disabled in any settings. Sometimes restarting the session helps.
Let me know how the setup goes! Tell me where you get stuck or if the simple dwm command works for the session type. We can refine it from there.