x2vnc(1)
πΈ NAME πΈ
x2vnc β a dual-screen hack π
(that's x2vnc(1) bestie, straight out of the General Commands Manual, and yes she is exactly as chaotic as she sounds π«Ά)
π¦ SYNOPSIS π¦
x2vnc <options> <host>:<display#>
x2vnc <options> -listen [<display#>]
[ -display display ]
[ -version ]
[ -shared ]
[ -north ] [ -south ] [ -east ] [ -west ]
[ -hotkey key ]
[ -passwdfile passwd-file ]
[ -resurface ]
[ -edgewidth width ]
[ -desktop desktop-number ]
[ -timeout seconds ]
[ -wheelhack ]
[ -nowheel ]
[ -reversewheel ]
[ -scrolllines lines ]
[ -navhack ]
[ -mac ]
[ -trimsel ]
[ -noblank ]
[ -lockdelay seconds ]
[ -debug ]
[ -accel multiplier ]
[ -noreconnect ]
[ -tunnel ]
[ -via host ]
π DESCRIPTION π
okay so picture this: x2vnc lets you use two screens on two different computers like they were plugged into the same machine. one keyboard, two vibes, zero cable chaos β¨
the computer rocking the 'main' keyboard has to be running X-window, and the second computer needs a VNC server running that will update the contents on the actual screen. and here's the important part β this means Xvnc is not suitable, but WinVNC is. noted. periodt.
in listen mode (when the -listen option is specified), x2vnc will wait for a connection from a VNC server on ports 5400 and 5500 (plus the optional display# value) instead of connecting to a specified VNC server. she's not chasing, she's being chased π
for up-to-date information on x2vnc, see the x2vnc home page: http://fredrik.hubbe.net/x2vnc.html
π the options, one by one, no skips π
-displaydisplay β the X windows display to connect from. that's it, that's the whole thing.-sharedβ allow multiple connections to the same VNC server. sharing is caring fr fr π«Ά-north,-south,-east,-westβ decide which edge leads to the other screen. pick your direction bestie, she needs to know which way to yeet the cursor π§-passwdfilepassword-file β with this option you can start x2vnc without entering a password. the file is created byvncpasswdwhich comes with the X-windows VNC software. and if the file does not exist, x2vnc will ask for a password and create the file. so she makes it for you, iconic π-resurfaceβ this option will cause the trigger window to re-surface automatically if it is covered up by another window. she refuses to be buried, main character energy π-hotkeykey β this lets you pick which key warps the pointer to and from the second computer. the default is"Control-F12", and any combination of modifiers can be used, such as"shift-alt-meta-ctrl-F1"(ors-a-m-c-F1). keyboard gymnastics, slay πΉ-edgewidthpixels β a workaround for some X servers which do not allow the mouse to go all the way to the edge of the screen. by setting this to2or greater, the mouse will be able to reach the x2vnc window and thus warp to the windows machine. the default value is1. if you set this value to0, no border will be generated, which means you will have to use hotkeys to switch to the oher screen. (yes,0= no safety net, you're on your own π)-desktopdesktop-number β with this option you can make x2vnc non-sticky. this may not work with all window-managers. note that the first desktop is usually0(zero). if you want x2vnc to appear on the last (rightmost) desktop, use-1. this option was especially created with the sawfish edgeflipping in mind β normally you would use"-west -desktop 0"or"-east -destkop -1"with Sawfish to allow edgeflipping to work normally. sawfish girlies, this one's for you π-timeoutseconds β tells x2vnc how long to wait before warping the cursor back to the X screen if there is no activity. the reason for this is that some screen savers, such asxscreensaver, cannot activate while x2vnc is in control of the cursor. the default value is590seconds, which is equivalent to9minutes and50seconds. using a value of0will disable timeouts completely. let her nap π΄-nowheelβ this option does nothing and is left for backwards compatibility only. she's literally just standing there. π-wheelhackβ this will make x2vnc tranlate all mouse wheel events into arrow up/down events. only use this if your VNC server doesn't understand mouse wheel events.-reversewheelβ invert the up/down direction of the mouse wheel emulation. this option only works if-wheelhackis used. no wheelhack, no reversal, that's the deal π-scrolllineslines β when using mouse wheel emulation, this selects how many up/down events will be sent for each tick of the mouse wheel.-navhackβ this will map button6&7toAlt+Left/Right, which will allow the navigation buttons on some mice to behave more like they do in windows. muscle memory restoration arc β¨-macβ Macintosh specific mode, maps second mouse button to control-mouseclick. π-trimselβ if the X selection looks like a URL, trim leading and trailing spaces. this can be useful for pasting URLs into a browser. she's tidy, she's helpful, she ate π₯-noblankβ prevent screen blanking on the remote desktop while you are working on the local desktop. requires theMIT-SCREEN-SAVERorXIDLEextension to work properly. if neither of these extensions are present, the remote desktop will always be kept from blanking.-lockdelayseconds β this is only meaningful when using the-noblankoption. when this option is present. with this option, x2vnc will not attempt to wake up the remote screen if you have been idle for more than the specified amount of time. this is useful if you need a password to unlock the remote screen and would rather leave it blanked until you need it. let the remote screen sleep in peace π-debugβ this option will make x2vnc print out information about events it sends and receives tostderrfor debugging purposes. she's telling you everything, oversharing queen π-accelmultiplier β this lets you control the speed of the mouse on the remote screen.2.0means twice as fast,0.5means half as fast. default is1.0. note that this is multiplied with a number which x2vnc calculates based on screen sizes and other factors. zoom zoom ποΈ-noreconnectβ this prevents x2vnc from automatically reconnecting if the connection is closed. she's not running back, she's moving on π-tunnelβ this makes x2vnc start an SSH tunnel to the machine being controlled by x2vnc. the SSH command used can be changed by setting theX2VNC_SSH_CMDenvironment variable. the default is:
ssh -A -X -f -L "$LOCALPORT:$REMOTEHOST:$REMOTEPORT" \
"$GATEWAYHOST" 'ssh-add;sleep 60'
-viahost β this is similar to-tunnel, but tunnels through a host different than the machine being controlled by x2vnc. detour era π
β¨ EXAMPLES β¨
most common usage:
x2vnc -passwdfile $HOME/.vncpasswd -resurface host:0
to make x2vnc start (and re-start) automatically, add the following to your your X startup file (usually .xinitrc):
while :;
do
x2vnc -passwd $HOME/.vncpasswd -resurface host:0
sleep 2
done
yes bestie, that loop is the whole trick β it dies, it comes back, it dies, it comes back. resilience icon π«Ά
π AUTHOR π
Fredrik HΓΌbinette, hubbe@hubbe.net β the legend herself, we thank her for her service π
okay that's the whole page, no cap π
that's x2vnc(1) from the General Commands Manual, all the way down to the little x2vnc(1) sitting quietly in the footer β no extra version stamp, no date tag, just her name at the bottom like a signature. go forth and dual-screen, bestie π¦β¨π
π¦ where this page comes from
- debian trixie: x2vnc 1.7.2+git20100909.01ced3d-1 Β· GPL-2.0-or-later
- ubuntu questing: x2vnc 1.7.2+git20100909.01ced3d-2
- ubuntu resolute: x2vnc 1.7.2+git20100909.01ced3d-2build1 Β· GPL-2.0-or-later
- ubuntu stonking: x2vnc 1.7.2+git20100909.01ced3d-2build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms