Team LiB
Previous Section Next Section

Hack 16. Switch Users Fast

It's a personal computer. No, it's a family computer. No, it's two . . . two . . . two computers in one! Picture this. You're working at home on an important business document when your daughter tells you she needs to use the computer for a while to do research for a school project. Do you have to close all your applications and log out for her to do her work? Nope. The following hack shows you a few ways to let your daughter log in and work with her own desktop without you having to close your applications and log out first.

You can get two or more users logged in and running separate graphical desktops on the same machine in a number of ways. This hack explores the built-in method.

3.2.1. First, a Lesson on Virtual Terminals

You might recall that people used to attach several text-based terminals to minicomputers and mainframes so that many users could access the computer at once. Each person could log in to the computer and work on his separate text console, because he had his own text-based terminal connected to the main computer. Linux simulates that kind of behavior with a single terminal and several virtual consoles. Most Linux distributions provide six text-based virtual consoles and usually three virtual consoles for graphical desktops, although more of both types are possible.

If you have used the graphical interface only on Linux and you're not familiar with virtual consoles, here's a quick way to see what they're all about. Press the key combination Ctrl-Alt-F1. You should see a text-based screen with a login prompt. This is virtual console 1. Press the key combination Ctrl-Alt-F2. This is virtual console 2. You can get back to the graphical desktop by pressing Ctrl-Alt-F7, because the default virtual console for graphical desktops is virtual console 7. If you can start up a second graphical desktop, it will be assigned to the next available virtual console after the previous graphical desktop, which is virtual console 8. You can switch to that desktop by pressing Ctrl-Alt-F8. So, when you achieve your goal of starting up two separate graphical desktops, you can switch between them by pressing Ctrl-Alt-F7 and Ctrl-Alt-F8.

3.2.2. The Built-In KDE and GNOME Way

Some Linux distributions with the latest versions of GNOME or KDE include a menu option to log in as another user on a separate virtual terminal. For example, as of this writing, one menu sequence (on Gentoo Linux) for GNOME is ApplicationsSystem ToolsNew Login. This brings up a second GNOME-based graphical login screen (GDM), from which a second user can log in and start working with her account. This works only if you started GNOME from GDM. Here's why: after you start a GNOME session, part of GDM is still running in the background waiting for you to exit GNOME. The menu selection depends on this program to be running in the background, so if you didn't start GNOME with GDM, it won't be running and waiting to start another session.

Fedora Core 2 currently does not offer the option of starting a new login, even though it runs GDM by default. You can still get multiple simultaneous logins with graphical desktops using the other techniques described in this hack.

The latest versions of KDE have a similar option. The menu sequence on my Gentoo system is K MenuSystemNew Login. (Beware: I take the risk of running the latest unstable versions of software on my system, so you might not have this option.) Again, this will work only if you logged in to KDE from the KDE graphical login screen, KDM. This launches a second KDM graphical login screen, from which a second user can log in to her own session.

Because your version of GNOME and/or KDE probably lacks these menu options, here are two additional, easy ways to get two or more graphical login screens running at once. The first way sets up multiple login screens for KDM. The second sets up multiple login screens for GDM.

    Team LiB
    Previous Section Next Section