LJ Archive

Wall-Mounted Dual-Head Desktop

Marcin Teodorczyk

Issue #218, June 2012

Would you like to do less and get more? Try a wall-mounted PC with Linux, multihead with Xinerama and input sharing with a tiling window manager for less input and more output.

Would you like to do less and get more? Yes, that's a standard salesman question, but I couldn't resist using it in this article, because it just fits so well.

One thing that always has bothered me is the amount of work I've had to do to change hardware on my PC. Of course, I don't have screws in my case—it's quite pointless when you take your case off every few days. But even so, adding or removing some hardware was a painful job.

Another inconvenience I've repeatedly encountered was extensive use of virtual desktops. My 24" display just wasn't enough, and bigger ones were too high to be comfortably usable for me. Even with a relatively small font size, a Web browser and two terminals for input plus two terminals with logs preview didn't fit well on one desktop. Thus, very often I had to switch every few seconds between two—a browser with input terminals and terminals with logs.

The above reasons were sufficient enough to end my laziness for a while and make me to do a little research. I found two solutions that suited me perfectly. The first one was a wall-mounted PC. And, the second was multihead with Xinerama and a tiling window manager. In this article, I explain how I made my first dual-head wall-mounted PC and shared its input with a laptop.

Wall-Mounted PCs

A wall-mounted PC is exactly what the name says—a PC mounted on a wall. As an example, you can see my machine, called VMS (Virtual Machine Server), shown in Figure 1. Why would anyone do something like this?

Figure 1. VMS (Virtual Machine Server): a wall-mounted, dual-head PC and a laptop connected with Synergy.

First, it's a lot of fun to make it. If you're into case-modding, you might like making wall-mounted PCs. Second, such a computer has easier accessible modules. If you have a constantly unscrewed or opened case, a wall-mounted PC might be a good solution for you. Third, it is generally easier to keep clean, especially if it's uncovered. Also, it uses less space, because it hangs flat on the wall, usually at a fair height—taking space that typically is unused. It's also easier to control the wires. Finally, and this might be a matter of opinion, but I think it just looks good. It has a bit of a working-on-a-laptop feel, because you have it all before your eyes.

As a disadvantage, messing with the case might break the air circulation and can be dangerous for the cooling system. Thus, when doing such a project, you should think it out and monitor/benchmark the hardware for the first few hours or days, especially the temperature sensor readings. Another disadvantage is mobility. Assuming everything is wireless, you need to have one power supply cord. Typically, you also will have Ethernet and display cables, and possibly a keyboard and mouse as well. The mainboard is in a fixed position on the wall. You can move a PC with a case and peripherals relatively easily to other place, but a wall-mounted PC requires you to disconnect all cables and prepare a new wall. When it has no case, you have to be extremely cautious too.

Multihead with Linux

Whether or not you decide to use a wall-mounted PC, you might want to try a multihead display setup. You'll find it useful especially if you often switch between windows or virtual desktops. Personally, I find the three-display setup to be the most optimal. One display is for my activity, and the other two are for monitoring purposes, such as log tails, network traffic dumps or documentation. This doesn't require me to switch focus between displays, but it allows me to see actual information in a blink of an eye.

If you decide to try multihead with Linux, you'll have at least three options for the hardware: one multihead graphic card, a few typical graphic cards or some mix of those two.

Multihead graphic cards are more expensive than typical ones and not always well supported by Linux, although you often can find proprietary drivers. On the other hand, they take less slots on the mainboard, and if well supported, they are very easy to set up. Thus, when you decide to use such a solution, the main thing you should consider is Linux support. Typical multihead graphic cards deliver two or four video outputs, but you also can find ones with more.

Alternatively, you can use a few typical graphic cards. Sure, they'll take more slots on the mainboard, but they have two advantages. First, if each one is supported by Linux, they should work with multihead with no problems. Second, you easily can add/remove displays/cards to/from your setup.

On the software side, you have again at least three possibilities: a proprietary solution, Xorg with a few screens or Xinerama.

Proprietary solutions are popular with multihead graphic cards. For a few graphic cards, you either can set up Xorg to use a few screens or use Xinerama. The first solution is very inconvenient for typical desktop use, because it requires you to manipulate the DISPLAY environment variable. I focus on Xinerama here. Xinerama makes one virtual desktop from all your displays, and this is what you usually would want.

Tiling Window Managers

A tiling window manager might come in handy when working with more than one display, especially if you mainly tend to use the keyboard. In such managers, windows always occupy the whole desktop area—there is no window stacking (except in a few cases, such as video playing). Figure 2 shows an example screenshot of two displays controlled by the Xmonad tiling window manager. Other examples of tiling window managers include Awesome, WMII or Ratpoison.

Figure 2. Two HD Displays Controlled by Xmonad

Output/Input Sharing

Apart from the multihead setup, there are a few solutions for output (display) and input (keyboard and mouse) sharing between PCs over the network. Two examples are Xdmx and Synergy, respectively.

Xdmx lets you use another PC display as a second display for your first PC. From the user point of view, it works just like Xinerama, but instead of connecting the second display to the second graphic card, you connect the second PC to your network.

