2

I need to connect to a remote server with Ubuntu 18.04LTS and vino-server. After reboot, the only way I found so far to connect via VNC is by first logging in at the console. So I cannot reboot remotely and then VNC.

There are a few others having the same or related issues (see list below), but those are possibly outdated questions, since the Desktop Manager changed from lightdm to gdm. None of the answers solved the issue.

Is there currently a way to achieve this?

vino-server doesn't start automatically
"Go to Menu > Preferences > Default App... > Autostart and add the command you need (/usr/lib/vino/vino-server)." Does not work.

Desktop Sharing enabled, vino-server not listening
"I can enable vino-server by running /usr/lib/vino/vino-server and then successfully connect. I need to do this locally. Command does not work over remote SSH session."

Start vino vnc server from ssh client

Vino VNC Server unable to start on startup

How to get vino to run after autologin on a headless server - Ubuntu Server 18.04.2 LTS

This and this are related to vncserver, and I found no way to apply that to this case.

  • "I can enable vino-server by running /usr/lib/vino/vino-server and then successfully connect. I need to do this locally. Command does not work over remote SSH session." This is because as soon as you close your ssh session your server app will close too. Try adding nohup to the beginning of the command so it stays running after closing the ssh session. See: https://askubuntu.com/a/650044/231142 – Terrance Feb 28 '20 at 14:05
  • @Terrance - I simply quoted from the OP just above. Besides, I tried that, and vino-server cannot even start from a remote SSH session (I guess the OP found the same). – sancho.s ReinstateMonicaCellio Feb 28 '20 at 15:39
  • OP in that link also stated that in their answer they could not get the vino-server to work so they went with x11vnc instead. That is what I use. – Terrance Feb 28 '20 at 16:48
  • @Terrance - Ok. I will wait for alternatives with vino-server. If it doesn't work, I will se if x11vnc is an option for my team and me. – sancho.s ReinstateMonicaCellio Feb 28 '20 at 17:16
  • I followed (https://askubuntu.com/a/1012447/1137584) and it worked just fine. – 陈皓业 Oct 14 '20 at 10:44

1 Answers1

1

As a user (if you don't need all your users to have such access), you can create a .desktop file:

alexis@ubuntu:~$ cat ~/.config/autostart/systemctl.desktop
[Desktop Entry]
Type=Application
Exec=systemctl --user start vino-server
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=vino Server
Name=vino Server
Comment[en_US]=Auto-start the VNC service on boot and login back in
Comment=Auto-start the VNC service on boot

That will automatically start vino (as shown in the Exec) whenever you log in your account. You can mark your account as "auto-login" so it works 100% automatically.

I do not know that it would work with lightdm and any user who logs in. I haven't tried that.

Alexis Wilke
  • 2,707