On 1/8/24 12:39, Marc Chamberlin via openSUSE Users wrote:
I feel like I am starting to get above my pay grade now, there is not a lot of helpful information about "Rect" or how to configure, encode, or work with them. It seems that only an x11vnc guru can really deal with this part of the VNC model. Is there anyone on this mail list who can tackle this problem for me and help shed some light on what is going on? A command line example(s) like a picture is worth a thousand words! Much appreciate all offers of help and suggestions.
Marc...
Alright, It's not that bad, but making friends with how to set it up and how to forward the port so you are securely accessing the remote over ssh is a bit tricky. On the server you want to connect to. It must run vncserver. The computer you connect with runs vncviewer. On Server To Connect To: You have to start vncserver the first time -- it will fail because there is no config and now user associate with your user. Just start it and let it ask you for a password and then let it crash or kill it. You will find you now have a ~/.vnc directory. In my directory (on the server hostname: 2pi that I connect to from openSUSE Leap 15.4) I have: $ l .vnc total 28 drwxr-xr-x 2 david david 4096 Mar 24 2020 . drwx------ 41 david david 4096 Jan 9 21:33 .. -rw-r--r-- 1 david david 4499 Jan 9 21:33 2pi:1.log -rw-r--r-- 1 david david 323 May 7 2019 config -rw------- 1 david david 8 May 7 2019 passwd -rwxr-xr-x 1 david david 620 May 7 2019 xstartup The .log is just that, a log. The 'config' is the vncserver config: e.g. $ cat .vnc/config ## Supported server options to pass to vncserver upon invocation can be listed ## in this file. See the following manpages for more: vncserver(1) Xvnc(1). ## Several common ones are shown below. Uncomment and modify to your liking. ## securitytypes=vncauth,tlsvnc desktop=stpdsktop geometry=1440x864 localhost alwaysshared The passwd file is just the encrypted password you typed when you started vncserver the first time and it prompted for one before crashing (delete it and it will ask again) The xstartup file tells vncserver which WM to start usually by sourcing ~/.xinitrc, just like when you type 'startx' if you don't have a DM enabled, e.g. $ cat .vnc/xstartup #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS . /home/david/.xinitrc My .xinitrc is just your normal setup for startx. I just have it start fluxbox (you can have it start any desktop you want, but icewm, fluxbox, etc.. are instantaneously available and blistering fast). You can run full Plasma if you want. It doesn't really matter since you will start the server and it will already have the desktop running before you connect to it. END OF CONFIG ON SERVER - Rest you can do on host. What you do on your box you are connecting from: It's easy. What you want to do is simply forward the X-display port from the server to a local port on your openSUSE box. You ssh into the server and then simply start vncserver from the command line (it will throw up a little dialog asking for your password). Once you start vncserver, you can then connect to the display using vncviewer. Here are the details. You will setup up port forwarding and ssh into your server all with a single short command. The X display your are forwarding (usually display :1) runs on port 5901. X display :2 runs on port 5902, ... and so on. So you are simply forwarding port 5901 from the server to any port you like on your system (I usually use 9901 for the hell-of-it). To ssh into the server and forward port 5901 to my local port 9901 all I do is: $ ssh 2pi -L 9901:localhost:5901 Which just says grab port 5901 on the server an make it 9901 here. Now since you are ssh'ed into the server, just start vncserver from the terminal you just used to ssh in and port forward. I just do: $ sudo systemctl start vncserver@:1.service That starts vncserver for display :1 on port 5901 (if you use :2, it will start display :2 on port 5902, etc..) Now just use the desktop run dialog, or another terminal to connect with vncviewer. REMEMBER you are connecting to your localhost because you already forwarded the display from the server to your box!! So all that is needed to launch vncviewer to connect to localhost port 9901 is: $ vncviewer localhost:9901 Presto! The remote desktop appears in the proper resolution you set in your ~/.vnc/config on the server, the desktop loaded through ~/.vnc/xstartup springs to life in front of you -- fully functional and blisteringly fast -- and it is all happening of a secure SSH encrypted session! Life's good :) Give it a go. You will need to adjust how you start vncserver if the remote is using an init other than systemd, but you can so the same thing with init files. Report back if you get stumped, and don't forget to look at the ~/.vnc/xxx.log file and the journal on the server if things go south. -- David C. Rankin, J.D.,P.E.