Synergy lets you use your computer's keyboard and mouse to control another computer that is connected to the network. The focus can be switched either with mouse or keyboard. For example, if you have your second PC to the right of your first one, you can set up Synergy to switch focus when you move the cursor of your first PC to the right over the right edge of your screen. In such a case, the cursor will appear on the second PC screen immediately.

VMS (Virtual Machine Server)

VMS is my first wall-mounted, dual-head PC. It has no input devices, and it works as a personal lab and computing machine. It's connected to an Ethernet network and controlled only from the laptop connecting to the network from time to time. It works as a sort of server and docking station for the laptop, extending its power and screen area while keeping the input system.

I set up this system in three steps. First, I made the wall-mounted “case”. Second, I set up dual-head, and finally, I removed the server keyboard and mouse and configured Synergy to share input with the laptop connected to the LAN.

For the wall-mounted “case”, I selected the simplest and fastest solution: a board, a few screws and perforated metal tape. It took me no more than one hour to build it, but you can go further. For example, you could use a metal plate instead of a wooden board as well as hinges and Plexiglas as a cover.

For the dual-head setup, I chose two cards. First, I checked whether they worked separately. After making sure they did, I plugged in both of them and checked the BIOS settings. Typically, one card always is set up as a master—this one will work during bootup.

After booting Linux, I checked how the cards were connected with lspci:

[root@vms ~]# lspci | grep -i vga
01:00.0 VGA compatible controller: Advanced Micro 
 ↪Devices [AMD] nee ATI RV370 [Radeon X550]
03:05.0 VGA compatible controller: Advanced Micro 
 ↪Devices [AMD] nee ATI RV100 QY [Radeon 7000/VE]

The above shows what driver to use as well as the bus ID (first column), which will be necessary for proper Xorg configuration. In my case, the driver for both cards is Radeon. The location of the configuration file depends on your installation, but usually it is located by Xorg in /etc/xorg.conf. Listing 1 shows my configuration.

The Device, Monitor and Screen sections are not much different from a single-head setup, but they are duplicated—one for each graphic card and display. The only difference that you might see is the bus ID I read earlier using PCI—this is used to distinguish the cards.

The Xinerama setup is done in the ServerLayout section. I define two screens and their relative position. Screen 1 is on the right of Screen 0. Finally, I turn on Xinerama with Option "Xinerama" on.

The last thing I needed to do before running Xorg with two displays was choose a window manager.

Xmonad

I've been using Xmonad for a while on my laptop, and since it has great support for Xinerama, I decided to try it first for the multihead setup. Xmonad delivers nine desktops and three layouts by default.

In Xinerama setup, virtual desktops are shared between the screens. That means you can switch between the screens and between the virtual desktops on each screen, but virtual desktop nr 3 on screen 0 is the same as virtual desktop nr 3 on screen 1. Also, you can't see the same virtual desktop on both screens. Thus, when, for example, you have virtual desktop nr 3 present on screen 0 and want to switch to virtual desktop nr 3 on screen 1, screen 0 goes blank.

On each desktop, by default, you can choose either vertical, horizontal or full-screen layout. You easily can extend Xmonad with other layouts, but for 16:9 displays, I recommend trying three-column.

The Xmonad's default shortcuts are based on Vi-like keybindings. Figure 3 shows Xmonad's cheat sheet. You also can define custom keybindings.

Figure 3. Xmonad Cheat sheet

Connecting a Laptop with Synergy

Next, I took advantage of the wall-mounted PC setup and connected a laptop to it with Synergy. The laptop works as a third (middle) screen and a master input device. In practice, when connected to the network, I'm able to move the laptop's mouse pointer seamlessly between screens as well as switch the focus with the keyboard.

Synergy works as a client/server application. The server has control over the input. The client gives away control over its input, but its input devices also can be used simultaneously. In my case, the laptop is the server.

You need to configure only the server. Listing 2 shows an example configuration. It is placed in /etc/synergy.conf.

In the section screens, I define the hosts that I want to be connected. In the section links, I define the relations between the hosts and their screens. Finally, I define the keystrokes that can be used to switch focus.

With the server configured, you can start the synergys dæmon as well as the client on the laptop with synergyc servername, where servername is the name of synergy server machine running syngergys. It is important to make sure that the hostnames you used in the configuration file (in my case red and vms) are resolvable.

Also, keep in mind that communication between hosts isn't secure. If you want to secure it, you can use SSH tunneling. For example, on the client machine, you can run:

ssh -L 24800:server:24800 server

24800 is the default listening port for the Synergy server, and server is the hostname for the server. After that, you can run the client with:

synergyc localhost. 

Summary

Building VMS and connecting it with my laptop was a lot of fun, but using it is a real pleasure compared to how I worked earlier. Nonetheless, what I've shown here is only one example of what you can do to make your own power-user desktop. The possibilities are endless. For example, I'm thinking about a five-display setup now, or one of those wearable screens that looks like glasses and gives the impression of a 16-meter display—if only the resolution of such a solution was more than 800x600.

Marcin Teodorczyk is a GNU/Linux user with more than ten years of experience. For the past three years, he's been using Arch Linux exclusively on his personal computers. Marcin has an M.Sc. degree in IT and works as a security officer. In his spare time, he works out or writes articles for IT-related magazines.

LJ Archive