You are not logged in.
Hi! This is my first post here. I googled, searched forum and read the rules. If I still missed something I apologize! lets get to the question:
I am looking for a way to get a "system wide" vnc*. By that I mean a vnc server setup that is available from as soon as the pc boots to the display manager, and would allow loggin in/out in different sessions from remote pc.
At the moment I am using gnome with gdm, both with xorg (wayland disabled in gdm, and using gnome x session), but I would not mind exchanging parts of that software to get this running... ![]()
I tried getting x11vnc and tigervnc to work, using arch wiki and years-old random ubuntu blogentries for simular setups, but i never got any server showing up when only gdm is running.
Is this even possible? Has anyone a working setup like this? Any hints appreciated! ![]()
* Does not actually have to be the vnc protocol. Can be vnc, rdp or anything that works.
Offline
To control the physically connected monitor and see what the user physically logged in sees? Is this what you want to achieve? If so, see the x11vnc article. I would think you can modify the display-manger service to have it started but you as root can do it on-demand from a shell like so:
sudo x11vnc -display :0Last edited by graysky (2017-06-28 00:08:17)
Offline
Exactly! I thought thats what the arch wiki was talking about when saying "x11vnc allows one to view remotely and interact with real X displays", but i guess they mean "xorg sessions connected to a real screen" instead?
As far as I understand, gdm always runs in tty1, and spawns new desktop sessions ins tty2, 3 etc. I guess its that "session switching" making things complicated?
EDIT: Sorry, missed your edit. If I just run "sudo x11vnc -display :0" I get this:
https://pastebin.com/raw/7EkQYV0R
... and x11vnc quits. Following wiki, if I try "x11vnc -display :0 -auth /run/user/120/gdm/Xauthority" as root, it starts and I actually can connect to the server, but just see a black screen on remote pc:
https://pastebin.com/raw/u4j4kmFG
EDIT 2: When using the second command and then switching to gdm i can actually see and use gdm from remote pc! but as soon as I enter a session I am back to a black screen... Tried adding "-noxdamage -many -forever -bg" as well, but no difference. Is the problem that when switching to tty2 feg., x11vnc would also need the Xauthority file of the user of that session? ![]()
Last edited by archchancellor (2017-06-28 01:40:59)
Offline
Yes, you need to run x11vnc again when your user session starts.
I didn't try with GDM/Gnome, but for my setup with SDDM and KDE/Xfce I run a first x11vnc instance for the login manager, then I have a second x11vnc started via .xinitrc for the user logging in. With Gnome you could use vino, set to autostart and accept connections instead of the second x11vnc.
Offline
copied from first link in post #3 :
** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:gdm: -auth /var/gdm/:0.Xauth
-auth /var/lib/gdm/:0.Xauth
kdm: -auth /var/lib/kdm/A:0-crWk72
-auth /var/run/xauth/A:0-crWk72
xdm: -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
dtlogin: -auth /var/dt/A:0-UgaaXaSometimes the command "ps wwwwaux | grep auth" can reveal the file location.
Starting with x11vnc 0.9.9 you can have it try to guess by using:
-auth guess
(see also the x11vnc -findauth option.)
Only root will have read permission for the file, and so x11vnc must be run
as root (or copy it). The random characters in the filenames will of course
change and the directory the cookie file resides in is system dependent.See also: http://www.karlrunge.com/x11vnc/faq.html
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks for all your input!
Yes, setting xauth (kinda) works as i wrote. After some more trying, this is where I stand:
If I run "x11vnc -display :0 -auth /run/user/120/gdm/Xauthority" and switch to gdm (ctrl + alt + f1), I can see and control gdm from remote device. But when I login to any user, the screen turns black on remote device.
If I run "x11vnc -display :1 -auth /home/*myusername*/Xauthority" and stay in gnome session, I can control this gnome session from remote. But as soon as I go to gdm (feg. over gui, switch user), I am back to black screen on remote device.
Both from root shell. I guess from here I could put something together like arshesney recommended: starting one instance of x11vnc with gdm, closing it when login on gdm was done, restart new x11vnc instance with every user/session.
But this has some downsides: you got to configure every session/user manually (not sure if even possible for users without sudo/su rights?) and you got to restart vnc connection every time you log in/out. also what happens if multiple sessions (-> multiple x11vnc instances) are running?
Is there really no way of making x11vnc (or any server really...) aware of login and switch from display 0 to display 1?
Offline
You could try the vnc module for X. Install Tigervnc, run vncpasswd as root, then create /etc/X11/xorg.conf.d/40-vnc.conf containing this:
Section "Module"
Load "vnc"
EndSection
Section "Screen"
Identifier "Default Screen"
Option "PasswordFile" "/root/.vnc/passwd"
EndSectionNow your regular X server is a VNC server. There are other ways of authentication than using PasswordFile, but I have no experience with them. I've also never used this with GDM or any other desktop manager, I use plain startx, and PasswordFile actually points to my user's /home, so no idea how well this will work for you, but it's something to play with.
Offline
Gusar: Tried that as well now, no luck yet:
https://pastebin.com/raw/CBB1N8Ki
Thats what happens when I try to connect, no matter if in gdm or gnome session. Vnc client is asking for the password, but does not connect.
Offline