Multiple X ( Desktop ) Sessions in Ubuntu

Giles Orr gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Jan 22 16:02:59 UTC 2014


On 21 January 2014 22:25, Aruna Hewapathirane <aruna.hewapathirane-Re5JQEeQqe8 at public.gmane.orgm
> wrote:

> I was testing window managers and having a hard time comparing each due to
> constantly having to log-off and sign back in as another user with a
> different window manager and then something sweet happened. I came across a
> article and now I am flipping back and forth between virtual terminals that
> have gnome-classic, LXDE, Openbox and Awesome and it's amazing.
>
> The article is here:
> http://www.doknowevil.net/2010/10/13/multiple-x-desktop-sessions-in-ubuntu/
>  and for those of us who are lazy the content is right below, seriously
> you should try this it blew me away :)
>
>
> -------------------------------------------------------------------------------------------------------------------------------------------
> This post has a lot to do with graphics but there are no graphics. It’s a
> walk-through explanation and and proof of concept of some very interesting
> features of Linux as a desktop operating system.
>
> If you aren’t familiar with X, than this webpage might confuse you<http://www.x.org>,
> the X Window System <http://en.wikipedia.org/wiki/X_Window_System> is
> what draws the GUI (graphical user interface) for Ubuntu. On top of this,
> you may have a Window Manager or Desktop Environment <http://xwinman.org/>,
> such as Gnome (Ubuntu default) or KDE (Kubuntu).
>
> When you boot up Ubuntu, it creates a set of “virtual terminals”. These
> VTs are accessible via a key combination of clt+alt+f1-12. VT7
> (ctrl+alt+f7) is the default and it handles X’s “screen 0″. If you play
> around, with the key combination, you’ll notice you drop into consoles with
> a login prompt (f1-6) or a blank screen (f8-f12, don’t worry if you see
> USB errors <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/256767>).
>
>
> These virtual terminals used to be handled by X which was slower and more
> prone to crash (citation needed) but since Ubuntu 8.04, this has been
> handled by “Kernel Mode” <https://wiki.ubuntu.com/X/KernelModeSetting>,
> where this management is handled by the kernel. You can switch to another
> virtual terminal and create another X session.
>
> Typically in Linux, you could switch to another VT, login [as another
> user] and type $ *startx — :1* (special argument ‘--‘ marks the end of
> client arguments and the beginning of server options, :1 defines screen 1).
> This will work in Ubuntu but the part where I found it failing was
> switching between this newly created X session and back to my original :0
> on VT7.
>
> The way I found to do this in Ubuntu seems a bit counter-intuitive. Before
> I explain, you should create a new user, if you don’t have another already.
> You can do this by going to System > Administration > Users and Groups.
>
> To create a second X session in Ubuntu, go to your logout menu (default
> top right) and select “switch user”, and login as another user (you don’t
> want to create an error in the user environment). When you login as another
> user, Ubuntu creates a screen :1 on VT8. This means, you can change back to
> VT7 with ctrl+alt+f7, then back to VT8 with ctrl+alt+f8. I *suspect* this
> is the reason VT8-12 show up as blank screens instead of login terminals.
> Ubuntu seems to be leveraging the power of virtual terminals for “user
> switches”.
>
> I haven’t noticed much in performance loss doing this and the other big
> question is practicality. Why would you ever do this? Perhaps you are
> testing software and want isolated test cases or you want a dedicated user
> for games with a more streamlined window manager and want to be able to
> flip back and forth.
>
> -------------------------------------------------------------------------------------------------------------
>

I've spent a lot of time working with a variety of window managers, and the
method described in the article works well.  It's also good if you want to
run different WMs at different resolutions.  You can also use Xnest or
Xephyr (if you can get them running), to test WMs - it's essentially an X
server inside a window in your window manager.  But that can be problematic
as the parent window manager traps keys that would otherwise be passed to
the child window manager, so there are limitations.

Contrary to Lennart's dislike of tiling window managers, I'm actually a
pretty big fan - although usually only on netbooks and smallish laptops,
where "use the whole screen for one window and don't ask me about
arrangement" actually makes sense.  I mention this because Xephyr and a
tiling window manager offers an interesting solution for running
multi-window applications like the GIMP that don't play well with tiling
window managers: run most of your applications as usual in the tiling
window manager, but run a lightweight "normal" WM (fluxbox, icewm, jwm ...
there are lots of choices) in Xephyr, and run the GIMP in Xephyr.  It
works, although it's still subject to the key-combo trapping I mentioned
earlier.  But it'll work well if you use the Xephyrized WM as mouse only.

And a touch of self promotion (directly related to the subject at hand):
"The Window Manager Report," http://www.gilesorr.com/wm/ , which includes a
comprehensive (correct me if I'm wrong!) list of Window Managers.

-- 
Giles
http://www.gilesorr.com/
gilesorr-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20140122/d467493d/attachment.html>


More information about the Legacy mailing list