Install LXDE with VNC in Debian server

As everyone knows, Linux / Unix server is used by more people as a server than Windows server because it is lighter and faster. Moreover, Linux / Unix server is mostly open source, large community, easy to customize. But for newbies, working with the command line is not an easy challenge. So in this article, I will guide you to install LXDE desktop environment and VNC.

Note 1: If you really need the GUI (interface), you can follow this article. I do not recommend installing GUI for large web servers. Once you've decided to use Linux / Unix based, you should learn to use about the command line.

Note 2: This tutorial is only for Debian OS and some Debian-based OS like Ubuntu. It works well inside an unprivileged LXC container VPS

# A little conceptual.

If you are wondering what the desktop environment is, you can simply think of it as the interface, which is what you see on the screen instead of just the command line. It makes it possible to run applications that require graphical user interfaces, or GUIs in short.

Read more about the Desktop environment at Wikipedia

VNC is a GUI sharing method for anyone to control your computer anywhere. That is, when someone has been granted access to our VNC server, the data (event) from that person's keyboard and mouse will transfer to our computer. Through that update the user interface on both sides.

Find out more at Wikipedia

# Install the LXDE desktop environment

In this section, I will show you the two most common ways to install LXDE. Before starting, you should update the system with the following command:

sudo apt update && sudo apt upgrade

1. Use Tasksel

Tasksel is a pre-written tool to help users install Desktop Environment, web server more quickly. To install Tasksel, run the following command:

sudo apt install tasksel

Next we install LXDE as follows:

sudo tasksel install lubuntu-core

2. Use APT

APT is a package management tool built into most Debian-based OS. When installing a package, run the following command:

apt install <package name>

Same as above, with LXDE we install with the following command:

apt install lxde

# Installing VNC Server

There are many vnc servers, but in this section I will install tightvncserver:

sudo apt install tightvncserver

Next, we will initialize vncserver for the first time:

vncserver

To proceed with configuring vnc server with LXDE, we need to kill the session on:

vncserver -kill: 1

Edit the VNC configuration to start the VNC Server will start the lXDE session, run the following command to edit the vnc configuration file:

nano ~/.vnc/xstartup

Edit the file to the following content:

#!/bin /bash
xrdb $HOME/.Xresources
exec startlxde &

Save the file and then restart vncserver.

vncserver

# Connecting with VNC Client

You need to have a VNC Client to connect to VNC Server. You can download the RealVNC Viewer here. Open VNC CLient to connect with the host:

<server IP> : <Port number>

The port number here is usually 5901. And here is the result:

Good luck!
Thanks @Not_Oles for helping me

Tagged:

Comments

Sign In or Register to comment.