Dual Displays On Solaris
If you've got two monitors and two video cards, there's a pretty
simple way to hook up both monitors to a single Solaris desktop
and use them side-by-side. One of the monitors will be the primary
monitor (the one you log in on), and the other will be a sort of
virtual extension - if you move the mouse pointer sideways off the
primary screen, it'll appear on the second screen. Display windows
can't straddle the boundary between screens, but having two screens
(and multiple virtual desktops on each) can be really handy.
Here's how to do it:
Hook Up The Hardware
Duh! Plug both video cards in, and hook up both monitors.
Turn the monitors on.
Verify Or Create Device Definitions
Take a look in the /dev directory for defined
framebuffer devices. Use this command:
cd /dev
ls -l | grep fb
You should definitely see an entry for fb0 - that's
your primary frame buffer, or primary video card. If you also
see an entry for fb1, that means your system already
knows about the secondary frame buffer (second video card),
so you may not need to do anything more with regard to
device definition.
If you don't see an entry for fb1 (or if something
odd is going on and you just want to force the system to
reexamine the attached devices), you can tell the system
to rescan devices as part of a reboot. Close down all your
nonessential processes, root the box, and then type this
command:
reboot -- -r
Yes, it's weird-looking. It's "reboot space dash dash space
dash r". When you run this command, the machine will reboot
immediately, and when it comes back up it will re-check all
connected devices and generate entries in /dev as
needed. After the reboot has finished up and all the dust
has settled, go back into /dev and you should see
entries for both fb0 and fb1, your two video
cards.
Create Or Edit Your Xservers File
At this point, the hardware is configured for use; all you
have to do now is convince the X window manager software to
use both video cards.
There's a file named /usr/dt/config/Xservers that
contains the display definition information, and some folks
just wade into that file and start hacking away. A much
safer approach is to modify (or create, as needed) an
Xservers file in /etc/dt/config that defines your
dual-head video configuration.
If you screw up the Xservers file in /etc/dt/config,
the system will fall back on the Xservers file in
/usr/dt/config, and you've got the chance to
fix your mistake. If you only have one Xservers file
on the system and you screw that file up, you may have
a little more trouble making repairs.
So - root the box, then go into /etc/dt/config
(create the directory if you need to) and create or edit
the Xservers file. Here's an example XServers line that
defines two monitors and sets the color depth to 24 bits
on each:
:0 Local local_uid@console root /usr/openwin/bin/X -dev /dev/fb0 defdepth 24 right -dev /dev/fb1 defdepth 24 left
NOTE! NOTE! NOTE! The preceding Xservers file line is
meant to be put in the Xservers file as a single line,
with no leading white space. I let it wrap on this page so
that it's easy to read and print, but it's all just one
big long line in the Xservers file.
You can use leading pound signs to indicate comment
lines in the Xservers file, if
that sort of thing interests you.
In this example, we define frame buffer 0 as the "right" side and
frame buffer 1 as the "left" side - this just tells the X window
manager how to handle the mouse positioning behavior between
the two screens.
Reboot!
Root the box and type reboot, and when it comes
up you should see your normal login screen on the primary
display. Log in, and voila! - your second screen
pops to life. If you've fouled up somehow and reversed
the right and left monitors, the simplest thing to do
is just swap the cables.
So, there you have it - now you're running two monitors
at once. It really is quite slick, isn't it?
|