Score:2

Ubuntu 20.04 Gnome VNC problem

gq flag

I use tigervnc server, gnome, on ubuntu 20.04. The problem is, if I lock the screen from VNC viewer then I will never able to login again from VNC. I still can type the password, but even if I hit enter it does not login. However, if I start vnc server with: vncserver command, then the problem does not occur.

~/.vnc/xstartup

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

/etc/vnc/xstartup

# !/bin/sh

test x"$SHELL" = x"" && SHELL=/bin/bash
test x"$1"     = x"" && set -- default

vncconfig -iconic &
"$SHELL" -l <<EOF
export XDG_SESSION_TYPE=x11
dbus-launch --exit-with-session gnome-session
exec /etc/X11/Xsession "$@"
EOF
vncserver -kill $DISPLAY

/etc/systemd/system/vncserver@.service

[Unit]
Description=Start TigerVNC server at startup
After=syslog.target network.target

[Service]
Type=simple
User=john
PAMName=login
PIDFile=/home/john/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -fg -depth 24 -geometry 1280x1024 -localhost no :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target 
frankfalse avatar
pg flag
Try to remove `ExecStop=/usr/bin/vncserver -kill :%i` from the unit file `vncserver@.service`
Tivi avatar
gq flag
I tried, but did not help unfortunately.
frankfalse avatar
pg flag
In my system I'm using x0vncserver which is installable by `sudo apt-get install tigervnc-scraping-server`. To start it at boot I have decided to create a bash script and launch it by Autostart of the desktop manager (see Preferences--> Autostart and so on) but I don't know if you can install this VNC server in your system. I'm using lubuntu 22.04
Tivi avatar
gq flag
Do you use it with gnome? Can you share your config with me? That would be a big help. Thanks!
petep avatar
in flag
try "loginctl unlock-sessions"
Tivi avatar
gq flag
@petep "loginctl unlock-sessions" doesn't work.
Score:0
pg flag

Installation of x0vncserver

On lubuntu 22.04 I have installed x0vncserver by the command:

sudo apt-get install tigervnc-scraping-server

May be it is better that you remove your current VNC server.

After the installation I have executed the following steps:

> mkdir -p ~/.vnc

> vncpasswd
# insert the VNC password (not create a password for only Viewer 
# connection when the command ask you)

Creation of the x0vncserver starting script

Create the following script /usr/local/bin/start-x0vncserver.sh:

#!/bin/bash

export XAUTHORITY="/var/run/lightdm/root/:0"

VNC_BIN=/usr/bin/x0vncserver

PARAMS="-localhost no -passwordfile ~/.vnc/passwd -display :0"

($VNC_BIN $PARAMS)

exit 0

Previous script enable VNC Client to connect to the display:0 (see the parameter -display :0 for the VNC server x0vncserver).

This script must be executable so execute:

> sudo chmod +x /usr/local/bin/start-x0vncserver.sh

Enable the autostart of VNC Server

After that you have to enable the execution of the script /usr/local/bin/start-x0vncserver.sh at boot by the Autostart of Ubuntu. On lubuntu 22.04 I have used the menu Preference->LXQT Settings->Session Settings->Autostart (from Start button).

On your Ubuntu distribution I don't know exactly where you can find the option for Autostart but I'm sure is under the Preferences menu of the Start button.

Tivi avatar
gq flag
x0vncserver seems fine, but unfortunately it acts differently from TigerVNC. Unlike TigerVNC, it does not create a virtual display. Instead, it just shares an existing X server (typically, that one connected to the physical screen). I would like to create a virtual display for each VNC client.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.