Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label kvm. Show all posts
Showing posts with label kvm. Show all posts

2008-09-19

915resolution + xorg.conf = Intel 82852/855GM @ 1600x1200x60Hz

Last week I ordered a new Sceptre 24" monitor from Tigerdirect.ca, and this week it arrived, only a few days later. Zero dead pixels, works perfectly -- and the current website price is 22% more! Timing is everything, apparently.

Of course setting up my laptops to play nice with it was another story, but for my Thinkpad T60p, I've managed to get a single display using aticonfig:

aticonfig --initial=dual-head -f
aticonfig --dtop=horizontal --overlay-on=1 --mode2=1920x1200 \
 --resolution=0,1920x1200,1600x1200,1400x1050,1280x1024,1024x768 \
 --resolution=1,1920x1200,1600x1200,1400x1050,1280x1024,1024x768

Granted, I don't have both the laptop and monitor enabled at the moment, but that's probably because I'm trying to push the laptop screen to a res it can't support (1600x1200). I could probably get them to both go to 1400x1050, but so far I'm happy w/ the single screen.

Anyway, the harder project was getting my wife's old R51 to connect to the Sceptre X24, for two reasons: one, its screen is all but dead (still works, but it's as if it's set to a brightness level of 2%); and two, the automatic configuration in Xubuntu kinda sucks for xorg.conf creation.

After a number of searches, attempts, and failures, I finally found a way to push the Intel 82852/855GM (rev 02) card to 1600x1200 at 60Hz. Here's how:

First, install 915resolution 0.5.3-1ubuntu1 from the ubuntu universe repositories. I tried downloading drivers from Intel, but I couldn't compile anything -- xf86-video-intel-2.4.2.tar.bz2, i915Graphics.tar.gz, drm.tar.gz or mesa.tar.gz -- missing dependencies, apparently.

Next, read the README that comes with 915resolution, /usr/share/doc/915resolution/README.Debian. It explains exactly how to use this tool. Here's what I put in my /etc/default/915resolution file:

MODE=3c
XRESO=1920
YRESO=1440
BIT=8

Next, in your xorg.conf, set the Driver to "i810", set the BusID to the value shown by lspci | grep VGA, set HorizSync & VertRefresh to values that will work for your monitor, and then add Display subsections for all the resolutions you want to try to use.

Section "Device"
       Identifier      "Intel Corporation Mobile Integrated Graphics Controller"
       Driver          "i810"
       BusID           "PCI:0:2:0"
       Option "DevicePresence" "true"
       Option "DRI"      "true"
EndSection

Section "Monitor"
 Identifier "Configured Monitor"
 ModelName    "Sceptre X24"
        HorizSync    31 - 80
        VertRefresh  55 - 76
        Option      "DPMS" "true"
EndSection

Section "Screen"
       Identifier      "Default Screen"
       Device          "Intel Corporation Mobile Integrated Graphics Controller"
       Monitor         "Configured Monitor"
       DefaultDepth    16
       SubSection "Display"
               Depth           16
               Modes           "1920x1440_60" "1920x1200_60" "1920x1080_60" "1680x1050_59.883" "1360x768_59.8" "1600x1200_60" 
       EndSubSection
       SubSection "Display"
               Depth           24
               Modes           "1920x1440_60" "1920x1200_60" "1920x1080_60" "1680x1050_59.883" "1360x768_59.8" "1600x1200_60" 
       EndSubSection
EndSection

Note that the most useful thing I managed to find was how to explicitly set display frequencies: for 1600x1200 at 60Hz, use "1600x1200_60". (This was required because xubuntu by default was trying to run at 59Hz and was creating terrible ghosting effects.)

To test out the above configuration, I wrote this little script (based on ideas here):

#!/bin/bash
# start a new X session on head :5, fire an xterm, and 
# launch kruler to measure screen res
# switch between vt sessions with CTRL-ALT-Fx, 
# eg., for vt2, CTRL-ALT-F2.
# I found this new vt with CTRL-ALT-F9
X -novtswitch :5 & xterm -display :5 & kruler -display :5 &

Now, granted, I still can't get 1920x1200x60Hz (the monitor's native resolution), but I may have found a solution: Tritton TRIUV200 See2 Xtreme USB 2.0 to DVI/VGA adapter.

Anyway, using a Kinamax KVM-USB4 USB 4 Port KVM Switch, I've got two laptops sharing the 24" 1600x1200 screen, with room to add up to two more systems. Minimal desktop clutter, maximum productivity.

Now, if I can just figure out a solution to my wife's workspace clutter...

2007-05-12

Synergy - multiple computers, one shared keyboard

At the suggestion of my summer co-op student & fellow linux evangelist, Neil Skrypuch, I've installed Synergy and can now control my three systems (desktop + two laptops) from a single keyboard. The most amusing part of this is that I can wrest control of my other half's mouse when she's playing cards to mess up her game.

In all seriousness, this is a very cool app which effectively eliminates my need for a KVM box, and also provides more function than a KVM, since not only can I now control multiple desktops from one place, I can also pass data between them. The best use of this so far is that I can select a URL on one machine and open it with another, as Synergy creates a shared clipboard all desktops can use. Very cool.

Here's how I have it set up:

  1. Server: Thinkpad w/ external monitor, keyboard, mouse. Located on left side of desk, with monitor in center of desk.
  2. Client #1: Desktop w/ backup keyboard/mouse (out of the way and rarely used). Located on right side of desk
  3. Client #2: SWMNBN's Thinkpad (for entertainment purposes only). Located on her desk, right of mine.

All I had to do was create an /etc/synergy.conf:

section: screens
  nickblappy:
  nickbdesk:
  TPAD:
end
section: links
  nickblappy:
    right = nickbdesk
  nickbdesk:
    left  = nickblappy
    right = TPAD
  TPAD:
    left = nickbdesk
end
section: options
  switchCorners = all
  switchCornerSize = 15
  switchDelay = 500
  screenSaverSync = false
  keystroke(alt+left) = switchInDirection(left)
  keystroke(shift+control+alt) = switchToScreen(nickblappy)
end

So, on startup of the Thinkpad (server), I run this alias:

alias SS='killall synergys; sleep 1; synergys'

And on the desktop:

alias SC='killall synergyc; sleep 1; synergyc 192.168.0.123'

As the second Thinkpad is running Windows, I just configure the client to auto-start on login and connect to the server's IP. To suppress warning messages when the server's powered down or travelling, I've set the Logging Level to Error instead of the default Warning.

That's it - it's crazy simple. You can also set linux clients/servers to run on startup, or to use SSH to encrypt data sent between machines.


Update:

To encrypt traffic with SSH, you need to do three things:

  1. Run OpenSSH on the server
  2. Run OpenSSH on the client, with local port forwarding. Here's a snippet of my ~/.ssh/config file:
    Host nickblappy
    Port 22
    Hostname 192.168.0.123
    
    Host localhost
    Port 22
    Hostname localhost
    LocalForward 24800 nickblappy:24800
  3. Change your alias to connect to localhost instead of the remote server:
    alias SC='killall synergyc; sleep 1; synergyc localhost'

    - or -

    alias SC='killall synergyc; sleep 2; screen ssh localhost "synergyc -f localhost"'

    (then CTRL-A,D to detach)