This guide provides step-by-step instructions for setting up a secure VNC server on a Linux VPS, installing the lightweight XFCE desktop environment, and integrating Google Chrome.
sudo apt install curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev -yFirst, install the XFCE graphical user interface:
sudo apt update && sudo apt upgrade -y
sudo apt install xfce4 xfce4-goodies -yInstall VNC Server to allow remote access to the graphical interface of your VPS:
sudo apt install tightvncserver -y
# Activate clipoboard in VNC
sudo apt install autocutsel1. Start VNC Server for the first time to set up a password:
vncserver- This will run a VNC screen on
:1port
2. Stop VNC Server to config it:
vncserver -kill :13. Configure VNC to use XFCE and automatically open Terminal
Open the xstartup configuration file and edit it to start XFCE along with the Terminal:
nano ~/.vnc/xstartupReplace the content of the file with:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
xfce4-terminal &
autocutsel &
-geometry 1920x1080 -depth 244. Make the xstartup file executable:
chmod +x ~/.vnc/xstartup1. Start a VNC session on display :1 and port 5901
vncserver :1 -geometry 1920x1080 -depth 24- If needed, you can run multiple sessions by entering
:2or more
1. Download VNC Viewer from RealVNC and install it on your Windows machine.
2. Open VNC Viewer and connect to IP_VPS:5901 or IP_VPS:1, then enter the VNC password when prompted.
3. Now, you should see the desktop interface of your VPS, with the Terminal automatically opened upon login.
- To copy & paste anything in the VNC xefc terminal, you can use
shift+ctrl+c&shift+ctrl+v
If you had problem connecting the VNC, you can try openning the ports
- You might better activate your firewall for security reasons first:
sudo ufw allow ssh
sudo ufw enable- Allow VNC connections:
sudo ufw allow 5901/tcp- For multiple VNC sessions, allow each port:
sudo ufw allow 5901/tcp
sudo ufw allow 5902/tcpOptional: To kill VNC sessions if needed
vncserver -kill :11. Open Terminal (if it hasn't automatically opened in the VNC session).
2.Download Google Chrome:
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb3. Install Google Chrome:
sudo apt install ./google-chrome-stable_current_amd64.debIf you encounter dependency errors, run:
sudo apt --fix-broken install4. Launch Chrome in VNC (add --no-sandbox if necessary):
google-chrome --no-sandbox- It has to be running in a seperate terminal than your actual work