Server-tutorials.net
  • Home
  • CentOS
    • All
    • Game Hosting
    • Hosting Control Panel
    How to Install Laravel on CentOS 8 Linux Server

    How to Install Laravel on CentOS 8 Linux Server

    How to Host a Minecraft Server on a CentOS 8 Server

    How to Host a Minecraft Server on a CentOS 8 Server

    How to Install and Configure an Email Server on CentOS 8 (dovecot,postfix,mariadb,roundcube)

    How to Install and Configure an Email Server on CentOS 8 (dovecot,postfix,mariadb,roundcube)

    How To Set Up a Firewall Using FirewallD on CentOS 7

    How To Set Up a Firewall Using FirewallD on CentOS 7

    How to Install VestaCP on CentOS 7: A Comprehensive Guide

    How to Install VestaCP on CentOS 7: A Comprehensive Guide

    engineer holding laptop

    How to Install cPanel on CentOS 8: A Comprehensive Guide

    close up photo of ethernet cables on network switch

    Setup a Firewall Using FirewallD on CentOS 7

    security logo

    Installing and Configuring a Firewall on CentOS 8 Server

    Step-by-Step Guide how to Install Elgg on Debian 12

    Setp-by-Setp Guide how to Install Elgg on CentOS 7

    Step-by-Step Guide: How to Install Elasticsearch 8 on Debian 11

    Installing Elasticsearch on CentOS 7

    Custom installation VestaCP on Debian/Ubuntu (Nginx,Apache2)

    How to install VestaCP on CentOS

    Trending Tags

    • centos
  • Debian
    • All
    • Game Hosting
    • Hosting Control Panel
    How to Install and Configure an Email Server on Debian 11 (Postfix, Dovecot, and Roundcube)

    How to Install and Configure an Email Server on Debian 11 (Postfix, Dovecot, and Roundcube)

    How to Install LEMP Stack on Debian 11 Server

    How to Install LEMP Stack on Debian 11 Server

    How to Identify and Remediate Security Breaches or Malware on Your Debian 12 Server

    How to Identify and Remediate Security Breaches or Malware on Your Debian 12 Server

    Upgrading ISPConfig from Debian 11 to Debian 12

    Upgrading ISPConfig from Debian 11 to Debian 12

    How to Downgrade PHP Version on Debian 11: A Step-by-Step Guide

    How to Downgrade PHP Version on Debian 11: A Step-by-Step Guide

    How to Host an OpenRA Game Server on Debian 12

    How to Host an OpenRA Game Server on Debian 12

    How to Install WireGuard VPN on Debian 12: A Step-by-Step Guide

    How to Install WireGuard VPN on Debian 12: A Step-by-Step Guide

    black headphones on black laptop computer

    How to Host a Counter-Strike: Global Offensive Game Server on Debian 12

    close up photo of ethernet cables on network switch

    How to Create a User for ProFTPD Server on Debian 12

    close up photo of mining rig

    Debian 12 (Bookworm) Setup with Apache, BIND, Dovecot, PureFTPD, and ISPConfig 3.2

    wooden robot

    How to Host a Minecraft Server on Debian 12: A Step-by-Step Guide

    modern computer placed near server racks

    Installing and Configuring a Firewall on Debian 12 Server

    black server racks

    A Comprehensive Guide to Backing Up a Debian 12 Server

    data codes through eyeglasses

    How to Install OpenVPN on Debian 12 Server: A Step-by-Step Guide

    close up photo of plugged cables

    Setting Up a Secure FTP Server on Debian 12

    Installing PostgreSQL 15 on Debian 11 Step-by-Step Tutorial

    Installing PostgreSQL 15 on Debian 11 Step-by-Step Tutorial

    Installing Tomcat 10 on Debian 11: Step-by-Step Guide

    Installing Tomcat 10 on Debian 11: Step-by-Step Guide

    Step-by-Step Guide how to Install Elgg on Debian 12

    Step-by-Step Guide how to Install Elgg on Debian 12

    Step-by-Step Guide: How to Install Elasticsearch 8 on Debian 11

    Step-by-Step Guide: How to Install Elasticsearch 8 on Debian 11

    Installing Laravel on Ubuntu 22.04 / Ubuntu 20.04: A Step-by-Step Guide

    Installing Laravel on Ubuntu 22.04 / Ubuntu 20.04: A Step-by-Step Guide

    Trending Tags

    • debian
    • debian 10
  • Ubuntu
    • All
    • Game Hosting
    • Hosting Control Panel
    • Network Monitoring
    How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

    How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

    Securing Nginx with Let’s Encrypt on Ubuntu 22.04: A Step-by-Step Guide

    Securing Nginx with Let’s Encrypt on Ubuntu 22.04: A Step-by-Step Guide

    How to install Counter-Strike: Global Offensive CSGO on Ubuntu 22.04 Server

    How to install Counter-Strike: Global Offensive CSGO on Ubuntu 22.04 Server

    Step-by-Step Guide: Installing Terraform on Ubuntu Server 22.04

    Step-by-Step Guide: Installing Terraform on Ubuntu Server 22.04

    How to Deploy a Secure CockroachDB Cluster on Ubuntu 22.04

    How to Deploy a Secure CockroachDB Cluster on Ubuntu 22.04

    How to Downgrade PHP Version on Ubuntu 22.04: A Step-by-Step Guide

    How to Downgrade PHP Version on Ubuntu 22.04: A Step-by-Step Guide

    How to Install and Configure an Email Server on Ubuntu 22.04 (Postfix, Dovecot, and Roundcube)

    How to Install and Configure an Email Server on Ubuntu 22.04 (Postfix, Dovecot, and Roundcube)

    How to Install Zabbix Monitoring Tool on Ubuntu 22.04

    How to Install Zabbix Monitoring Tool on Ubuntu 22.04

    How to Install Apache Guacamole via Docker on Ubuntu 22.04

    How to Install Apache Guacamole via Docker on Ubuntu 22.04

    How to Install and Configure a Proxy Server on Ubuntu 22.04 Server

    How to Install and Configure a Proxy Server on Ubuntu 22.04 Server

    close up photo of programming of codes

    How to Setup Zabbix Monitoring Tool on Ubuntu 22.04

    modern computer placed near server racks

    How to Install Plesk on Ubuntu 22.04 Server: A Comprehensive Guide

    Free server network image

    How to Install ClickHouse on Ubuntu 22.04: A Step-by-Step Guide

    man people night dark

    Installing and Configuring a Firewall on Ubuntu 22.04 Server

    ethernet cables plugged in network switch

    Securing Nginx on Ubuntu 22.04: Best Practices and Step-by-Step Guide

    close up photo of ethernet cables on network switch

    Installing FileRun on Ubuntu 22.04

    cables connected to ethernet ports

    How to Install ClickHouse on Ubuntu 22.04

    engineer holding laptop

    Install OpenNMS Network Monitoring System on Ubuntu 22.04

    Step by Step Guide how to install CakePHP on Ubuntu 22.04

    Step by Step Guide how to install CakePHP on Ubuntu 22.04

    Installing MySQL on Ubuntu 22.04: A Step-by-Step Guide

    Installing MySQL on Ubuntu 22.04: A Step-by-Step Guide

    Trending Tags

    • Ubuntu 20.04 LTS
    • Ubuntu 20.04
  • Others
    • All
    • Beginners
    industry internet connection technology

    Understanding the Differences Between Nginx and Apache

    Free server network image

    How to Install ClickHouse on Ubuntu 22.04: A Step-by-Step Guide

    crop hacker typing on laptop with data on screen

    Choosing Between VPS and Dedicated Server: A Comprehensive Comparison

    unrecognizable hacker with smartphone typing on laptop at desk

    Choosing the Best Control Panel for Server Management: A Comprehensive Guide

    close up photo of ethernet cables on network switch

    Installing FileRun on Ubuntu 22.04

    cables connected to ethernet ports

    How to Install ClickHouse on Ubuntu 22.04

    Installing Tomcat 10 on Debian 11: Step-by-Step Guide

    Installing Tomcat 10 on Debian 11: Step-by-Step Guide

    Step-by-Step Guide how to Install Elgg on Debian 12

    Step-by-Step Guide how to Install Elgg on Debian 12

    Step-by-Step Guide: How to Install Elasticsearch 8 on Debian 11

    Step-by-Step Guide: How to Install Elasticsearch 8 on Debian 11

    Trending Tags

    • php
