How to run 2 X sessions with different display managers?
Solution 1
Questions #1: How to run multiple X sessions at the same time
You need to run sudo startx gnome-session -- :1 vt8
- the vt8
tells X to start the session on TTY8 (which you get to with ctrlaltF8)
Question #2: Drag windows between X Sessions
I doubt that's possible, and if it is, with the software we have today it would be very unstable - it's the job of the DE to do everything from window management and toolbar rendering to workspace placement, and you can't just 'cut and paste' a window from one DE to another. In the future this could be possible, as it sounds like something the Wayland graphics server (hoped to be a replacement for X) could be better at managing. But for the moment at least, it's unlikely to work.
Solution 2
I am using 2 different sessions on Ubuntu like this:
- Create new user
- CTRL+ALT+L (switch account)
- Log into using that user
Ubuntu creates new X session in next tty when another user logins. So now you can switch between those sessions using CTRL+ALT+F7 and CTRL+ALT+F8.
I've never tried with Gnome3 but it works with XBMC session
Related videos on Youtube
![VedVals](https://i.stack.imgur.com/mkmId.jpg?s=256&g=1)
VedVals
I am a student of Instrumentation and Control AT VIT, Pune, India. I am a Linux enthusiast with a desire to learn whatever I find interesting. I Love to learn new things anytime. I Also like to try to trash my Ubuntu system in as many ways as possible.
Updated on September 18, 2022Comments
-
VedVals almost 2 years
I read about the virtual terminals a little and that gave me an idea. I searched for a way to have two X sessions simultaneously.
I had a look at these sites :
1. How to run multiple user X sessions on the same computer, at the same time?
2. How to drag windows between 2 X servers?I tried
startx -- :1
but my earlier terminal (on Ctrl+Alt+F7) hung up. How do I ensure this does not happen?My main need is to get Unity on
:0
and Gnome-shell on:1
and switch between them like workspaces.If possible, I'd like to get login screen on tty8 or get option of logging into a different account.
As per question 2, exchanging windows between sessions is not recommended as it is not easy. But if it is possible I'd like to know.
I have Ubuntu 12.04 64bit.
The above command made both sessions crashed (virtual one worked for 15 min then crashed when I switched to real).
Also, how to revert to one X session if system gets overloaded?
Update :
Tried code in answer 3 times but system never stabilizes. Either tty7 or tty8 works, but not simultaneously, for sometime before crashing.
-
VedVals over 11 yearsAnd what about 2nd query? How to do that? Will such a system be stable?
-
jackweirdy over 11 yearsA second X session shouldn't cause any problems as when you switch TTYs the X server that's "in focus" should get controlled by your input devices (IE mouse and keyboard). This is the system I currently use to have the chromeOS desktop environment running alongside Unity.
-
VedVals over 11 yearsNo I meant how to exchange windows. Also the command I tried (one in question) might not be the one as now both terminals are hanged.
-
jackweirdy over 11 yearsYou should clarify in your question that exchanging windows is a requirement; you don't mention it anywhere
-
VedVals over 11 yearsI edited the question to clear it. Any suggestions?
-
VedVals over 11 yearsWhat happened to the earlier answer? Keep it too. Add this as an update.
-
VedVals over 11 yearsTried the code 3 times. System just crashes.
-
daboross about 11 yearsThis does seem to work! Do you know if this works running multiple DEs?
-
Kokizzu almost 4 yearsi've been using this for ages, but i got problem: unix.stackexchange.com/questions/600381