How To Install Vnc Server On Ubuntu 18.04

Опубликовано: 07 Октябрь 2024
на канале: Explained Easy
3,837
55

How To Install Vnc Server On Ubuntu 18.04

How to Install and Configure VNC on Ubuntu 18.04


0:00:51 - Prerequisites
0:01:03 - Step 1 — Installing the Desktop Environment and VNC Server
0:04:04 - Step 2 — Configuring the VNC Server
0:07:50 - Step 3 — Connecting the VNC Desktop Securely
0:10:52 - Step 4 — Running VNC as a System Service
0:15:23 - Conclusion



The non-fully visible command:
/etc/systemd/system/[email protected]

(Unit) must be in square brackets
Description=Start TightVNC server at startup
After=syslog.target network.target
(Service) must be in square brackets
Type=forking
User=sammy
Group=sammy
WorkingDirectory=/home/sammy
PIDFile=/home/sammy/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i (sign more) /dev/null 2(sign more)&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i
ExecStop=/usr/bin/vncserver -kill :%i
(Install) must be in square brackets
WantedBy=multi-user.target


Commands:
sudo apt update
sudo apt install xfce4 xfce4-goodies
sudo apt install tightvncserver
vncserver
vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
nano ~/.vnc/xstartup
sudo chmod +x ~/.vnc/xstartup
vncserver
ssh -L 5901:127.0.0.1:5901 -C -N -l sammy your_server_ip
sudo nano /etc/systemd/system/[email protected]
sudo systemctl daemon-reload
sudo systemctl enable [email protected]
vncserver -kill :1
sudo systemctl start vncserver@1
sudo systemctl status vncserver@1
ssh -L 5901:127.0.0.1:5901 -C -N -l sammy your_server_ip