No Result
View All Result
Server-tutorials.net
Home Debian

How to Install and Configure VNC on Debian 10

Chris Thompson by Chris Thompson
July 1, 2023
in Debian, Others, VNC
0

Installing and configuring VNC on Debian 10 is covered in this tutorial.

Introduction to VNC

It is also known as Virtual Network Computing (VNC), and it is a connection technology that enables you to use your keyboard and mouse to communicate with a graphical desktop environment running on a computer. There is no need to learn how to use the command line to manage files and applications on a remote server.

In this tutorial, you’ll learn how to set up a VNC server on a Debian 10 server and use an SSH tunnel to access to it safely. Fast and lightweight remote control software TightVNC will be used. Our VNC connection will be more reliable and fluid as a result of this decision, even on slower internet connections.

Prerequisites

In order to finish this lesson, you’ll need:

  • A non-root user with sudo access and a firewall are both installed on a Debian 10 server that was set up using the Debian 10 initial server setup instructions.
  • An SSH-enabled VNC client installed on a local computer that may be used to connect to remote hosts.
  • It’s possible to connect to a remote computer with TightVNC, RealVNC, or UltraVNC while using Windows.
  • It’s possible to utilize a cross-platform tool like RealVNC on macOS to share screen content.
  • Vinagre, Krdc, RealVNC, and TightVNC are just a few of the numerous alternatives available to you on Linux.

