If you share your Linux desktop machine with other users, you may occasionally need to switch from 1 X session to another. For example, you are busy writing code or blogging, and your spouse walks up to you and asks to 'quickly' check her email. You can log out so that she can login using her own account. But, the current context of your work is lost, and you need to re-establish it when you resume.
A better way is to have her run a second simultaneous X session. The steps are as follows:
Switch to a virtual terminal.
By default, six virtual text terminals are available to you (
Control+Alt+F1to go to virtual terminal 1.
Login as her.
Execute the following command:
$ startx -- :1
This starts another X session using the first free graphical console. By default, 6 X consoles are available (
F12). Your own existing X session is
Ctrl+Alt+F7. The next free X console is therefore
To switch from her X session to yours, and vice versa, press
You may use the above procedure to create up to 5 additional X sessions (
Ctrl+Alt+F12). For each additional X session, increment the console number in both step 1 and 3. For instance, switch to virtual terminal 2 (
Control+Alt+F2) to execute the command
startx -- :2.