Let's say I have a Firefox window downloading a big file that will take a lot of time. Now that it's running halfway and I want to switch to another DE (for example from GNOME to KDE), can I do that without interrupting the download?

EDIT: I'm not using GDM or KDM or any desktop manager, which may make the situation more difficult...

4 Answers
4

You have to leave the original X server running. You can start another X server on another tty. So, on a typical system, do ctrl+alt+f1, then log in and run startx -- :1. You should end up with another X session on reachable by ctrl+alt+f8.

Any number of X servers can be started by changing the number after the colon; if you use a number larger than 12, you can use chvt to change to it instead of the key combo.

If you want, you can setup special .xinitrc files that start different desktop environments. So you might have a .xinitrc-kde that starts a KDE session. In that file, you'd have something like exec startkde. And you'd start X like by doing startx ./.xinitrc-kde -- :1.

If you've planned in advance that you want to access one application from several different X sessions, you can run it inside a virtual X server: the application displays inside the virtual X server, and the virtual X server appears as a window inside any number of real X servers.

One possibility for the virtual X server is VNC. Start the vncserver program; this creates a virtual X server and runs ~/.vnc/xstartup, which typically runs ~/.xinitrc like startx. Then call xvncviewer to show a window containing the virtual X server's display. The virtual server keeps running until the session exits or you run vncserver -kill; you can connect and disconnect viewers at will. You may need to specify a display number on the command line, e.g. vncserver :3 and xvncviewer :3. VNC sessions can be accessed from different machines if no firewall gets in the way: xvncviewer somehost:3. There are multiple implementations of VNC servers and viewers.

Yes you can. If you use GNOME, click on System->Log Out username, which will bring this dialogue:

Clicking on user Switch User takes me to a gdm window, which asks me which user I want to switch to. Once you are done with the login, you can always switch back to the original user with either CtrlAltF7 or by using the same sequence of commands I stated above.