Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact
>

Ubuntu 

[Notorious] VNC - Virtual Network Computing Guide + Linux Setup

[Image: Ep5KL3l.gif]

What is VNC?

"VNC" stands for "Virtual Network Computing", which allows users to remotely access a server and control it from another location. The VNC server transmits its keyboard, mouse and monitor information to the specified remote computer, giving the end user full control from their VNC client. VNC can be used on the majority of operating systems out there, and eventually developed to be able to control a VNC server on a Ubuntu system from a Windows computer.

[Image: Gjdmq8m.gif]

Why use VNC?

To understand why you would use VNC, you have to understand its purpose. Virtial network computing makes it possible to take control of a computer over a network connection. It allows technicials and staff in businesses to be able to troubleshoot / help customers and employees with their computers remotely, meaning they do not have to travel to the physical location of the machine. Some like to call this efficiency. You can also connect and control computers on the move on your smart phone / tablet.

[Image: Gjdmq8m.gif]

Setting VNC up on a Linux VPS

Many people don't realise that they can turn their Linux VPS into a GUI environment, meaning you don't have to be forced to use command-line only! For this setup, I am using Ubuntu 16.04. This should work on other versions too, but not tested. If you have any issues, let me know and I will help you further. Follow the below commands and you should be fine.
Code
Command one: apt-get update
Command two: apt-get install ubuntu-desktop
Command three: sudo apt-get install vnc4server

Firstly, we have updated our servers to make sure all packages and dependencies are up-to-date. Secondly we've installed a desktop environment which enables the graphical interface for the server. Thirdly, we've installed a VNC server, which we will configure next.

Firstly, we will check to make sure the GUI is working. To do this, you will want to download sofware that allows you to remotely log into your VNC server. In this example, I will be using RealVNC. [link here]

Make the VNC connection open:
Code
Command: vncserver

Open your chosen VNC software. Enter the IP address of your server, and use port 5901. Your port may be different. To verify what ports your VNC server is listening to, use the command below.
Code
Command: sudo lsof -i -P | grep -i "listen"

Output on my server:
Code
Xtightvnc  7639    cimex    3u  IPv4 12571840      0t0  TCP *:5901 (LISTEN)

Verifying connectivity:

[Image: XygkyBJ.png]

Result:

[Image: ZEM9FvM.png]

Note: if you're promted for a password, run the command below to set a new one.
Code
Command: vncpasswd

You can now log into your VNC server remotely, from anywhere... even your smart phone!

[Image: Gjdmq8m.gif]

Grey Screen Error Fix

Just making this additional section because TheChief reminded me!

(Feb 24, 2017 07:35 AM)TheChiеf Wrote:  Awesome thread with detailed explanation. I just had one small question (answer to which you should probably add to the OP, since its a common problem), how does one fix the grey screen? 🤝

Anyway if you run into this error, then you need to edit your xstartup file which can be found in: .vnc/xstartup. Make sure you're in the home directory and follow the steps below

Code
Command one: sudo cp .vnc/xstartup .vnc/startup.bak
Command two: sudo nano .vnc/xstartup

Change:
Code
x-window-manager &
to:
Code
gnome-session &

If your startup file doesn't have it, then add it. You could always try installing gnome-core and adding the above into your xstartup.
Code
sudo apt-get install gnome-core

Here is a startup config you may want to use (Without the gnome-session - you can add it if you want, though):
Code
#!/bin/sh
def
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

[Image: iZhvINu.gif]

[Image: Btc2oyr.gif]


Minimum specs for server to run VNC? How does network play a part in smooth VNC connections?
(Feb 24, 2017 06:18 AM)wander is a multi dwc Wrote:  Minimum specs for server to run VNC?


There wouldn't be a definition for a minimum server specs. It all depends what you want out of it. Putting things into logical terms, your network should already be configured to take VNC servers on if that makes sense.

There's no set answers in other words. Your answer concludes to many factors... what VNC are you running and what applications are you using too?

(Feb 24, 2017 06:18 AM)wander is a multi dwc Wrote:  How does network play a part in smooth VNC connections?

If you had a heavy load during a VNC connection, then you want to support more bandwidth to cope with the lag. Heavy application usage means more bandwidth, so you'd have to have the appropriate network to support your needs.

With all that being said, this guide was mainly for personal use, although I can see your concerns to your questions.
[Image: Btc2oyr.gif]


Awesome thread with detailed explanation. I just had one small question (answer to which you should probably add to the OP, since its a common problem), how does one fix the grey screen? 🤝

Discord: thechief1337
Telegram: thechiefhf

Kik: MarveL

(Feb 24, 2017 07:35 AM)TheChiеf Wrote:  Awesome thread with detailed explanation. I just had one small question (answer to which you should probably add to the OP, since its a common problem), how does one fix the grey screen? 🤝

Thank you. I have added something that may help.
[Image: Btc2oyr.gif]


Good work. I believe, "ssh -X ..." is a better option if actual desktop environment is not needed. It allows to run GUI applications remotely even on almost barebone systems. Also, ssh is safer and integrated.
Bookmarked it and posting to read later. Looking very good tutorial :D


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Oh_WellAug 24, 2025 03:12 PM 0 110 Aug 24, 2025 03:12 PM
Last Post: Oh_Well
by Iseenoev1lAug 10, 2024 01:00 PM 0 89 Aug 10, 2024 01:00 PM
Last Post: Iseenoev1l
by IrritiableNov 21, 2021 06:50 AM 12 412 Nov 21, 2021 06:50 AM
Last Post: Irritiable