└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Secure VNC Setup on Linux VPS with XFCE and Google Chrome 2 | 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. 3 | 4 | ## 1. Install Main Packages 5 | ```bash 6 | 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 -y 7 | ``` 8 | ## 2. Install XFCE Desktop Environment 9 | First, install the XFCE graphical user interface: 10 | ```bash 11 | sudo apt update && sudo apt upgrade -y 12 | sudo apt install xfce4 xfce4-goodies -y 13 | ``` 14 | 15 | ## 3. Install VNC Server 16 | Install VNC Server to allow remote access to the graphical interface of your VPS: 17 | ```bash 18 | sudo apt install tightvncserver -y 19 | 20 | # Activate clipoboard in VNC 21 | sudo apt install autocutsel 22 | ``` 23 | 24 | ## 4. Config VNC Server 25 | **1. Start VNC Server for the first time to set up a password:** 26 | ```bash 27 | vncserver 28 | ``` 29 | * This will run a VNC screen on `:1` port 30 | 31 | **2. Stop VNC Server to config it:** 32 | ```bash 33 | vncserver -kill :1 34 | ``` 35 | 36 | **3. Configure VNC to use XFCE and automatically open Terminal** 37 | 38 | Open the xstartup configuration file and edit it to start XFCE along with the Terminal: 39 | ```bash 40 | nano ~/.vnc/xstartup 41 | ``` 42 | 43 | Replace the content of the file with: 44 | ```bash 45 | #!/bin/bash 46 | xrdb $HOME/.Xresources 47 | startxfce4 & 48 | xfce4-terminal & 49 | autocutsel & 50 | -geometry 1920x1080 -depth 24 51 | ``` 52 | 53 | **4. Make the xstartup file executable:** 54 | ```bash 55 | chmod +x ~/.vnc/xstartup 56 | ``` 57 | 58 | ## 5. Start a VNC session 59 | **1. Start a VNC session on display `:1` and port `5901`** 60 | ```bash 61 | vncserver :1 -geometry 1920x1080 -depth 24 62 | ``` 63 | * If needed, you can run multiple sessions by entering `:2` or more 64 | 65 | ## 6. Connect VNC from a Windows Machine 66 | **1. Download VNC Viewer from [RealVNC](https://www.realvnc.com/en/connect/download/viewer/) and install it on your Windows machine.** 67 | 68 | **2. Open VNC Viewer and connect to `IP_VPS:5901` or `IP_VPS:1`, then enter the VNC password when prompted.** 69 | 70 | **3. Now, you should see the desktop interface of your VPS, with the Terminal automatically opened upon login.** 71 | 72 | * To copy & paste anything in the VNC xefc terminal, you can use `shift+ctrl+c` & `shift+ctrl+v` 73 | 74 | # 75 | 76 | ### Optional. Enable ports for your VNC seasons 77 | If you had problem connecting the VNC, you can try openning the ports 78 | 79 | * You might better activate your firewall for security reasons first: 80 | ```bash 81 | sudo ufw allow ssh 82 | sudo ufw enable 83 | ``` 84 | 85 | * Allow VNC connections: 86 | ```bash 87 | sudo ufw allow 5901/tcp 88 | ``` 89 | 90 | * For multiple VNC sessions, allow each port: 91 | ```bash 92 | sudo ufw allow 5901/tcp 93 | sudo ufw allow 5902/tcp 94 | ``` 95 | 96 | **Optional: To kill VNC sessions if needed** 97 | ```bash 98 | vncserver -kill :1 99 | ``` 100 | 101 | # 102 | 103 | ## 7. Install Google Chrome on the VPS 104 | **1. Open Terminal (if it hasn't automatically opened in the VNC session).** 105 | 106 | **2.Download Google Chrome:** 107 | ```bash 108 | wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 109 | ``` 110 | 111 | **3. Install Google Chrome:** 112 | ```bash 113 | sudo apt install ./google-chrome-stable_current_amd64.deb 114 | ``` 115 | 116 | If you encounter dependency errors, run: 117 | ```bash 118 | sudo apt --fix-broken install 119 | ``` 120 | 121 | **4. Launch Chrome in VNC (add --no-sandbox if necessary):** 122 | ```bash 123 | google-chrome --no-sandbox 124 | ``` 125 | 126 | --------------------------------------------------------------------------------