Desktop environment for Ubuntu 14.04 server
Desktop environment for Ubuntu 14.04 server This guide will tell
you how to setup Desktop environment and a VNC server on an Ubuntu 14.04
server. The server will use a fast lightweight remote service –
TightVNC package. After this, the next tutorial will explain how to connect to the server remotely and securely through SSH tunnel.
Prerequisites
Below the line root ALL=(ALL:ALL) ALL , paste the following line:
Login to your user account that will be used to connect remotely.
Grant executable privilege:
Now make this code executable:
Some may wish to always do this manually just to save server memory. You can start the vnc service only when needed.
But if you wish to run the service automatically, the step is mentioned in the next tutorial: Remote Ubuntu Desktop Environment using VNC Client
In the next tutorial, we will explain how to connect to the server remotely and securely through SSH tunnel.
Prerequisites
- Ubuntu 14.04 Server
- Root Privilege
How to Install Desktop Environment and VNC server
First we have to get XFCE, TightVNC Packages. Do the following:In this tutorial, we will use demo as user. To add new user, do the following:sudo apt-get update sudo apt-get install xfce4 xfce4-goodies tightvncserver
Giving permission to demo user:adduser demo
Find the line # User privilege specificationvisudo
Below the line root ALL=(ALL:ALL) ALL , paste the following line:
Save the changes by pressing ctrl+o and exit ctrl+xdemo ALL=(ALL:ALL) ALL
Login to your user account that will be used to connect remotely.
Set VNC passwordsu demo
vncserver
Lets start configuring the VNC Server
Insert this code:vncserver -kill :1 mv ~/.vnc/xstartup ~/.vnc/xstartup.bak nano ~/.vnc/xstartup
Save it by pressing ctrl+o, then exit ctrl+x#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
Grant executable privilege:
Create a VNC service filesudo chmod +x ~/.vnc/xstartup
Paste the following code. If you are using different user, please change the line 3.sudo nano /etc/init.d/vncserver
Save it by pressing ctrl+o, then exit ctrl+x#!/bin/bash PATH="$PATH:/usr/bin/" export USER="demo" DISPLAY="1" DEPTH="16" GEOMETRY="1024x768" OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost" . /lib/lsb/init-functions case "$1" in start) log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" ;; stop) log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0
Now make this code executable:
Every time you restart your server, you have to run sudo service vncserver startsudo chmod +x /etc/init.d/vncserver sudo service vncserver start
Some may wish to always do this manually just to save server memory. You can start the vnc service only when needed.
But if you wish to run the service automatically, the step is mentioned in the next tutorial: Remote Ubuntu Desktop Environment using VNC Client
In the next tutorial, we will explain how to connect to the server remotely and securely through SSH tunnel.
0 comments: