Ubuntu Server 24.04.1 with added desktop - cannot get VNC working....

Bo Berglund bo.berglund at gmail.com
Fri Jan 31 15:59:37 UTC 2025


Hi Again!

As I have posted in the "transplant" thread I have switched path for my new
server installation.

I installed Ubuntu Server 24.04.1 fresh and then I am working my way through all
of te used functions in the old server while keeping it as a source of
configurations and the like.


So I have continued installing all of the stuff used on the old server on this
new one and configured item-by-item as the old server. So far I am like 80% done
with Apache + Letsencrypt remaining to set up and tweaking the configs.

Since there were so many problems with my existing Lenovo computer I decided to
NOT install a Desktop Ubuntu to the side of the server just to have access to
the GParted application and manage grub.
Instead I have added a desktop to my server as described in this how-to:
https://phoenixnap.com/kb/how-to-install-a-gui-on-ubuntu

I chose to install MATE because I have it on 2 other Ubuntu laptops and am
comfortable with it:

sudo apt install lightdm ubuntu-mate-desktop

This has brought up a desktop on my server and it works fine on the HDMI
display.

VNC PROBLEM
------------
But I need it to be accessible via VNC since the server will not have a display
hooked to it when I am done. So I have selected the same as I have on a laptop
running Ubuntu but with the MATE desktop for this new server: TigerVNC Server.

I had notes from when I installed MATE on my laptop (in parallel with the
standard desktop) and when I reconfigured it so it continued to work using
TigerVNC following the dist-upgrade to 24.04.1 on the laptop.

But on this new server (ASUS NUC-13 PRO) I can for the life of me not get VNC
running, it is like there is something similar to the mosquitto problem in my
other thread, like snap is interfering.
But 'snap list' does not show vncserver so it is not the same problem.

I have compared the vncserver config files between my old laptop and the new
server and tried to make them alike but it does not help.

journalctl -u vncserver at 1

produces an overwhelmihg mass of 311 *long* lines on the screen which I cannot
paste here since the newsreader will wrap the text so it cannot be read...

For some unknown reason there are a number of red lines mentioning bluetooth,
which I have no idea why. Why is BT an issue? I am not using BT on this machine
at all...

Example (7 of these lines):
Jan 31 14:03:54 ubuntusrvnuc obexd[26404]: bluetooth: RequestProfile error:
org.bluez.Error.NotPermitted, UUID already registered


With this status request I get a lot less but still long lines:

------------------------------------------------------------------------------
$ sudo systemctl status vncserver at 1
× vncserver at 1.service - Start TigerVNC server at startup
     Loaded: loaded (/etc/systemd/system/vncserver at .service; enabled; preset:
enabled)
     Active: failed (Result: timeout) since Fri 2025-01-31 14:05:26 CET; 2h
19min ago
    Process: 25636 ExecStartPre=/usr/bin/vncserver -kill :1 &> /dev/null
(code=exited, status=255/EXCEPTION)
    Process: 25640 ExecStart=/usr/bin/vncserver -depth 24 -localhost no
-geometry 1680x1040 :1 (code=exited, status=0/SUCCESS)
        CPU: 11.950s

Jan 31 14:03:54 ubuntusrvnuc obexd[26404]: bluetooth: RequestProfile error:
org.bluez.Error.NotPermitted, UUID already registered

Jan 31 14:03:56 ubuntusrvnuc systemd[1]: vncserver at 1.service: Can't open PID
file /home/bosse/.vnc/ubuntusrvnuc:5901.pid (yet?) after start: No such file or
directory

Jan 31 14:03:56 ubuntusrvnuc pkexec[26423]: bosse: Error executing command as
another user: Not authorized [USER=root] [TTY=unknown] [CWD=/home/bosse]
[COMMAND=/usr/lib/update-notifier/package-system-locked]

Jan 31 14:03:58 ubuntusrvnuc dbus-daemon[25656]: [session uid=1000 pid=25654]
Activating service name='org.freedesktop.Notifications' requested by ':1.30'
(uid=1000 pid=26089 comm="nm-applet --indicator" label="unconfined")

Jan 31 14:03:58 ubuntusrvnuc dbus-daemon[25656]: [session uid=1000 pid=25654]
Successfully activated service 'org.freedesktop.Notifications'

Jan 31 14:05:23 ubuntusrvnuc systemd[1]: vncserver at 1.service: start operation
timed out. Terminating.

Jan 31 14:05:23 ubuntusrvnuc obexd[26404]: Terminating

Jan 31 14:05:26 ubuntusrvnuc systemd[1]: vncserver at 1.service: Failed with result
'timeout'.

Jan 31 14:05:26 ubuntusrvnuc systemd[1]: Failed to start vncserver at 1.service -
Start TigerVNC server at startup.

Jan 31 14:05:26 ubuntusrvnuc systemd[1]: vncserver at 1.service: Consumed 11.950s
CPU time.
------------------------------------------------------------------------------------

My $HOME/.vnc/xstartup looks like this:

#!/bin/sh
# Start up the standard system desktop
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/mate-session
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager

And the service file /etc/systemd/system/vncserver at .service like this:

[Unit]
Description=Start TigerVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=bosse
Group=bosse
WorkingDirectory=/home/bosse
PIDFile=/home/bosse/.vnc/%H:590%i.pid

ExecStartPre=-/usr/bin/vncserver -kill :%i &> /dev/null
ExecStart=/usr/bin/vncserver -depth 24 -localhost no -geometry 1680x1040 :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Is there something else I have to do in order to get this going???
And where do I get rid of bluetooth in relation to vnc?

It feels I am close to the end now so I don't want to give up just yet...


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list