[RndTbl] Second screen view from first screen

Trevor Cordes trevor at tecnopolis.ca
Thu May 11 02:50:02 CDT 2017


At the meeting the other day a member asked about an interesting
problem.  He has 2 monitors on a linux box and one monitor is in a
different room.  He wants to be able to see what is on the other-room
monitor on the first monitor (monitor the monitor??).

Got the ol' hamster spinning.  My hunch that VNC could do it is
correct.  Here's the solution I just hacked out:

1. install x11vnc package (dnf install x11vnc in Fedora/RH/CentOS;
something similar in other distros).  install
tigervnc package (or any other compatible vnc client).

2. as root:
x11vnc -storepasswd
-- enter in a pw

3. as root (*might* work as normal user if the stars are aligned?):
x11vnc -many -usepw -clip xinerama1 -viewonly -scale 1/4 \
-auth /var/run/lightdm/root/:0 -display :0

4. as normal user:
vnc localhost

This will put a little 1/4 scaled copy of the 2nd monitor on your
current one.

IMPORTANT: the above -auth voodoo works only for lightdm display
manager setups like I use on XFCE.  Any other DM will need slightly
different voodoo, which you can probably divine by poking
around /var/run for dm-sounding entries.  There's probably plenty of
google hits to help you too.

Notes:
- Change xinerama1 to 0 depending on which xinerama screen is which.
  Any modern non-tweaked linux will use xinerama under the hood for any
  multi-monitor setup.  If for some reason you don't have xinerama then
  -clip lets you specify actual X,Y WxH coords instead!  Neat

- -viewonly is probably what you want, and without it I lost keyboard
  repeat and if I ventured into the vnc window with the cursor it was
  very hard to get out again as I entered some sort of recursive
  dimension effect where many have perished.

- -scale adjust to make it as big/little as you want.


Now, for the ambitious reader: figure out a way to do this with just X
(no VNC).  I'm thinking something that works like the old xmag but in
reverse and with a stationary target?  If xmag can do its magic, surely
something like this is possible.

For bonus points, figure out how you can do this in wayland.
BZZZZZZZ.  Trick question, it's almost certainly impossible (though I
could be proven wrong).  If you're using wayland (i.e. new install of
F25) then read the docs on how to switch back to X and then curse
wayland three times while spinning in circles on the spot.  Good for
the soul.

(P.S. You might want to block external port 5900 (but not loopback!)
with iptables on your box if it's world-accessible... default vnc
security stinks.)


More information about the Roundtable mailing list