Skip to content

Instantly share code, notes, and snippets.

@CodeWire
Created August 16, 2016 06:30
Show Gist options
  • Save CodeWire/a21d0127978c28a0f795699b84809a8d to your computer and use it in GitHub Desktop.
Save CodeWire/a21d0127978c28a0f795699b84809a8d to your computer and use it in GitHub Desktop.
Installing VirtualBox on a webserver and using nvc to access it

How to install VirtualBox on a webserver and using nvc to access it

VPS Terminal Setup for vnc server

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-desktop  
sudo apt-get install vnc4server

MAC TERMINAL COMMANDS

You will need to change the you need to change user@serverip to ex. root@68.181.322.12

ssh -L 5901:127.0.0.1:5901 user@SERVERIP_ADDRESS

VPS Commands

vncserver :1

CONNECT FROM MAC REALVNC VIEWER

  1. Select localhost:1
  2. Press Continue
  3. Enter Ubuntu password

VPS Commands We Need To Run

  1. open remmina CREATE NEW REMOTE DESKTOP PROFILE
Enter name: Linode
Select protocol: VNC -Virtual Network Computing
Server: localhost:1
 Press Connect

RESTART VNCSERVER

vncserver -kill :1

EDIT STARTUP FILE IN UBUNTU

~/.vnc/xstartup
Enter 2 Edit via Nano

GO TO THE END OF THE FILE AND DELETE x-window-manager & COMMAND inside the gnome-session

SAVE AND EXIT FILE THEN START SERVER

vncserver :1

OPEN AND EDIT CRONTAB SO VNCSERVER STARTS AUTOMATICLY ON REBOOT

crontab -e

AT THE BOTTOM OF THE FILE ENTER

@reboot /usr/bin/vncserver :1

SAVE AND EXIT FILE

Reboot DigitalOcean Server

ONCE REBOOTED THEN TEST THE VNCSERVER AND IT SHOULD HAVE STARTED AUTOMATICALLY

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