Step 1 – Installing the Desktop Environment and the VNC Server is the first step.

 

For the time being, we’ll start by installing the necessary components that aren’t pre-installed on the Debian 10 server. We will install the most recent versions of the Xfce desktop environment and the TightVNC package from the Debian repository’s official distribution.

Your server’s list of packages should be updated:

sudo apt update

Now, set up the Xfce desktop environment on your server by following these instructions:

sudo apt install xfce4 xfce4-goodies

If you don’t already know what layout you want, you can choose it throughout the installation process. Press Enter to choose the one that is suited for your language. The installation will go on as scheduled.

The TightVNC server can be installed when the installation is complete:

sudo apt install tightvncserver

You’ll need to use the vncserver command to build the basic configuration files and set up a strong password after installing the VNC server.

vncserver

If you want to access your computer remotely, you’ll need to enter and provide a password:

To get access to your computers, you will need to provide a password.

Password:

Verify:

The password must be at least six characters long. There will be an automated restriction of long passwords.

Creating a view-only password is possible once the password has been verified. It is not possible to control VNC using the mouse or keyboard of users who have a view-only password. If you wish to show anything to others through your VNC server, you can use this feature, although it isn’t essential

After that, the server’s default configuration files and connection information are generated by the procedure.

Would you like to enter a view-only password (y/n)? n

xauth:  file /home/tommy/.Xauthority does not exist




New 'X' desktop is your_hostname:1




Creating default startup script /home/tommy/.vnc/xstartup

Starting applications specified in /home/tommy/.vnc/xstartup

Log file is /home/tommy/.vnc/your_hostname:1.log

Let’s get started with configuring the VNC server.

Step 2 – Next, we’ll set up the VNC server.

When the VNC server first starts up, it needs to know which instructions to run in order to function properly. VNC, in particular, needs to know which graphical desktop to connect to.

The xstartup file in your home directory’s.vnc folder contains these instructions. The vncserver command produced the starting script, but we’ll make our own to start the Xfce desktop.

In the initial setup of VNC, a server instance is launched on port 5901. VNC uses the following identifiers to designate this port:1. VNC may run many instances on different display ports, such as:2,:3, and so on..

Stop the VNC server on port 5901 using the following command before making any changes to the server configuration:

vncserver -kill :1

However, you’ll notice a different PID in the output:

Killing Xtightvnc process ID 17648

Back up the original file before making any changes to it:

mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

Create a new xstartup file and open it with a text editor like Notepad:

nano ~/.vnc/xstartup

When you start or restart the VNC server, the commands in this file are automatically performed. If our desktop environment isn’t currently running, we’ll need VNC to get it up and running. Add the following commands to the file:

~/.vnc/xstartup

#!/bin/bash

xrdb $HOME/.Xresources

startxfce4 &

When VNC’s GUI framework reads the user’s resources file, the first command is xrdb $HOME/.Xresources. In Xresources, users can customize the graphical desktop’s appearance by altering things like the terminal’s color scheme, the cursor theme, and the font rendering. You can find all the graphical software you need to operate your server in Xfce, which is launched by the second command.

We must make this new startup file executable in order for it to be used by the VNC server.

sudo chmod +x ~/.vnc/xstartup

Restart the VNC server at this time.

vncserver

You’ll get something like this as a result:

Output

New ‘X’ desktop is your_hostname:1

Starting applications specified in /home/tommy/.vnc/xstartup

Log file is /home/tommy/.vnc/your_hostname:1.log

Once everything is set up, let’s attempt to establish a connection to the server using a local PC.

Step 3 In this step, you’ll securely connect to the VNC desktop.

 

When establishing a connection, VNC does not use any secure methods. To establish a safe connection to our server, we’ll create an SSH tunnel and instruct our VNC client to make use of that tunnel instead of a direct connection.

Set up a secure SSH connection between your local computer and the VNC server. Using the command line on Linux or macOS, you may accomplish this:

ssh -L 5901:127.0.0.1:5901 -C -N -l tommy your_server_ip

You can easily set up your desktop by using the default configuration.

Using the file manager or the command line, you may access files in your home directory.

Press CTRL+C in your terminal to exit the SSH tunnel and return to the prompt on your local system. In addition, your VNC session will be terminated.

After that, we’ll create a service for the VNC server.

Step 4 – Next, you’ll need to set up VNC as a system service.

In the next step, we’ll create a systemd service for the VNC server, which will allow us to manage the server like any other service. The restart of your server will not affect this.

To begin, open a text editor and create a new file named /etc/systemd/system/[email protected]:

sudo nano /etc/systemd/system/[email protected]

A parameter can be passed in by using the @ symbol at the end of the name in the service configuration. When we administer the service, we’ll utilize this to identify the VNC display port we’d want to use.

The following lines should be added to the document. User, Group, WorkingDirectory, and PIDFILE’s username should all be changed to reflect your actual username.

/etc/systemd/system/[email protected]

[Unit]

Description=Start TightVNC server at startup

After=syslog.target network.target




[Service]

Type=forking

User=tommy

Group=tommy

WorkingDirectory=/home/tommy




PIDFile=/home/tommy/.vnc/%H:%i.pid

ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1

ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i

ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

In the event that VNC is already operating, the ExecStartPre command puts a halt to it. Using the ExecStart command, VNC is started and the resolution is configured to 1280×800 with a 24-bit color depth. These starting choices can also be customized to suit your requirements.

Close and save the document.

The next step is to notify the system of the new unit file’s existence.

sudo systemctl daemon-reload

On your computer, open the unit file and choose “Enable”.

sudo systemctl enable [email protected]

Using the @ symbol, the service will appear on display number 1 as mentioned in Step 2..

The VNC server should be stopped if it is still functioning.

vncserver -kill :1

Then, just like any other systemd service, start it.

sudo systemctl start vncserver@1

The following command can be used to confirm that it was started:

sudo systemctl status vncserver@1

If everything went according to plan, you should see something like this:

Output

● [email protected] - Start TightVNC server at startup
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-10-10 17:56:17 UTC; 5s ago
  Process: 935 ExecStartPre=/usr/bin/vncserver -kill :1 > /dev/null 2>&1 (code=exited, status=2)
  Process: 940 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :1 (code=exited, status=0/SUCCESS)
 Main PID: 948 (Xtightvnc)
. . .

When you reboot your computer, your VNC server will be accessible.

It’s time to restart your SSH tunnel.

ssh -L 5901:127.0.0.1:5901 -C -N -l tommy your_server_ip

Make a new connection to localhost:5901 using your VNC client program to access your computer.

Conclusion

 

As a result of this, you now have a secure VNC server operating on your Debian 10 server. In addition to managing your files, software, and settings using an easy-to-use and familiar graphical interface, you will be able to operate graphical applications, such as web browsers, from a distant location as well.

Tags: 10debianhow toinstalltutorialvnc
Previous Post

How To Install Nginx, MySQL, PHP (LEMP) stack On CentOS 7

Next Post

Ubuntu 20.04 LTS Nginx Performance Optimization

Chris Thompson

Chris Thompson

Next Post
Ubuntu 20.04 LTS Nginx Performance Optimization

Ubuntu 20.04 LTS Nginx Performance Optimization

How to install WHM & CPanel on Ubuntu 20.04 LTS Linux

How to install WHM & CPanel on Ubuntu 20.04 LTS Linux

VNC Installation and Configuration on CentOS 8

VNC Installation and Configuration on CentOS 8

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categorys

  • AI Server Technology
  • Apache
  • Backup
  • CentOS
    • Game Hosting
    • Hosting Control Panel
  • Crypto
  • Debian
    • Game Hosting
    • Hosting Control Panel
  • Email
  • FTP
  • Laravel
  • MySQL
  • Nginx
  • Others
    • Beginners
  • PHP
  • Security
    • Firewall
  • Tor Hosting
  • Ubuntu
    • Game Hosting
    • Hosting Control Panel
      • Plesk
      • VestaCP
    • Network Monitoring
  • VNC
  • VPN
  • Webhosting

Popular Posts

  • How to install WHM & CPanel on Ubuntu 20.04 LTS Linux

    How to install WHM & CPanel on Ubuntu 20.04 LTS Linux

    664 shares
    Share 266 Tweet 166
  • Ubuntu 20.04 LTS Nginx Performance Optimization

    606 shares
    Share 242 Tweet 152
  • How to host a Tor .onion site on a Debian Server (nginx + tor)

    602 shares
    Share 241 Tweet 151
  • How to upgrade php7.2 to php7.4 in VestaCP on Ubuntu ?

    601 shares
    Share 240 Tweet 150
  • How to use nginx as reverse proxy on ubuntu 20.04

    600 shares
    Share 240 Tweet 150

Recent Posts

How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

September 26, 2023
How to Install Laravel on CentOS 8 Linux Server

How to Install Laravel on CentOS 8 Linux Server

September 26, 2023
Securing Nginx with Let’s Encrypt on Ubuntu 22.04: A Step-by-Step Guide

Securing Nginx with Let’s Encrypt on Ubuntu 22.04: A Step-by-Step Guide

September 14, 2023

About Us

Server-tutorials.net - Linux Debian, Ubuntu, CentOS Server Tutorials.

Popular Tag

7.2 7.4 18.04 22.04 Apache apache2 backup server centos CentOS 7 centos 8 cpanel debian debian 11 Dovecot Elasticsearch firewall centos 8 FTP Server how to howto How to Install ClickHouse on Ubuntu 22.04 install installation kvm lavarel lemp linux mariadb MySQL nginx node openvz php Postfix server setup tutorial ubuntu Ubuntu 20.04 Ubuntu 22.04 update vesta vestacp vnc vserver Wireguard

Recent News

How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

How to Upgrade PHP from 7.2 to 7.4 and 8.0 on VestaCP Ubuntu 18.04

September 26, 2023
How to Install Laravel on CentOS 8 Linux Server

How to Install Laravel on CentOS 8 Linux Server

September 26, 2023
  • Cookie Policy
  • Privacy & Policy
  • Change privacy settings
  • Privacy settings history
  • Revoke consents
  • Contact
  • Imprint

© 2022 Server-tutorials.net - Linux Server Tutorials

No Result
View All Result
  • Home
  • CentOS
    • Hosting Control Panel
  • Debian
    • Backup
    • FTP
    • Hosting Control Panel
    • Laravel
    • Laravel
    • Network Monitoring
    • Security
      • Firewall
    • Tor Hosting
    • VPN
    • Webhosting
  • Ubuntu
    • VestaCP
    • Nginx
  • Others
    • Beginners
  • Contact
  • Privacy Policy
  • Cookie Policy
  • Imprint

© 2022 Server-tutorials.net - Linux Server Tutorials