GreyBeard Inc.

    
    
     

Running Two Workstations from one PC

    Having run LInux (and X more specifically) on desktops and laptops for a long time, I have tried a lot of different configurations and setups. Recently however I found myself with a need for two workstations and while I had two sets of keyboards, 2 mice, and two monitors, I had only one PC (running Debian unstable). It took some trial and error but running multiple desktops from one not-so-new PC is both relatively easy to configure and surprisingly usable once set up.

     The best way I found to run two independent desktops from the same PC was to setup and execute two separate instances of X, each with it's own xorg.conf file defining the hardware available to each desktop. The first hurdle is the fact that most of the time all devices of a particular class become functional when the server starts, eg. a PS/2 and USB keyboard, or a built in touchpad and a USB mouse. Most configurations do this by default since it is the preferred behavior. To avoid this I setup two xorg.conf files, and changed several device definitions and Xorg drivers to enable a more specific definition of which mouse and which keyboard should be activated when the server starts. For mouse devices the entry for "device" in the xorg.conf file must be changed from /dev/input/mice to /dev/input/mouseN (N being 0, or 1, etc). Keyboards I found to be better separated by using the evdev driver. Here is an example of a keyboard xorg.conf definition using evdev:

Section "InputDevice"
    Identifier     "Generic Keyboard"
    Driver         "evdev"
    Option         "Device" "/dev/input/event1"
    Option         "XkbRules" "evdev"
    Option         "XkbLayout" "us"
EndSection

And of course each xorg.conf file must has the correct video and monitor sections for the hardware each will use, though these sections are the same as they would be for a standard X configuration.

    In my setup I have a 15" flatscreen connected to an aging ATI Radeon PCI card, and a 21" widescreen LCD attached to a low end NVIDIA Geforce. The ATI card uses the Xorg ATI driver, while the NVIDIA card uses the proprietary driver (I am not a big fan of proprietary drivers, even out of tree drivers for that matter, but the performance of this driver crushes the Xorg nv alternative. C'est la vie).  The big screen and NVIDIA card are the primary workstation, while the smaller screen and ATI card handle the secondary station.

    Once you have two distinct xorg.conf files each with the hardware you want on each desktop defined, Its time to start each one up individually to make sure things go as planned. I named my two config files xorg.conf_nvidia and xorg.conf_radeon, so to start the primary workstation I use:

 startx -- -config xorg.conf_nvidia

    If the server crashes with a confusing looking backtrace, check to make sure your evdev device entry for the keyboard is correct. You can test this from the command line by doing a "cat /dev/input/eventN" (replace N with the device number you are testing) then press the keys of the connected keyboards in turn until one spits out nasty characters to the terminal. You may have to logout or switch to another VT if the output of "cat" on the device file corrupts the prompt.

    Once you can start each server up individually and the hardware is correct it's time to get them both running at once. There are surely better ways to do this but the only way I could make things work was to start the primary workstation first, then from there kick off the secondary desktop. The only difference in the startx commands is that we need to define a display number since the default of ":0" is being used by the first desktop, and that we need to tell the X server not to hijack the focus from our first terminal when the second desktop kicks in.

startx -- :1 -config xorg.conf_radeon -sharevts &

    I am sure there are probably better ways to run two workstations from one PC, but this approach works great for me, even watching a movie on one while my daughter surfs the net on the other is smooth. The PC is modest machine (1.4 P4/700MB RAM) running Debian unstable and 2.6.22-ck1.


Images
No Images with this post
Comments
No comments posted yet

Add a comment


Name:
Email:
Subject:
Comment:
Security Image:
security image
Enter the letters you see above.