Monday, August 17, 2009

Using multiple window managers with nested Xserver

I use gnome as my default desktop at home and at office. However, my machines have alternate desktop environment such as kde or xfce installed. I use it to test out features of these environment. The normal way to switch to a different desktop is to log out from the current desktop , select a new session from the gdm login window and login again. However, it is possible to open a new desktop environment in a virtual console using xnest nested xserver.

Installation

$ sudo apt-get install xnest

Using Xnest to run another window manager.

Method 1
Xnest server can be started from a terminal as below


Xnest :1 -ac &


See the screen shot below. The :1 above indicates virtual X display numbered 1. You can also try other numbers.



Now on the terminal , Type the following command.
export DISPLAY=:1

The above line exports the variable DISPLAY to :1. Now you can open a terminal in the Xnest window by typing xterm & in the terminal. See the screen shot below.



Now try to start up a window manager such as icewm by typing icewm inside the xterm.


I could start icewm and fluxbox and kde like this. However, trying to start gnome-session resulted in some error. I am yet to find out the reason .


Method 2
This method uses gdmflexiserver . gdmflexiserver is a part of gdm and it is used to run gdm session on demand on a virtual terminal.

You can start it to give a gdm login prompt as below.

$ gdmflexiserver -n


You will get a new virtual X with a gdm login screen. See the picture below.




You can log in as a different user using a different session from the above screen. ( All the screen shots were taken on ubuntu 8.10)

5 comments:

Unknown said...

s/widow/window/
s/form/from/
s/enlivenment/environment/
s/sceenshots/screenshots/

Anonymous said...

why don't create another X server with xinit -- :1 and use VTs to switch between X servers ?
This way, you've a fullscreen X full featured, and switch is easy and fast with Kernel mode settings... You can easily switch between X servers with ctrl+atl+F7...

Fermi Level said...

@chenlevy

Thanks for pointing out the typos. I did not spell check before posting.

Anonymous said...

Anonymous said... why don't create another X server with xinit -- :1 and use VTs to switch between X servers ?

I think he would have had to change the title and that's not necessarily easy.

Anonymous said...

>> why don't create another X server with xinit -- :1 and use VTs to switch between X servers ?
>>

Because it is annoying. Especially if want to switch to other X server often... you have to witness a bad "flicker".

I use nested X for running programs that have a tendency to lock up my entire X session. I would recommend Xephyr instead of xnest though.