How to Install VNC Server and XFCE on Debian 10

This tutorial describes how to install and configure a VNC server on Debian 10 step by step. VNC (Virtual Network Computing) is a technology to open remote computer anda manage the computer using your own keyboard and/or mouse from local just like you sit on the front of the computer. VNC using GUI just like RDP on Microsoft Windows side.

On this tutorial we’ll not covering how to install Debian from scratch, you must already have Debian installed.

Step 0 : Update System

Before installing and configuring the system, update and upgrade your system first. So we’ll get the latest version of the software available on the repository, kernel included. It’s the best practice doing this on regular basis.

apt update; apt upgrade -y

Installing VNC and XFCE

On Debian 10, both VNC and XFCE already on repository, so we’ll use that one. Debian has many desktop environment (GUI) to choose from, but for remote desktop I prefer XFCE because is a lightweight and use a little space than other desktop environment.

Install XFCE

apt install xfce4 xfce4-goodies -y

Install VNC

apt install vnc4server -y

Configuring VNC

Create New User

It’s not safe to run VNC under root, let’s create a normal user for this.

useradd atetux

when asked, type your password on the screen.

add new user linux

Setting xstartup

We’ll set the X session to use XFCE as a desktop environment. Login as atetux user or whatever user you choose from the step above, on the terminal run

su atetux

create new password for VNC

vncpasswd

use a different password for this one, dont re-use your login password above.

create vnc password

Set XFCE as default DE

Create new file ~/.vnc/xstartup add following

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /bin/sh /etc/xdg/xfce4/xinitrc

Run VNC Server

If you had this server on Internet on outside your network add parameter -localhost no, run the vnc with

vncserver -localhost no

atetux desktop 2
look at the output of command carefully, it says “localhost:2”, so we’ll use that :2 to connect to remote desktop

Connection to VNC Server

After setup the server, we’ll use the client to access VNC server. There’s a lot of varian VNC client, but I prefer using xvnc4viewer because it straight forward. If you using Windows use tightvnc or tigervnc.

I’m using Ubuntu, so I’ll use xvnc4viewer

apt install xvnc4viewer -y

on terminal run this command

vncviewer 192.168.0.1:2

change 192.168.0.1 to your public IP. When the vnc asking for password enter yang vnc password
popup authentication vnc
brand new xfce desktop environment

1 thought on “How to Install VNC Server and XFCE on Debian 10”

Leave a Comment