Skip to content

Instantly share code, notes, and snippets.

@FenixC4
Created April 11, 2025 19:35
Show Gist options
  • Save FenixC4/f6828918f5e766c6d8fe508deda752b3 to your computer and use it in GitHub Desktop.
Save FenixC4/f6828918f5e766c6d8fe508deda752b3 to your computer and use it in GitHub Desktop.
AI generated X2Go installation and config process

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:

  1. Server Setup (Your Ubuntu Laptop)
  2. Client Setup (Your Windows PC)

Part 1: Server Setup (Ubuntu 24.04 Laptop with DWM)

  1. 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 ssh

    You can check its status to be sure:

    sudo systemctl status ssh

    (It should show "active (running)")

  2. Install X2Go Server Components: Now install the necessary X2Go server packages:

    sudo apt install x2goserver x2goserver-xsession

    This will pull in the required dependencies.

  3. 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 ufw wasn'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)

  4. 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 inet address under your active network interface, likely eth0 for wired or wlan0 for wireless. It will look something like 192.168.1.X or 10.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)

  1. 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.

  2. Install the X2Go Client: Run the downloaded .exe file. 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.

  3. 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 22 unless 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 or exec dwm in your .xinitrc, you might need that command here. Let's try dwm first.
          • 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 simple dwm command doesn't work.
      • Connection Tab:

        • Connection speed: You're on a LAN, so this isn't critical, but you can set it to LAN if you like. The default ADSL might be fine too.
        • Compression: The defaults (e.g., 16m-jpeg image compression, quality 9) are usually a good starting point for LAN. You can experiment later if needed, but defaults should feel very responsive locally.
      • Input/Output Tab:

        • Display: Choose whether you want it to run Fullscreen or 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.
      • Media Tab:

        • You mentioned you don't need audio or printing. Uncheck Enable sound support and Client side printing support. This might save a tiny bit of overhead.
      • Shared folders Tab:

        • You mentioned you don't need file transfer. You can ignore this tab.
    • Click OK to save the session configuration.

  4. 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.
  5. 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 type or Command being incorrect.
    • Try changing the Command from dwm to exec dwm.
    • Make sure DWM is actually installed and runnable for your user. Can you run dwm from a TTY on the laptop?
    • Is there a specific script you use to launch DWM (e.g., something in ~/.xinitrc or ~/.xsession)? If so, you might need to point the Command field to that script, or replicate its essential parts. For example, if DWM needs other programs running (like slstatus or nitrogen for wallpaper), you might need a small script.
      • Create a script like ~/.x2go/startdwm.sh on 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.sh as the Command in X2Go Client.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment