Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Last active August 5, 2021 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Beyarz/c7419a0d0184d9b738ef114c3deea01d to your computer and use it in GitHub Desktop.
Save Beyarz/c7419a0d0184d9b738ef114c3deea01d to your computer and use it in GitHub Desktop.
Install VNC

Install VNC

Recommended utility for macOS

ServerAccess

Ubuntu

sudo apt update

Install packages

sudo apt install xfce4 xfce4-goodies
sudo apt install tightvncserver

Run vncserver

vncserver
vncpasswd
vncserver -kill :1

Backup your file

mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

Config

vi ~/.vnc/xstartup

#!/bin/bash  
xrdb $HOME/.Xresources  
startxfce4 &  

Make executable

chmod +x ~/.vnc/xstartup

Start & connect

vncserver -localhost
ssh -L 59000:localhost:5901 -C -N -l sammy your_server_ip

Connect via vnc app

vnc://localhost:59000

(Optinal) Add firewall rule

If the connection cannot be established then it's probably the firewall causing it

ufw allow from any to any port 5901 proto tcp


Creds to digitalocean

Freebsd

Install

sudo pkg install tightvnc

Run

You will be prompted to set a password vncserver

Kill

vncserver -kill :DISPLAY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment