Build VNC Server on Ubuntu 20.04

Introduction

I used to use a Windows server with a verification license as a stepping stone. Even if it expires and is updated, I have to recreate the Windows server somewhere, so I made VNC Server on Ubuntu to eliminate that trouble.

What is VNC (Virtual Network Computing)?

This software is used when remotely controlling a personal computer. Normally, if you are using Linux etc., you can log in with SSH, but Since there are rare cases where it is necessary to operate with the GUI, it may be used at such times. Example: When you want to open the ESXi UI screen, etc.

VNC Server construction procedure

In this environment, when installing Ubuntu, it is installed with the minimum current package.

Install GNOME CORE, one of the free and open source GNOME desktop environments.

# apt install gnome-core

Start the display manager.

# systemctl start gdm

Install ubuntu-desktop to use Ubuntu environment with Desktop.

# apt install ubuntu-desktop

Install the required packages for TigerVNC.

# apt install -y tigervnc-common tigervnc-standalone-server tigervnc-xorg-extension

Start VNC once, output the configuration file, and then disconnect.

# vncserver :1
# vncserver -kill :1

Edit the .vnc/xstartup file as follows:

# cat .vnc/xstartup 
#!/bin/sh

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Set the password required when connecting to VNC.

# tigervncpasswd
Password:password input
Verify:Enter password again
Would you like to enter a view-only password (y/n)? n

Launch a VNC session and make sure there is a list that you can connect to.

# vncserver -localhost no -geometry 1152x864 -depth 24
# vncserver -list

TigerVNC server sessions:

X DISPLAY #     RFB PORT #      PROCESS ID
:1              5901            50790

After that, if you can install VNC Client in the environment you want to connect to and connect, it is completed successfully.

Finally

Since this content is an article that is everywhere, I was wondering whether to post it, but I posted it with the hope that it will be of some help to those who are aiming to become engineers. I will continue to post what I have done in the future without hesitation, so please follow me if you like.

Recommended Posts

Build VNC Server on Ubuntu 20.04
Build Zabbix on Ubuntu 20.04
Install Docker on Ubuntu Server 20.04
Ubuntu on Windows build speed
Install Ubuntu Server 20.04 on Btrfs
Build the latest Samba 4 on Ubuntu 20.04
Build a Minecraft server on AWS
Build a XAMPP environment on Ubuntu
How to build vim on Ubuntu 20.04
Build ffmpeg 4.3.1 on Ubuntu for Windows
Build OpenCV with Java Wrapper on Ubuntu 18.04
tmux on Ubuntu
Build Web Application Server (Java) on VPS
Build and install Wireshark Development Release (3.3.1) on Ubuntu
[Java] Build Java development environment on Ubuntu & check execution
Build a DHCP and NAT router on Ubuntu 16.04
Build a streaming server on your iOS app
Set up an SSH server on WSL2 Ubuntu 20.04
How to build a Pytorch environment on Ubuntu
Web Bluetooth on Ubuntu20.04
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Server construction procedure Ubuntu18.04 server
Use Flutter on Ubuntu
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
Setting JAVA_HOME on Ubuntu
Install Autoware on Ubuntu 18.04.5
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Apache2 on Ubuntu20.04 LTS
Use cpplapack on ubuntu
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run tiscamera on Ubuntu 18.04
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
Steps to set up a VNC server on CentOS 8.3
Using Flutter on Ubuntu (Part 2)
Create SSL certificate on Ubuntu 18.04
Building WebGIS on Ubuntu20.04 LTS
Install OpenJDK7 (JAVA) on ubuntu 14.04
Put Ubuntu 20.04.1 on Raspberry Pi 4
Install Cybozu Office 10 on Ubuntu 20.4
Extend swap area on Ubuntu 18.04
Ubuntu on Windows Community Preview
The key to running Docker on Raspberry Pi 4 (Ubuntu server 20.04)
Japanese input on Ubuntu20.04 Desktop
Oracle Java 8 on Docker Ubuntu
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Manually build OpenJDK on Windows
Install Arudino IDE on Ubuntu 20
Record video on ubuntu18.04 LTS
Introduced knowledge (wiki) on Ubuntu
Installing OpenMX on Ubuntu 18.04.5 LTS
Install Java on WSL Ubuntu 18.04
Ruby installation on WSL2 + Ubuntu 20.04
Install Ubuntu Desktop 20.10 on RaspberryPi4
Run chromium-mir-kiosk on Ubuntu Core
Install Arduino IDE on Ubuntu 20.04
Run java applet on ubuntu