11

I'd like to remote access a desktop of a specfic user and not a root desktop; however when I run the vncserver it always produces a rooted desktop.

This could be related to the installation of tigervnc. The .vnc and .xauthority directories are found in /root directory.

How can I change this so that I can run vncserver at :1 and produce a specific user desktop?

I also tried using the vncserver -u username command but it will not let me access the .vnc files.

I think that tigervnc has to be removed and installed in the right locations?

Thushi
  • 9,498

5 Answers5

4

Just struggled with this problem for some days and managed to solve it using:

  1. Log out and make sure no other user logged-in
  2. Log in again as user using TERMINAL, do not use gdm/xdm or graphical manager to login
  3. Start vncserver in terminal
  4. In terminal issue startx

What I guess that is happening is that systemd starts the X server and it is run under root user. When somebody login it probably opens a new process and uses setuid syscall to set all permissions to the uid that has just logged in. This probably blocks vncserver from getting data from X server for the same user afterwards.

Maybe some kind of systemd configuration or permission changing in filesystem will resolve it as well...

1

you try https://wiki.ubuntu.com/xdmcp it has Multi-user mode https://wiki.archlinux.org/index.php/TigerVNC#Multi-user_mode plan to try this myself in that it may work around the vnc debian grey screen / :( issue better than the mate/lxde installation fix.

have you tried xdmcp remote desktop - it has multi-user mode - it may solve your multi-user issue and other issues encountered with vnc and debian.... per jasonwryan 'essential parts' without links - edit

alex
  • 17
  • 5
0

1.Run the vnc servers as root 2.Copy /root/.vnc/xstartup to /home/user/.vnc ( create .vnc if not already created) 3.login to user 4.start vncserver( # vncserver -geometry 1024x768 -depth 16 -name remote-desktop :1)
5.vncpasswd for setting vnc password
6.try to login through vnc viewer

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
0

You can do the following:

  1. Login to target linux user (user that you want to connect with vnc) via ssh (ex: TARGETUSER).

    [root@localhost ~]$ su - TARGETUSER

  2. Run following command to change vnc password.

    [TARGETUSER@localhost ~]$ vncpasswd

  3. Start vnc server from within target user to create new session for current user.

    [TARGETUSER@localhost ~]$ vncserver

  4. Previous command will be created a new session with a number after existing sessions (in this example: 1).

    New 'localhost.localdomain:1 (TARGETUSER)' desktop is localhost.localdomain:1

  5. Connect to it via VNC Viewer (ex:SERVER_IP:1) with above created password.

0

after running (vncserver) in the user terminal and opening a session,

if you connect as root user to serverIp:5901 connect using the normal user to serverIp:5902