You are not logged in.

#1 2025-04-03 01:47:42

sokol99
Member
Registered: 2021-09-25
Posts: 38

[SOLVED] Accessing local display via Tigervnc

Hi. I'm trying to set up tigervnc so I can remotely access the physical screen not matter who is (or isn't) logged in. .. I have tried getting vnc installed on this machine many times but just can't quite get it right.

Tried following the guide here TigerVNC. Step 3: Expose the local display directly.

I created the file: /etc/X11/xorg.conf.d/10-vnc.conf and also moved passwd file to /home/.vnc/ as directed.

Xorg logs show that it attempts to launch the vnc but I've not been able to confirm whether it is actually running.  I expected more in the logs than I get:

[  2755.569] (II) LoadModule: "vnc"
[  2755.569] (II) Loading /usr/lib/xorg/modules/extensions/libvnc.so
[  2755.617] (II) Module vnc: vendor="TigerVNC project"
[  2755.986] (II) Initializing extension VNC

When I attempt to launch manually I get this.

0vncserver -display :0 -rfbauth /home/user/.vnc/passwd -rfbport 5900
Authorization required, but no authorization protocol specified
x0vncserver: Unable to open display ":0"

My Xauth file has entries for other displays but not for :0.  Nor can I create an entry for :0 via xauth generate. 

So I'm stuck. I don't know exactly when this entry should be getting generated on its own but it obviously is not happening.  ... I've been stuck on this service for a long time but am determined now to figure it out. 

Any wisdom? Thank you!

Last edited by sokol99 (2025-04-06 06:37:30)

Offline

#2 2025-04-03 20:55:53

seth
Member
Registered: 2012-09-03
Posts: 62,570

Re: [SOLVED] Accessing local display via Tigervnc

My Xauth file has entries for other displays but not for :0.  Nor can I create an entry for :0 via xauth generate.

xdpyinfo | head

Offline

#3 2025-04-04 02:14:02

sokol99
Member
Registered: 2021-09-25
Posts: 38

Re: [SOLVED] Accessing local display via Tigervnc

Thank you!

Here's what I have:

xdpyinfo | head
name of display:    :0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    12101016
X.Org version: 21.1.16
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7

Offline

#4 2025-04-04 07:00:47

seth
Member
Registered: 2012-09-03
Posts: 62,570

Re: [SOLVED] Accessing local display via Tigervnc

echo $XAUTHORITY
xauth info
xauth list | cut -d " " -f-4
hostnamectl
loginctl session-status | head -n16

Offline

#5 2025-04-04 15:37:50

sokol99
Member
Registered: 2021-09-25
Posts: 38

Re: [SOLVED] Accessing local display via Tigervnc

Here you go!

echo $XAUTHORITY


Comment: I have manually set the $XAUTHORITY before without impact but I suppose this should be getting set automatically correct?

xauth info

Authority file:       /home/user/.Xauthority
File new:             no
File locked:          no
Number of entries:    6
Changes honored:      yes
Changes made:         no
Current input:        (argv):1

xauth list | cut -d " " -f-4

hero:2  MIT-MAGIC-COOKIE-1 
hero:2  MIT-MAGIC-COOKIE-1 
hero/unix:2  MIT-MAGIC-COOKIE-1 
hero:1  MIT-MAGIC-COOKIE-1 
hero:1  MIT-MAGIC-COOKIE-1 
hero/unix:0  MIT-MAGIC-COOKIE-1 

Comment: This is the first time I have seen :0.  But my user  has logged into the physical display whereas before I was only at the login screen with lightdm.  I want to be able to access that screen so I can transition between users as needed.  Shall I send this data while I am at the login screen then?

hostnamectl

Static hostname: hero
Icon name: computer-desktop
Chassis: desktop ?️
Machine ID: 0dcf8b3336c94038afcf999192cdadec
Boot ID: 854a827a500d4644a85bea3a0b0660e5
Operating System: Arch Linux                                      
Kernel: Linux 6.13.8-arch1-1
Architecture: x86-64
Hardware Vendor: CHUWI Innovation And Technology_ShenZhen_co.,Ltd
Hardware Model: HeroBox
Firmware Version: GB3B 1.02
Firmware Date: Fri 2021-10-29
Firmware Age: 3y 5month 5d   

