I want to use screen sharing on the login screen on Ubuntu 18


I updated the shared server in the laboratory to Ubuntu 18, but noticed that screen sharing by VNC cannot be used. After investigating, it seems that the cause is that x11vnc can no longer be used because the display manager has returned from LightDM to GDM.

The screen sharing of Ubuntu 18 uses Vino and cannot be accessed without logging in. In other words, you have to keep logged in all the time, and when you restart, you have no choice but to go to the site.


There are various solutions.

--Erase GDM and use LightDM → It's a shared server, so it's difficult to change ... --Use only x11vnc → It goes black when you log in --Use another VNC server → I tried using TigerVNC, but it didn't work. ――Do not use screen sharing in the first place → It is a little difficult to do your best just by forwarding X ――Coexistence of x11vnc and vino → It seems that you can do it anywhere ...

Coexistence of x11vnc and vino

In the end, I ended up with this. When you are on the login screen, connect to x11vnc with TCP5901, and after logging in, reconnect to vino with TCP5900.

Enable vino

Simply install vino and enable it in the GUI. If the client is mac or Windows, you need to decrypt it, so put dconf-editor in it. After opening dconf-editor, set require-encryption in org-> gnome-> desktop-> remote-access to false.

sudo apt install vino dconf-editor

If you cannot set with GUI (cannot access the desktop) ……

If you set it with the dconf command, you can set it even if you cannot access the GUI. First, check the UUID of the network connection ...

$ nmcli connection show
NAME        UUID                                  TYPE      DEVICE    
docker0     xxxxxxxxxxxxxxxxxxxxxxxxxx  bridge    docker0   
Wired connection 1 yyyyyyyyyyyyyyyyyyyyyyyyyy ethernet enp0s31f6

Specify the connection for which you want to enable vino with dconf write. Since we want to specify Ethernet this time, specify the latter UUID.

dconf write /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections "['yyyyyyyyyyyyyyyyyyyyyyyyyy']"

You can check the settings with dconf read.

$ dconf read /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections

Enable x11vnc

Next, install x11vnc.

apt-get install x11vnc

Set the password for x11vnc. If you do not specify a path, the password file is saved in /home/<user>/.vnc/passwd.

x11vnc -storepasswd

Make x11vnc go up at startup

Create x11vnc.service to handle VNC as a service. Since the 5900 port is used by vino, 5901 is used. Edit /etc/systemd/system/x11vnc.service as follows.


Description=x11vnc (Remote access)

ExecStart=/usr/bin/x11vnc -auth /run/user/<UID>/gdm/Xauthority -display :0 -rfbauth /home/<user>/.vnc/passwd -rfbport 5901 -forever -loop -noxdamage -repeat -shared


You can check <UID> with ps -auxw | grep Xauth. It is OK if you know the full path of Xauthority as shown below. In this example, it is 1001. Maybe you'll see more than one / run/user/<UID>/gdm/Xauthority, so if you can't connect, try another and it may work. (I thought it was fixed as root, but it doesn't seem to be the case)

$ ps -auxw | grep Xauth
root     19522  0.3  0.2 381404 71100 tty2     Sl+  14:17   1:41 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1001/gdm/Xauthority -background none -noreset -keeptty -verbose 3

Finally, run the following to see if the service is running.

$ sudo systemctl daemon-reload
$ sudo systemctl enable x11vnc
$ sudo systemctl start x11vnc

$ sudo systemctl status x11vnc
● x11vnc.service - x11vnc (Remote access)
   Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-05-11 18:27:11 JST; 2 weeks 3 days ago
 Main PID: 2144 (x11vnc)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/x11vnc.service
           ├─2144 /usr/bin/x11vnc -auth /run/user/1001/gdm/Xauthority -display :0 -rfbauth /home/ryorsk/.vnc/passwd -rfbport 5901 -forever -loop -noxdamage -repeat -shared
           └─2184 /usr/bin/x11vnc -auth /run/user/1001/gdm/Xauthority -display :0 -rfbauth /home/ryorsk/.vnc/passwd -rfbport 5901 -forever -loop -noxdamage -repeat -shared

After that, connect to vnc: // <addr>: 5901, log in, and reconnect to vnc: // <addr>: 5900. It's a little annoying, but I'll put up with this because it's only necessary after a reboot. By the way, the above work is completed only in the CUI environment, so it is okay if you forget to set it and throw it in the server room.


http://fx-kirin.com/ubuntu/ubuntu-vnc-server/ https://freefielder.jp/blog/2015/10/ubuntu-vnc-server-on-startup.html https://qiita.com/lin_noob/items/afadb3a8a0897e4be909#7vncx11vnc Server installation

Recommended Posts

I want to use screen sharing on the login screen on Ubuntu 18
I want to install PHP 7.2 on Ubuntu 20.04.
I want to use swipeback on a screen that uses XLPagerTabStrip
I want to use NetBeans on Mac → I can use it!
[Android Studio] I want to use Maven library on Android
I want to simplify the log output on Android
[Beginner] I want to modify the migration file-How to use rollback-
I want to use FormObject well
How to use Bio-Formats on Ubuntu 20.04
I want to use the Java 8 DateTime API slowly (now)
I want to use the sanitize method other than View.
I want to place RadioButtons in the same RadioGroup at any position on the screen.
Preparing to use electron-react-boilerplate on Ubuntu 20.4
I want to put the JDK on my Mac PC
I want to transition to the same screen in the saved state
I want to use Java Applet easily on the command line without using an IDE
Implemented a strong API for "I want to display ~~ on the screen" with simple CQRS
I want to connect SONY headphones WH-1000XM4 with LDAC on ubuntu 20.04! !!
I want to return to the previous screen with kotlin and java!
I want to add the disabled option to f.radio_button depending on the condition
I want to display background-ground-image on heroku.
I want to use DBViewer with Eclipse 2018-12! !!
How to change the timezone on Ubuntu
I want to use @Autowired in Servlet
I want you to use Enum # name () for the Key of SharedPreference
I want to output the day of the week
I want to use arrow notation in Ruby
I want to use java8 forEach with index
I want to var_dump the contents of the intent
Ssh login to the app server on heroku
When you want to use the method outside
I want to truncate after the decimal point
I want to get the value in Ruby
I want to play a GIF image on the Andorid app (Java, Kotlin)
I want you to use Scala as Better Java for the time being
[Eclipse] I want to use the completion function, but I want to manage to confirm the completion with spaces.
Screen recording on Ubuntu 20.04
Use Flutter on Ubuntu
Use mkdir on ubuntu
Use cpplapack on ubuntu
VNC connection to Ubuntu Desktop with Mac screen sharing.
I want to use Combine in UIKit as well.
I want to use Clojure's convenient functions in Kotlin
[Java] I want to calculate the difference from the date
I want to embed any TraceId in the log
[No.007] Organization management screen and login process to the organization
Import the instance and use it on another screen
I want to use fish shell in Laradock too! !!
I want to use ES2015 in Java too! → (´ ・ ω ・ `)
I want to judge the range using the monthly degree
I want to use a little icon in Rails
I want to know the answer of the rock-paper-scissors app
[Rails] I don't know how to use the model ...
I want to display the name of the poster of the comment
I want to dark mode with the SWT app
I want to call the main method using reflection
[Rough commentary] I want to marry the pluck method
I want to be aware of the contents of variables!
I want to return the scroll position of UITableView!
I want to redirect sound from Ubuntu with xrdp
I want to add a delete function to the comment function