I am curious if there was a better approach, for me to obtain a specific resolution of a remote headless workstation (running openSUSE LEAP-15.3), when displayed locally via x11vnc piped over ssh.
I currently have the desired resolution of 1280x1024, but the approach I successfully used is not what I consider ‘elegant’ nor ‘simple’ (and possibly my expectations are too high and I am limited by the specific method in which I employed vnc to access this remote PC).
The remote workstation (computer) is a very old PC with no workstation attached to its nvidia GTX-260’s two DVI ports. It is connected to my home LAN via ethernet.
I access it by opening two terminal sessions in a PC in a different room in my condominium where I live, sending:
ssh -t -L 5900:localhost;5900 oldcpu@ip-address-remote-PC 'x11vnc -localhost -nolookup -nopw -ncache 10 -noxdamage -display :0'
and then to get the remote PC displayed locally in the next terminal I send
vncviewer encodings "tight copyrect hextile" localhost:0
I am very happy with the above access method. What was difficult for me was to get the 1280x1024 resolution, as for the longest time (few hours) I could not get above a 1024x768 resolution, until finally I installed a custom /etc/X11/xorg.conf file in the remote PC.
The /etc/X11/xorg.conf file that eventually worked for me was:
Section "Device"
Identifier "VNC Device"
Driver "dummy"
VideoRam 256000
EndSection
Section "Monitor"
Identifier "VNC Monitor"
HorizSync 5.0 - 90
VertRefresh 5.0 - 90
Modeline "1280x1024_60.00" 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +Vsync
EndSection
Section "Screen"
Identifier "VNC Screen"
Device "VNC Device"
Monitor "VNC Monitor"
Subsection "Display"
Modes "1280x1024_60.00"
EndSubSection
EndSection
Yes … I could have split the above up into separate files and placed it in /etc/X11/xorg.conf.d … but it was easier to edit the one file while I was ‘hacking about’. I obtained the ‘modeline’ that I used in the ‘monitor’ section using ‘gtf’.
What is interesting to me, is if I use “nouveau” in the above instead of dummy, X fails to load (and I need to use ssh to remotely access the PC and from command line edit or remove the xorg.conf file). I also had to specify a VideoRam amount, else the dummy would not go for a higher resolution. So I simply picked 256,000 (which is 256,000 KBytes) out of thin air (ie arbitrary selection). By default, without that VideoRam entry, X was only assigning around 4 MBytes for video RAM (and refusing to provide higher resolutions).
If instead I simplify the xorg.conf (or if I do not use an xorg.conf file at all) I can use nouveau in the Xorg.conf, although the resolution is only 1024x768. If I look in the /var/log/Xorg.0.log file with the nouveau driver specified (or no driver specified), I can see an entry noting no monitors detected and hence a fall back to 1024x768 resolution.
What is also puzzling, is according to inxi -F, the nouveau driver is running:
System: Host: oldcorei7 Kernel: 5.3.18-59.10-default x86_64 bits: 64 Desktop: KDE Plasma 5.18.6 Distro: openSUSE Leap 15.3
Machine: Type: Desktop Mobo: ASUSTeK model: P6T DELUXE V2 v: Rev 1.xx serial: <superuser/root required>
BIOS: American Megatrends v: 1108 date: 09/21/2010
CPU: Topology: Quad Core model: Intel Core i7 920 bits: 64 type: MT MCP L2 cache: 8192 KiB
Speed: 1604 MHz min/max: 1600/2668 MHz Core speeds (MHz): 1: 1604 2: 1604 3: 1606 4: 1609 5: 1604 6: 1603 7: 1604
8: 1604
Graphics: Device-1: NVIDIA GT200 [GeForce GTX 260] driver: nouveau v: kernel
Display: x11 server: X.Org 1.20.3 driver: nouveau note: display driver n/a resolution: 1280x1024~60Hz
OpenGL: renderer: llvmpipe (LLVM 11.0.1 128 bits) v: 4.5 Mesa 20.2.4
Interestingly is the Xorg.0.log file indicates “DUMMY” instead of “NOUVEAU” … ie:
34.764] (II) DUMMY(0): Modeline "1280x1024_60.00"x60.0 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -hsync +vsync (63.6 kHz z)
34.764] (**) DUMMY(0): Default mode "1280x1024": 135.0 MHz, 80.0 kHz, 75.0 Hz
34.764] (II) DUMMY(0): Modeline "1280x1024"x75.0 135.00 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync (80.0 kHz d)
34.764] (**) DUMMY(0): Default mode "1280x1024": 108.0 MHz, 64.0 kHz, 60.0 Hz
34.764] (II) DUMMY(0): Modeline "1280x1024"x60.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync (64.0 kHz d)
.... etc ...
another observation (which possibly is harmless (?) < unsure > is an error in xrandr about 'size of gamma) ':
oldcpu@oldcorei7:/var/log> xrandr
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 320 x 175, current 1280 x 1024, maximum 1280 x 1024
default connected primary 1280x1024+0+0 0mm x 0mm
1280x1024 60.00* 75.00
1280x960 85.00 60.00
.... deleted remainder
Obviously this is a subject matter I do not know much about.
So I don’t need forum support to get the resolution that I want : 1280x1024 over vnc. I have 1280x1024 now.
But I am curious if there was a better way? Was this an unnecessary kludge on my part? I suspect so < unsure >
.