Is it possible to put a GUI to more than just TTY7?

My question is pretty much the title. I often use TTYs for handling different matters in parallel. This could be for instance:

  • something local on TTY1
  • per SSH on ServerA on TTY2
  • per SSH on ServerB on TTY3
  • network surveillance on TTY4
  • desktop GUI on TTY7

There are cases however, when it would be nice to have 1 desktop each on different TTYs. Like for example:

  • instance 1 with XFCE/Unity/Kde on TTY7
  • instance 2 with XFCE/Unity/Kde on TTY8

Is that possible?


Solution 1:

Yes and no.

Setting aside TTY/PTS parts of the conversation...

Yes you can run more then one Xorg instance.

X :1
X :2
X :3

would start 3 new Xorg sessions on display ports 1,2, and 3

You can run damn near any command by setting the DISPLAY variable.

so DISPLAY=:1 xterm would start xterm on display port 1

Your "default" desktop is display port 0 (:0)

Now for the no part.

Unity is not a great desktop environment. As much as some people like it it really departs from a lot of things that make Linux awesome. One of those things, is that it assumes that it will be only running once. So starting Unity on many display ports usually produces tons of errors as both "environments" fight over settings and such.

KDE used to have the same problem (it still might). XFCE and other "more traditional" desktop environments usually work fine, or at the very least, work as one instance per user logged in.

So yes you can run several GUI sessions at once in different TTY/PTY and access them by pressing CTRL+ALT+F7-F12 (depending on kernel settings).

Solution 2:

Yes you may start a new GUI in a different TTY. From the default Ubuntu TTY (number 7), switch to another TTY (number 3 in this example) by pressing:

Ctrl+Alt+F3

Provide your username and password and then start a new X session, using the same number of the present TTY:

startx -- :3