- Set VNC password:
sudo x11vnc -storepasswd [YOUR VNC PASSWORD] /etc/x11vnc.passwd
- Install Systemd Unit File
sudo cp [path to]/vnc.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vnc.service
[Unit] | |
Description=VNC Server | |
After=multi-user.target network.target | |
[Service] | |
Restart=always | |
# Replace this with x0vncserver from TigerVNC in Ubuntu 18.04. | |
# Set password by running `sudo x11vnc -storepasswd [PASSWORD] /etc/x11vnc.passwd` | |
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.passwd -rfbport 5900 -shared | |
[Install] | |
WantedBy=multi-user.target |
@grayguest where would the vnc.service be located?
@grayguest vnc.service将位于哪里?
/etc/systemd/system/
Hello, I have a question about this systemd unit file.
From a client's terminal I run this command to connect to a server:
ssh -tL 5900:localhost:5900 DESKTOP_IP 'sudo x11vnc -usepw -auth guess -localhost -display :0'
This allows me to view the server with a vncviewer, both when this systemd unit file is active or not.
Is there anything wrong with my practice? It seems like for security, we should use an SSH connection, and since we send x11vnc -usepw ...
command to the server, it does not make a difference whether this unit file is active or not.
I can also connect to the server with that ssh
command on boot (the server boots up to a lightdm login and there is xfce4 as DM). This is my first time establishing a nicely working x11vnc server between my laptop and desktop, but I am still not sure how I did it...
@grayguest where would the vnc.service be located?
/lib/systemd/system/
also ok
thank you