Using spare pc as second monitor

Solution 1:

This is what Xdmx was designed to do, but it hasn't been updated since 2004. Good luck getting it to work with (insert distro here)'s heavily patched and recent X.org.

Another solution there is, is Synergy. However, Synergy is designed for use with multiple working computers, and not to simulate monitors.

As such, you won't be able to access your files from the first machine while using the second machine's monitor, and you won't be able to run applications on one and switch them to the other (like a second monitor). If you're determined, you might setup NFS so that the two systems can at least share your personal files.

Solution 2:

Just thought I'd document my notes here: I too wanted to use a spare PC as second monitor - but only for some applications. In particular, when I work with latex on the development (server) PC, I'd like to show the PDF output in evince (running also on server PC), on another (client) PC's monitor - while the client PC is otherwise doing its own stuff.

This situation is a bit easier to implement than "true" second monitor "desktop sharing" over network, as done with Xdmx and shown in 'Use an old laptop as a second monitor with Xdmx' (http://www.youtube.com/watch?v=YOzRCBGDVaE, as per comment by @EsbenSkovPedersen). Note however, that the video raises security considerations (e.g. sniffing keyboard strokes via X protocol) for "true" second monitor over network - and I'm not sure how secure my case is - but I need it only temporarily anyways.

Anyways - on the development (server) machine/PC, do:

SERVER$ vnc4server :1 -depth 16 -geometry 800x600

You will require a password to access your desktops.

Password:
Password must be at least 6 characters - try again
...
New 'mypc:1 (user)' desktop is mypc:1
...

This creates a second, virtual screen (display) named :1 on the server machine, which is accessible through VNC; -geometry can be freely selected. After the command executes, the Xvnc4 process will be running in the background, managing this screen.

To check if everything is OK, a small test can be made on the server PC, by running a VNC client to connect to the VNC server. However, note that if you just run vncviewer localhost - you will likely get the error "unable to connect to host: Connection refused (111)". This is because we did not specify the display we want to connect to in that command line! So the proper command line for the test is:

SERVER$ vncviewer localhost:1
...
 CConn:       connected to host localhost port 5901
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
Password: 
Thu Aug  1 23:02:27 2013
 TXImage:     Using default colormap and visual, TrueColor, depth 24.
...

Once this commands runs, you'll get a new window on the server PC, showing the contents of the virtual session on screen/display :1, managed by vncserver (note that usual desktop settings like fonts etc will likely not be preserved). However, once this test succeeds, we can be pretty sure that the same virtual desktop on the server PC, can now be accessed from the client PC over the network.

To run a program inside this virtual display session, use the DISPLAY environment variable:

SERVER$ DISPLAY=:1 evince

To connect to this session from the client machine, simply do:

CLIENT$ vncviewer mypc:1

... or you could use the IP address of the server PC mypc directly ( as in, for example, vncviewer 192.168.200.200:1 ). Again, a window opens inside the currently running client PC operating system, which shows the virtual display session on the server PC (just like in the test).

Once done with work - to disable the virtual display session sharing over VNC, do on the server PC:

SERVER$ vnc4server -kill :1

Got this technique from [ubuntu] Use VNC as a second monitor - ubuntuforums.org; some other links dealing with similar topics:

  • A Poor Man’s Multi-Monitor Setup On A Single Physical Head | Kasperian Moving Parts: Xdmx + Xephyr
  • Multi-Monitor Setup On A Single Physical Head (Now Better!) | Kasperian Moving Parts: fakexinerama library
  • multiple monitors - How do you use an android tablet as a second display? - Ask Ubuntu: among other links and approaches, also xrandr + x11vnc
  • xorg - Linux: Use VNC to create a second Screen - Super User: Xorg, Xdmx and x11vnc