Running multiple X11 sessions

In: Linux
Written by: Taylor Gerring


24 Dec 2008

Got a misbehaving application preventing logout or maybe there’s a game that demands then entirety of your screen? There’s a couple of different ways to start a second X11 instance, both of which are very easy to use. One requires just a few keystrokes, and the other allows you to embed one session within your existing.

Note: This is tested on Ubuntu Intrepid Ibex (8.10)

  1. Switch to tty1 (Ctrl-Alt-F1)
  2. Start X on a second display – this should kick you right into the new X session. Note that displays are 0-base indexed. Your normal session runs on :0. If you need more, use :2, :3, etc. and they should increase along with tty8, tty9.
    startx -- :1
  3. To return to your original X session, switch to tty7 (Ctrl-Alt-F7)
  4. To return to your new X session, switch to tty8 (Ctrl-Alt-F8)
  5. To end your new X session, simply logout as normal, and switch back to tty7 (Ctrl-Alt-F7)

You may also want to consider playing with xnest to embed one X session within another. I haven’t personally tried xnest, but I found a recommendation and thought it might be worthwhile to someone out there.

Hope that helps!

Comment Form

@TaylorGerring


Unless specified otherwise, this website is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States.
Stop SOPA
Unless specified otherwise, this website is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States.