Cooking with Linux - Can't Get Enough Desktops!

Explore new user interface ideas without leaving your regular desktop. Our chef shows you how to nest X sessions.

From that command line, start your window manager or desktop simply by typing its command name, such as xfce4-session for XFCE, amiwm for AmiWM and so on.

After you've played with several window managers in this manner, you may find yourself faced with a bit of a roadblock. Sometimes, in doing this, I ran into a message (particularly from GNOME) that it could not start, specifically gnome-session: you're already running a session manager. As I knew this wasn't the case, I checked to see what the SESSION_MANAGER pointed to:


As you can see, I had leftover session information from a prior run with a nested window manager. One option is to unset the SESSION_MANAGER variable. Another is simply to remove the troubling files, assuming, of course, that you are no longer running your window manager:

$ rm /tmp/.ICE-unix/3132
rm: remove socket `/tmp/.ICE-unix/3132'? y

It would appear, mes amis, that closing time is approaching rapidly, so it's time for la pièce de résistance—your desktop dessert, if you will. Some of you may be asking, “if I can run one nested server, why not two or three?” Starting a second nested server is simply a matter of assigning a different display number. For the second, type Xnest -ac :2 or Xnest -ac :3 for the third and so on. In fact, you can run an Xnest inside of another Xnest. Figure 3 shows an IceWM session running inside a GNOME session, running inside a KDE session.

Figure 3. IceWM Nested inside of GNOME, Nested inside of KDE

As you can see, mes amis, there is enough here to satisfy the greatest desktop gourmand among you, non? As Robert Heinlein might have said, “to enjoy the full flavor of life, take big bites” or in this case, run many different window managers and many desktops.

And now, closing time truly is upon us, but spend a little more time exploring. François will refill your glasses one final time before you go. Until next time, mes amis, let us all drink to one another's health. A vôtre santé! Bon appétit!

Marcel Gagné ( lives in Mississauga, Ontario. He is the author of the newly published Moving to Linux: Kiss the Blue Screen of Death Goodbye! (ISBN 0-321-15998-5) from Addison Wesley. His first book is the highly acclaimed Linux System Administration: A User's Guide (ISBN 0-201-71934-7). In real life, he is president of Salmar Consulting, Inc., a systems integration and network consulting firm.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Al Phi's picture

This is the first truly exciting article about the X Window System that I have read.

I'm relatively new to Linux, and I've been experimenting with different window managers. But I had been starting each in its own display, which was a bit limiting to me.

I haven't encountered any talk about replacing X (except for the fact that Mac OS X uses its own GUI system), if someone could point me in the general direction, it would be greatly appreciated.

Very good

Pranith's picture

thank you, thank you. thank you...........this was fantabulous....really
out of bounds...thnx for letting me into this.


WilsonGC's picture

Excellent article.
Simple and very very useful.
Just what I had looking for to
display my DECwindows session over IP in
my desktop without leaving my current KDE session.


starting default window manager

abcollier's picture

it is also possible to just start your default window manager in the xnest window:

$ startx -- /usr/X11R6/bin/Xnest :1

the -scrns option

abcollier's picture

and the -scrns option allows multiple windows to be opened:

$ Xnest -scrns 3 :1 -ac &
$ xclock -display :1.0 &

Re: Can't Get Enough Desktops!

aru's picture


You say, in the article:

> In some cases, you won't be able to start a window manager
> using some kind of display redirect switch. This is true with
> KDE, AmiWM, XFCE and some others. To run these window
> managers, begin with a simple X terminal in your nested X
> server:

How about this?

DISPLAY=:1 startkde

Isn't this easier than the method you suggest?


Re: Can't Get Enough Desktops!

Anonymous's picture

The thing is to start another wm inside another one and not just run another wm inside another display

Re: Can't Get Enough Desktops!

Anonymous's picture

Xnest won't run for me on Fedora Core 1.
I get:

#Xnest :1 -ac &

Fatal server error:
Unable to open display "".

Re: Can't Get Enough Desktops!

Anonymous's picture

export DISPLAY="0:1"
Xnest blah blah blah

Re: Can't Get Enough Desktops!

Anonymous's picture

Excellent article... Somehow I knew this must be possible, but I just didn't know how to do it!

Re: Can't Get Enough Desktops!

Anonymous's picture

Xnest won't run for me on Fedora Core 1.
I get:

#Xnest :1 -ac &

Fatal server error:
Unable to open display "".

Re: Can't Get Enough Desktops!

Anonymous's picture

It would appear that the author never heard of the command


Try it. Beats the -- :1 stuff hands down in most cases.

This requires that you have

Anonymous's picture

This requires that you have Gnome installed, though, right?

Re: Can't Get Enough Desktops!

Anonymous's picture

Sweet! Thanks.

Re: Can't Get Enough Desktops!

Anonymous's picture

>> Issue 119: Can't Get Enough Desktops! <<
>> Posted on Monday, March 01, 2004 by Marcel Gagn

Re: Can't Get Enough Desktops!

Anonymous's picture

unfortunately XP vs Win9x and SMB athentication has always been a mistery to me, I like to setup a printer under linux using CUPS and share it to Windows using the internet printing protocol (IPP), which bypasses the SMB/SAMBA authentication stuff completely and most every OS uses. But I don't even know if RH9 still uses the (now obsolete) crappy LPD printing system or the much better CUPSD printing stuff.([L=here is a little overview for the terms with CUPS][/L])

To see if you are using cups, cups has a web-based configuration setup you can access thru [L=][/L]. If you can access that from your linux machine then check out [L=here][/L] and skip down to the section "add a printer" in step 4 and follow the steps that follow that. See if that makes sense, hopefully that will bypass the RH9's "helpfull" printer setup application and configure the printer for you.

Then for specific applications you may still have to specify in their printing configs to use the command "lpr" or "lpr -P printernameyouchoosed"


Your a idiot.

Thanks for a good X Window System article

Anonymous's picture

We need more of these. X is powerful. It is multi-user at the GUI level as Linux / UNIX is at the command line level.

With all the current noise about replacing X, articles like this go a long way toward educating people as to what X is really about. It is my belief, that once they actually understand what it is they would be giving up, some of this noise may go away for a while.

Good Stuff, thanks again!

Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up and watch now

Sponsored by Skybot