Ssh – Launch a GNOME session from a remote terminal

gnomelinuxsshxorg

I'm sshing into my friend's machine and I'm wondering how I would launch a GNOME session over SSH. I need to open a web browser on his machine to view something which can only be done from his hostname. What's the easiest way to achieve this via SSH?

Best Answer

Switch to a second terminal, for example tty2: CtrlAlt-F2, login and start a new X session on an available display:

xinit -- :1

Now ssh to the other machine, enabling X forwarding (or trusted X forwarding with -Y):

ssh -X user@machine

Once logged in, start a new gnome-session:

gnome-session

You can also pass gnome-session as a command to ssh.