VNC-Server as a virtual X11 monitor to expand screen

From a currently running X11 session, I would like to provide/run a VNC server such that it appears to my system as a second, “virtual” monitor – i.e. so that I can position it using xrandr and drag/position windows onto it.

How, if at all, could I achieve that?

Edit: More info from OP in comments: “Also asked here, without an answer. “

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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 () 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 , 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 of eDP1 (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.

Method 2

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.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x