- Details
- Written by: Administrator
- Category: VNC
In this article, I will show you step by step how to install VNC on your Linux Debian Desktop or Server so you can remotely access it within your network.
Step 1. SSH into your Debian PC or if you have full featured Debian installed, open console on your desktop.
Step 2. Update and upgrade your system with new packages...
sudo apt update && sudo apt full-upgrade -y
Step 3. Once your system has been updated, install light desktop manager (lightdm)...
sudo apt install lightdm
Step 4. Reboot your system
sudo reboot
Step 5. Install x11VNC
sudo apt install x11vnc
Step 6. Create x11vnc.service file and Copy and paste these commands...make sure to change the password.
sudo nano /lib/systemd/system/x11vnc.service
Copy/Paste following commands in x11vnc.service file...
[Unit]
Description=x11vnc service
After=display-manager.service network.target syslog.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -forever -display :0 -auth guess -passwd YourPassword
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
[Install]
WantedBy=multi-user.target

Step 7. Save file, Ctrl + O
Exit, Ctrl + x
Step 8. Enable and start x11vnc.service using following commands...
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc.service
Step 9. Verify VNC is running and what port is being used...
sudo systemctl status x11vnc.service

Step 10. Reboot your Linux PC and try to remote in via VNC...



After entering your credentials on Debian login screen, if you receive following error message...

Install Debian Desktop Environment on your Debian PC using following commands...
sudo apt install tasksel
sudo tasksel

After installation, reboot your system...Try accessing the system again.
sudo reboot
Once you confirm everything is working correctly as expected, it's recommended to use VNC over encrypted SSH Tunnel. Especially if you are planning on accessing your PC from outside of your network. Here are the steps to configure SSH.
Step 1. Make sure you have Putty installed.
Step 2. Open putty and configure session as shown below...

Step 3. Configure SSH Tunnel in putty as shown below...

Step 4. Connect and login to your remote PC via SSH prior to connecting via VNC. Keep the SSH session open while you are using VNC.

Step 5. Remote desktop your Linux PC via VNC

Following message may appear stating that your VNC session is not secure, you can just ignore that message...

Now you have successfully configured your VNC over encrypted SSH tunnel. Cheers!
