Remote desktop

From Liki

Jump to: navigation, search

Most of the time when you want to run an X-application on a remote computer, but display it on your local X server, you just log in with ssh -X or -XY and run the application. Sometimes, though, you don't remember the name of the application and are too lazy to look it up, but you could find it if you could run the desktop (Gnome, KDE, etc).

You can easily start up a remote (or local, but that's less exciting) desktop in a window on your current desktop with the following (adapted from Marcel Gagne's `Can't get enough desktops')

From some X terminal on your computer, start a nested X server

$ Xnest :1 -ac

A nested X server is basically an independent X server that lives in a window on your main X server. As far as your main X server is concerned it is a client, but as far as your desktop-to-be is concerned it is a server. The display you assign it to shouldn't conflict with an existing X server, but if you're reading this you're probably only running the default server on :0 anyway, so :1 is safe. -ac turns off access controls, which lets us run remote X applications for display on the new server.

Then just SSH into your remote host (tunneling X)

ssh -X <username>@<hostname>

and fire up your desktop:

gnome-session

for Gnome,

startkde

for KDE, etc.

If display space is tight (you've seen my EeePC...), you can find your current display resolution with.

$ xrandr | grep '*'
    800x480        60.5*+

and open your nested X server to fit

Xnest :1 -ac --geometry 800x480 &


Windows managers

For those seeking to experiment with assorted windows managers, take a look here.

Personal tools