Install VNC Server - TightVNC: Difference between revisions

From Embedded Workshop
Jump to navigation Jump to search
(Created page with " $ sudo apt-get update $ sudo apt-get install tightvncserver Run the following to create the password(s) for your vnc service $ vncserver Stop the service $ vncserver -ki...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
VNC: Virtual Network Computing<br>
Let's follow the directions provided by Digital Ocean:<br>
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04<br>
<br>
On your server, begin by updating your list of packages:
  $ sudo apt-get update
  $ sudo apt-get update
Install the lightweight Xfce desktop environment, along with some "goodies"
$ sudo apt-get install xfce4 xfce4-goodies
Stop and check diskspace:
ubuntu@ip-172-31-26-122:~$ df
Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/xvda1      8065444 2330024  5719036  29% /
Once the desktop environment is in place, install the TightVNC service:
  $ sudo apt-get install tightvncserver
  $ sudo apt-get install tightvncserver
Stop and check diskspace:
ubuntu@ip-172-31-26-122:~$ df
Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/xvda1      8065444 2332520  5716540  29% /


Run the following to create the password(s) for your vnc service
Run the following to create the password(s) and configuration files for your VNC service:<br>
Password must be between six and eight characters in length.<br>
Passwords longer than eight characters will be truncated.<br>
At this time, you can also create a "View Only" password.
  $ vncserver
  $ vncserver


Stop the service
We will now configure the VNC service, but first, we must stop the service:
  $ vncserver -kill :1
  $ vncserver -kill :1
We are going to be modifying the xstartup file.  Before doing that, rename the original file:
$ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak


Edit xstartup to configure and run your window manager (I'm using LXQT)
Create a new xstartup file
  $ sudo nano ~/.vnc/xstartup
  $ sudo nano ~/.vnc/xstartup


#!/bin/sh
Commands in this file are executed whenever you start or restart the VNC serice.  We need VNC to start our desktop environment if it isn't already started.  Add the following commands to the xstartup file:
xrdb $HOME/.Xresources
#!/bin/sh
xsetroot -solid grey
xrdb $HOME/.Xresources
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#xsetroot -solid grey
#x-window-manager &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# Fix to make GNOME work
#x-window-manager &
export XKL_XMODMAP_DISABLE=1
startxfce4 &
#/etc/X11/Xsession
Make sure the file has execute permission
/usr/bin/startlxqt
$ sudo chmod +x ~/.vnc/xstartup
Now, restart the VNC service:
$ vncserver
To connect a VNC client, we need to open access to port 5901 (default port number for VNC)<br>
Security Groups -> launch-wizard-1, click on "Inbound" tab
Click Edit
Click "Add Rule" in the Edit inbound rules dialog box
Custom TCP Rule, TCP, 5901, Anywhere 0.0.0.0/0,::/0 , VNC Port
 
If using the Real VNC, VNC Viewer, when entering the host name, also define the port as 5901
example:  bill.hopto.org:5901
 
Once everything appears to be working (more or less)...
Install Chromium Web Browser
$ sudo apt install -y chromium-browser

Latest revision as of 11:06, 20 March 2019

VNC: Virtual Network Computing
Let's follow the directions provided by Digital Ocean:
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04

On your server, begin by updating your list of packages:

$ sudo apt-get update

Install the lightweight Xfce desktop environment, along with some "goodies"

$ sudo apt-get install xfce4 xfce4-goodies

Stop and check diskspace:

ubuntu@ip-172-31-26-122:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/xvda1       8065444 2330024   5719036  29% /

Once the desktop environment is in place, install the TightVNC service:

$ sudo apt-get install tightvncserver

Stop and check diskspace:

ubuntu@ip-172-31-26-122:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/xvda1       8065444 2332520   5716540  29% /

Run the following to create the password(s) and configuration files for your VNC service:
Password must be between six and eight characters in length.
Passwords longer than eight characters will be truncated.
At this time, you can also create a "View Only" password.

$ vncserver

We will now configure the VNC service, but first, we must stop the service:

$ vncserver -kill :1

We are going to be modifying the xstartup file. Before doing that, rename the original file:

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

Create a new xstartup file

$ sudo nano ~/.vnc/xstartup

Commands in this file are executed whenever you start or restart the VNC serice. We need VNC to start our desktop environment if it isn't already started. Add the following commands to the xstartup file:

#!/bin/sh
xrdb $HOME/.Xresources
#xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
startxfce4 &

Make sure the file has execute permission

$ sudo chmod +x ~/.vnc/xstartup

Now, restart the VNC service:

$ vncserver

To connect a VNC client, we need to open access to port 5901 (default port number for VNC)

Security Groups -> launch-wizard-1, click on "Inbound" tab
Click Edit
Click "Add Rule" in the Edit inbound rules dialog box
Custom TCP Rule, TCP, 5901, Anywhere 0.0.0.0/0,::/0 , VNC Port

If using the Real VNC, VNC Viewer, when entering the host name, also define the port as 5901

example:  bill.hopto.org:5901

Once everything appears to be working (more or less)... Install Chromium Web Browser

$ sudo apt install -y chromium-browser