GreyBeard Inc.

    
    
     

3 Screen Desktop. Sort of.

    In a perfect world a laptop with both DVI and VGA outputs can power two separate monitors. There would also be less of what appears to be an internationally organized effort to convince me to "impr0ve my manliness" via a constant stream of email. But back in the real world my Inbox is full of spam and my laptop (DELL Inspiron 9400) is limited to one connected monitor on either the DVI or the VGA output. Having convinced myself that a desktop split between the laptop's 1920x1200 17" LCD and a Samsung 21" 1680x1050 monitor is far to small a workspace to get anything done, I set out to see if it was possible to add another display to my setup. It just so happens I have a 21 " Westinghouse LCD that would be a perfect 3rd monitor, currently part of a dual workstation connected to an aging Gateway PC running Debian unstable. While I can't make this 3rd screen an actual part of my main desktop, I can gain control of the window manager running on it almost as if it was, giving me a 3 screen desktop, sort of. All it takes is some xorg configuration changes, a network connection between the two machines, and a nifty tool called x2x.

    The xorg graphic system is a server client design. Though disabled by default on most Linux distros, with the proper configuration it's possible to run graphical applications (or entire window managers) from a remote machine on the X server running locally on your workstation. I used to run the X based version of SAM on HPUX via remote X on a laptop running Linux when I was doing Unix system administration. Very handy, and slightly faster than waiting for the VT100 terminal version to redraw the console screen :). To add a 3rd screen to my desktop (sort of) we can take advantage of the X servers ability to work over a network via the x2x utility. This tool lets us create a connection between two running X servers, allowing the same keyboard and mouse to be used by both. To accomplish this we have to enable both X servers to listen on the network, configure access between the two machines, then fire up the x2x utility with the correct options.

    Your X servers may be listening on the network already, you can tell by looking for port 6000 in the output of netstat:

jason@jackass ~$ netstat -lnt | grep 6000
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN     

If  you don't see it you need to change the configuration by removing the often added "-nolisten tcp" option being passed to X at start up. In Debian the configuration file is called xserverrc and is located in /etc/X11/xinit/.  This process needs to be repeated on both machines until netstat shows that both X servers are listening on port 6000.

    Next we need to allow the X servers to communicate using the xhost command. You can disable all access controls with "xhost +", or stipulate the ip address of the machine you want to allow. For my setup the laptop at ip address 10.0.0.1 is the primary desktop, and the desktop running what will become my "3rd screen" is at 10.0.0.2. So I run "xhost 10.0.0.2" on the laptop, and "xhost 10.0.0.1" on the secondary, or "xhost +" on both if I don't care about restricting connections. 

    Finally we run the x2x application on the primary desktop. The options are pretty straightforward:

 x2x -to 10.0.0.2:0 -from 10.0.0.1:0 -west &

The "-to" option is the ip of the desktop we want to be able to take control over, "-from" is the ip of the primary machine, and "-west" is the direction from the main display that the new screen is placed. Since my 3rd screen is to the left of my my primary display "-west" configures x2x to jump the keyboard and mouse to the other desktop when the mouse is moved past the left (west) side of the screen. The :0 suffix on the ips defines the "display number" of the X server, since it can be running in multiple instances on the same hardware, each then having it's own display number eg :0, :1, etc. For most setups this will be :0.

    So now I have my laptop in the center, a 21" screen to the right that is an actual second screen (using NVIDIA's twinview) and a 21" screen to the left that is running from the desktop not my laptop, but it can be controlled by just moving the mouse to it as if it was physically connected. With the exception that I cannot drag windows to or from this 3rd screen it is very much like having an additional display, and there are some advantages to having a 3rd monitor that is actually running on separate hardware.

    Time to wrap this up, I was just notified by email that I could earn millions of dollars by simply sending my bank account information to an undisclosed party! Wish me luck!


Images
preview
3 screen desktop, sort of
Comments
x2x via ssh
Posted by Slushpupie 1 year, 8 days ago
You can use ssh to improve security, and use the display forwarded through an ssh connection. On reasonably modern systems the encryption overhead has no real impact on use (except in cases where bandwidth gets too limited, like with GL and stuff) I would also be curious how well the USB->VGA adapters work in Linux. There seems to be some indication some work ok, might be a reasonable alternative to running an extra system.

Add a comment


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