Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I run two instance of, e.g. GNOME, on my computer at once? I know how to change the virtual terminal, but I can't work out how to start a second instance of gnome - it just exits telling me that the X session is locked.

EDIT: The other thing that I would really like to know is how to run two different desktops at once - e.g. XFCE and GNOME. I know that I can change the default desktop in .xinitrc or something like that, but then I would have to do so every time - is there any way to select the desktop type when creating the new XSession?

share|improve this question
up vote 6 down vote accepted

The key is creating a new "screen" on which the xserver can run. Something along the lines of

 startx -- :1

where 1 is the increment of the number of screens you already have running (with the initial screen :0).

Fedora Forums has a good bit of information, but I'm not sure if its still accurate.

For information best suited to your distribution, be sure to look at the man page, man startx, from a terminal, or just Google "man startx" and go from one of the man page directories online.

share|improve this answer

Use Xephyr to create an embedded X session.

$ Xephyr -ac -br -noreset -screen 800x600 :1

-ac disable access control restrictions
-br create root window with black background
-noreset don't reset after last client exists
-screen 800x600 Specify screen characteristics

Open the terminal and set the DISPLAY variable

DISPLAY=:1.0

Do not use export or all your programs will appear in the embedded session. Now, whenever you run a program from this terminal, it will appear in the embedded X session.

If you wonder, Xephyr will just create a new window with the given resolution, so you don't have to worry about getting back to your original session.

share|improve this answer

Use xnest. Xnest launches a new X server (:1, :2, etc) inside an X window. Very useful to log in as several users/with several different desktops at the same time. If you're using GDM, you can automatically log in as a new user (or environment) with

gdmflexiserver --xnest
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .