Today, we’re stepping into the arena of remote access, specifically focusing on how to set up a VNC server on the ever-so-lovely Linux Mint. As a longtime Linux administrator, I’ve had my fair share of encounters with the ins and outs of VNC setups. It’s a complex task, but fear not – I’m here to simplify it for you with a step-by-step guide. So, buckle up, grab a cup of your preferred beverage, and let’s dive right into the world of Virtual Network Computing!
What is a VNC Server and why should you install it?
First things first, let’s familiarize ourselves with what a VNC server is. Virtual Network Computing, or VNC, allows you to create a remote graphical desktop environment on your machine that can be accessed from another device over the internet. This is especially useful when you need to access your Linux Mint machine remotely, perhaps when you’re away from your desk or traveling.
I personally love the flexibility it offers. However, setting up the VNC server on Linux Mint can be a bit of a chore. It’s not always a straightforward task and has often left me pulling my hair out. But do not despair, by the end of this guide, you’ll have a fully functioning VNC server. So, let’s get started!
Preparing your Linux Mint for VNC Server Installation
Before we dive into the installation process, we need to make sure that our Linux Mint machine is fully updated. It’s always good practice to keep your system up-to-date to ensure it runs smoothly and securely. From my experience, an outdated system can lead to unnecessary complications.
To update your system, open the Terminal and run the following commands:
sudo apt-get update
sudo apt-get upgrade
Enter your password when prompted. If there are updates available, these commands will fetch and install them. When this process is complete, your system is ready for the VNC server installation.
Installing the VNC Server
For our tutorial, we’ll be using the TigerVNC server – a high-performance, platform-neutral implementation of VNC. I’ve tried various VNC servers over the years, and I found TigerVNC to be reliable and user-friendly.
To install TigerVNC server, execute the following command in your Terminal:
sudo apt-get install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer
You will be prompted to enter your password. Once you do, the installation process will begin. In a few minutes, you’ll have TigerVNC installed on your system.
Configuring the VNC Server
Once the TigerVNC server is installed, the next step is to configure it. Begin by running the
vncserver command to set up the initial configuration and password:
This command will prompt you to enter and confirm a password for remote access. Remember to choose a strong password to secure your remote sessions. However, here’s something I don’t particularly like – the password is limited to eight characters. Any characters beyond the eighth are ignored, which is something I find slightly limiting in terms of security.
Setting Up a VNC Session
Now that the VNC server is configured, it’s time to set up a VNC session. However, before you do that, I suggest killing the existing VNC server instance. This is because the initial session runs on an undefined desktop environment. Use the following command to kill the server:
vncserver -kill :1
Here, ‘:1’ represents the display port. It could be a different number in your case. You’ll now create a new configuration file to define your session:
In this file, enter the following:
Here, we’re using the Cinnamon desktop environment, but you can replace ‘cinnamon-session’ with your preferred desktop environment command.
For GNOME, you would use the ‘gnome-session’ command. Your file would look like this:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS gnome-session &
For KDE, you would use the ‘startkde’ command. So, your file would be:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS startkde &
If you’re using the startxfce4 desktop environment, you would replace ‘cinnamon-session’ with ‘startxfce4’. Your configuration file should look like this:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS startxfce4 &
For the Pantheon desktop environment, use ‘pantheon-session’. So, your configuration file would be:
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS pantheon-session &
Press CTRL+X, then Y, and finally ENTER to save and close the file.
Next, make the file executable with the following command:
chmod +x ~/.vnc/xstartup
Starting the VNC Server
You’re now ready to start the VNC server. Run the following command:
Your VNC server is now running! If you want it to run at startup, add the command to the startup applications list.
Connecting to the VNC Server
To connect to your VNC server, you’ll need a VNC viewer. There are several free options available, such as TightVNC, RealVNC, and more. Enter the IP address of your Linux Mint machine followed by the display number, for example, ‘192.168.1.10:1’. Enter the password you defined earlier, and voila! You’re connected!
- Always keep your system up-to-date before starting any installation process.
- Be mindful of security. While setting up the VNC server, remember to set strong passwords and change them frequently.
- If you experience a slow connection, try reducing the color depth or resolution.
And there you have it! You’ve installed and set up a VNC server on your Linux Mint machine. Although it can be a bit fiddly, the flexibility and control offered by a VNC server is well worth the effort. I’ve found it to be a lifesaver on countless occasions, and I hope this guide helps you experience the same utility and satisfaction.