4

I tried to follow this To create a virtual screen on my display so I can show it on a remote monitor with a vnc client

but when I try to add my mode xrandr --addmode VIRTUAL1 xrandr will tell me I don't have such output

here is my current output for xrandr -q

Screen 0: minimum 8 x 8, current 4224 x 1080, maximum 16384 x 16384                                               
VGA-0 connected 1024x768+0+312 (normal left inverted right x axis y axis) 304mm x 228mm                           
   1024x768      60.00*+  75.03    70.07                                                                          
   800x600       75.00    72.19    60.32    56.25                                                                 
   640x480       75.00    72.81    59.94                                                                          
   640x350       70.07                                                                                            
DVI-D-0 connected 1280x1024+2944+56 (normal left inverted right x axis y axis) 376mm x 301mm                      
   1280x1024     60.02*+                                                                                          
   1024x768      75.03    75.03    70.07    60.00                                                                 
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
HDMI-0 connected primary 1920x1080+1024+0 (normal left inverted right x axis y axis) 531mm x 298mm
   1920x1080     60.00*+  59.94    50.00    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93 

after a bit of reading I couldn't find any way to create a virtual output for my virtual desktop expanded screen.

how can I add a new "virtual screen" so I can stream it with vnc to a remote monitor?

I was able to create a new display and connect to it with vnc but I can't extend this display to the one im already using

  • My AA from the Q you linked to contains the step "Pick an unused output from xrandr". You have no unused output/"rendering_surface". → Your question now really is "How can I (hot-)add a virtual gfx card with 1+ screens, that I can add/position_relative to my current desktop with xrandr?" – Alex Stragies May 17 '17 at 17:39
6

Using Fedora 26, I faced the same issue with VIRTUAL1 not being shown by xrandr command.

Then I followed this instructions , to reuse an empty output, like HDMI-2, and it worked quite well, but:

  • Gnome (and xrandr) does not recognize the empty output as connected, and does not show the virtual monitor to arrange position in extended desktop or clone. Every time a new physical monitor is connected in other output, it has a high probability to break.

  • worse part is that as gnome-shell (and mutter underneath) do not consider the new virtual monitor as part of the viewable area in composite framebuffer, it's not properly repainted, and windows tearing when moved, leaving a permanent animated trail behind them, even after closing the window, even after restarting x11vnc, they are still there.

Then I followed the guide in this link, and after a short trial and error with dummy driver, I found that it's not required and it's enough to add the "intel" driver info to a file under /etc/X11/xorg.conf.d directory to activate the VIRTUAL1 and VIRTUAL2 outputs, and make gnome-shell recognize them as valid outputs. (I also noticed output names changed slightly, e.g. from "eDP-1" to "eDP1") Additionally I added the option "TearLess" set to true, to have the driver repainting when composite manager does not.

~# vi /etc/X11/xorg.conf.d/01-dummy-monitor.conf
Section "Device"
        Identifier      "Configured Video Device"
    Driver "intel"         #CHANGE THIS
    Option "TearLess"   "1"
EndSection

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection

After restarting GDM session choosing "Gnome on Xorg" option in drop down login list, the recommended xrandr commands can be executed over VIRTUAL1 output, and x11vnc can be attached to it easily. Then VIRTUAL1 output can be managed within Gnome screen settings: change resolution, move to arrange desktop monitors geometry, select clone or extend. And everything will work while x11vnc is running and your favourite VNC viewer is connected.

Define modes for your devices screen resolution and attach them to VIRTUAL1 output:

## For Samsung Galaxy Tab 10.1
~$ cvt 1280 752
# 1280x752 59.83 Hz (CVT) hsync: 46.72 kHz; pclk: 77.75 MHz
Modeline "1280x752_60.00"   77.75  1280 1344 1472 1664  752 755 765 781 -hsync +vsync
~$ xrandr --newmode "1280x752_60.00"   77.75  1280 1344 1472 1664  752 755 765 781 -hsync +vsync
~$ xrandr --addmode VIRTUAL1 1280x752_60.00

## For monitor HD 1920x1080
~$ 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
~$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
~$ xrandr --addmode VIRTUAL1 1920x1080_60.00

Result is visible in xrandr and Gnome screen settings:

~$ xrandr
Screen 0: minimum 8 x 8, current 3200 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
   1920x1080     60.00*+
   1400x1050     59.98
   1600x900      60.00
   1280x1024     60.02
   1280x960      60.00
   1368x768      60.00
   1280x720      60.00
   1024x768      60.00
   1024x576      60.00
   960x540       60.00
   800x600       60.32    56.25
   864x486       60.00
   640x480       59.94
   720x405       60.00
   640x360       60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP2-1 disconnected (normal left inverted right x axis y axis)
DP2-2 disconnected (normal left inverted right x axis y axis)
DP2-3 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 connected 1280x752+1920+330 (normal left inverted right x axis y axis) 0mm x 0mm
   1280x752_60.00  59.83*
   1920x1080_60.00  59.96
VIRTUAL2 disconnected (normal left inverted right x axis y axis)

Now you can easily attach x11vnc to the virtual monitor:

  • if you use VNC password:

    ~$ x11vnc -display :0 -clip xinerama1 -usepw -xrandr -forever -nonc -noxdamage -repeat

  • if you want to use GDM/XDM authentication:

    ~$ x11vnc -display :0 -clip xinerama1 -xauth /var/lib/gdb/:0.Xauth -xrandr -forever -nonc -noxdamage -repeat

Connect from your VNC client, and enjoy your new monitor!!

  • And what if after I create 01-dummy-monitor.conf the VIRTUAL output still does not appear? – Zhigalin Oct 13 '17 at 18:43
  • 1
    On Ubuntu 18.04, I have used /usr/share/X11/xorg.conf.d/01-dummy-monitor.conf instead. – Bora M. Alper Apr 21 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.