VNC-Server as a virtual X11 monitor to expand screen
tl;dr: Force a "virtual" output of your gfx card to a display mode, and export that with x11vnc
.
You can achieve this, but there are a few prerequisites:
- A graphics card with multi-head capabilities (= can render several "desktop" surfaces). Which is most cards these days.
x11vnc
, a mature software (x11vnc) to export X11 surfaces (among others) to VNC clients.
Most consumer cards these days can render several different outputs. Mine can do 3, out of the 5 that xrandr
shows (eDP1,HDMI[12],DP[12]).
- Pick an unused output from xrandr, in my example
HDMI2
. Pick a resolution for the screen of the vnc client, and generate a mode:
$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
Add that mode to
xrandr
xrandr --newmode "1920x1080_60" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
Put e.g.
HDMI2
in that mode, and attach to the right ofeDP1
(Main screen)xrandr --addmode HDMI2 1920x1080_60
--output HDMI2 --mode 1920x1080_60 --right-of eDP1
Now export that with
x11vnc
, choosing the appropriate offset:x11vnc -display :0 -clip 1920x1080+1600+0
<other options>
Note: Add desired encryption/authentication/other options to that command.
Now connect to with a VNC client to your "virtual monitor". (or modify above command to connect to a "listening" VNC-client.
See this answer to be able to use VIRTUAL1 instead of a real output like HDMI2, and be able to manage it (select resolution, arrange desktop geometry, clone or extend) in the desktop environment screen settings like any other physical monitor.