loginctl session-status | head -n16

15 - user (1000)
  Since: Fri 2025-04-04 09:25:52 MDT; 7min ago
  State: active
 Leader: 18780 (sshd-session)
    TTY: pts/0
 Remote: 104.218.158.189
Service: sshd
   Type: tty
  Class: user
   Idle: no
   Unit: session-15.scope
         ├─18780 "sshd-session: user [priv]"
         ├─18786 "sshd-session: user@pts/0"
         ├─18787 -bash
         ├─18923 loginctl session-status
         └─18924 head -n16

Thank you!

Offline

#6 2025-04-04 21:10:07

seth
Member
Registered: 2012-09-03
Posts: 62,570

Re: [SOLVED] Accessing local display via Tigervnc

before I was only at the login screen with lightdm.  I want to be able to access that screen so I can transition between users as needed

At this point the xauthority will be held by the "lightdm" user, you'd have to start 0vncserver as that or pass the xauthority file, https://wiki.archlinux.org/title/X11vnc#LightDM (idk whether the location there is correct, but you'll have to export XAUTHORITY since 0vncserver doesn't seem to have a parameter for this)

But once you start a session the authority will be transferred to that user - idk whether the vnc session can track that, in doubt you'll have to use https://man.archlinux.org/man/extra/xor … xhost.1.en to open the server (for specific users)

Offline

#7 2025-04-05 01:30:42

sokol99
Member
Registered: 2021-09-25
Posts: 38

Re: [SOLVED] Accessing local display via Tigervnc

Thanks @seth

So that makes me wonder how my situation differs from the assumption in the TigerVNC documentation, Section 3?  Perhaps the assumption is that no display manager is being used?

Since that (the vnc module launch) is to be run when xorg is launched and was using the root passwd file I had thought it was applicable to more than one user..

Like I mentioned above I cannot tell whether the module launch succeeds.  And now I'm not certain it would be solution I want even if did...

I was hoping to keep it simple with one service with 'root' access to the display at all times.. Any other suggestions?

VNCTiger on my Windows box runs that way out of the box so I can log in via my VNC connection.. But different models I know..

Thanks again.

Offline

#8 2025-04-05 06:51:45

seth
Member
Registered: 2012-09-03
Posts: 62,570

Re: [SOLVED] Accessing local display via Tigervnc

Technically

The wiki wrote:

tigervnc also provides x0vncserver(1) which allows direct control over a physical X session.

I had thought it was applicable to more than one user..

You're forwarding the server, the problem is that the access rights to the server will shift and (in your case) at no point are that of the root user (since lightdm is run by the lightdm user and you're of course not logging into GUI sessions as root either)

First try whether you can forward the server (during lightdm) using the lightdm xauthority, then see what happens on login.
If it fails, test whether "xhost +" can help with that.

Whether this is the "solution you want" depends on what you want and the context/security considerations.
Forwarding the DM implies you're granting remote access to different users, but you probably don't want remote user A to snoop around in user B's session so at some point the (remote) access has to be constrained?

Offline

#9 2025-04-06 06:36:44

sokol99
Member
Registered: 2021-09-25
Posts: 38

Re: [SOLVED] Accessing local display via Tigervnc

Thank you @seth.

I was able to get what I wanted by instead following the guide for using a system service in section 4.2.1. 

I can now see the login screen and switch between users. I disconnects when I log off from one user when switching which is fine.  One must remember not to 'switch users' vs "log off" or you get stuck in a black screen until you restart lightdm / service.

I did try to go down a path with the module loading method and trying to use the lightdm user but I was having issues authenticating and found this other solution (again). 

Also re-learned a basic lesson with vinagre:  You must use host: "localhost:5900" when sshing in as the "Use host" selection...  .. smile

Thanks for your help!

Offline

Board footer

Powered by FluxBB