Keep applications running across X sessions

xorg

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…

Best Answer

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 plan on running Firefox on both the sessions, there may be some issues. Look into the "no-remote" and "ProfileManager" command line options for Firefox.