While most servers are operated solely via the command line, that is not for everyone. Some of us are more comfortable operating a server via a nice and simple graphic interface. Thankfully you can easily install the GUI and then remotely connect to it from your own computer.
Before we begin the installation of the LXDE GUI there are a few requirements your server must meet.
1. At least 256MB of RAM. Recommended at least 512 – 1024MB.
2. Ubuntu Server installed
3. Internet Connection
Assuming you have all of these we can move on to the step of installing the required software.
First we are going to login to our server and update our repos and packages. Run the commands:
apt-get update -y apt-get upgrade -y
This will make sure all the software on our server is fully updated.
Next we will install both LXDE and the VNC server we will be using to connect to the graphical interface later in this guide. Run the command:
apt-get install dialog xorg lxde-core tightvncserver nano -y
Once the install of the software is complete, the screen will change to a GUI like interface asking you to configure the keyboard layout. It will look similar to the image below. Choose the country of origin for the keyboard layout.
Once you select the country of origin, the next step is to select the keyboard layout that you want. There are many options, I simply chose the default.
Once you select this the system will finalize the last steps of installing the software.
Configure LXDE and VNC
Now that we have installed all the required software, we have to configure it. Launch the VNC server with the command:
When you do so for the first time it will prompt you to create a password to secure your desktop. Make it a strong one.
root@test:~# tightvncserver :1
You will require a password to access your desktops. Password: Verify:
Password is a maximum of 8 characters.
Once you set this password it will prompt you for another password, a view-only password. It is better to set this, it can be the same if you choose.
Would you like to enter a view-only password (y/n)? y Password: Verify: xauth: file /root/.Xauthority does not exist New 'X' desktop is test:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/test:1.log
Great you have now setup the password for access to your server. Now we have to shutdown our VNC server so that we can configure it some more. Run the command:
tightvncserver -kill :1
Open up the configuration file in our text editor, nano.
When you open the file you will see this contents inside of it:
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & # Fix to make GNOME work export XKL_XMODMAP_DISABLE=1 /etc/X11/Xsession
Replace the contents of the file with this below:
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & # Fix to make GNOME work export XKL_XMODMAP_DISABLE=1 /etc/X11/Xsession lxterminal & /usr/bin/lxsession -s LXDE &
ctrl + o then enter to save. Once saved type
ctrl + x to exit editing the file.
Start VNC Server
Now that we have fully configured our server we can start it up. Run this command to startup the VNC server:
vncserver :1 -geometry 1280x1024 -depth 16 -pixelformat rgb565
You will use the connections of:
Your server IP and display port 1. Example chicken configuration:
Once you have entered the connection settings, hit connect and you should see your graphical interface for you to play around in. Enjoy 🙂
This work is licensed under a Creative Commons Attribution 4.0 International License.