Local and remote X sessions on different consoles

There are several ways to start graphical applications remotely with Linux. One of the most simple and obvious is ssh with -X input parameter. Command ssh -X user@host “firefox” will start best browser ever from remote host (you’ll see it in your local X session). But what about remote session instead of single applications?

To start remote X11 session on first console (switch to it with CTRL+F1) execute:

xinit ssh -X user@host "startkde" -- :1

Now you can switch between local session (CTRL+F7) and remote one (CTRL+F1). Be careful: it’s very easy to mix up remote and local systems by sight 🙂

My respect to Alexey Sveshnikov.

You may also be interested in:
Secure shell (ssh) connection without password
Keep ssh session saved (Unix “screen” utility)
Moving Linux to remote server (over ssh via third server)
Secure shell (ssh) session timeout


Stefan Durand

My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

Leave a Reply

Your email address will not be published. Required fields are marked *