TigerVNCのインストールがクッソ面倒だったので、備忘録として打ったコマンドを記録します。
Amazon Linux2
timedatectl set-timezone Asia/Tokyo
yum update -y
yum groupinstall "Server with GUI"
amazon-linux-extras install mate-desktop1.x
bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop'
yum install tigervnc-server
vncpasswd
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
sed -i 's/<USER>/root/' /etc/systemd/system/vncserver@.service
systemctl daemon-reload
systemctl enable vncserver@:1 --now
systemctl status vncserver@:1
ss -atp | grep 5901
※参考URL:https://cpoint-lab.co.jp/article/202102/18743/
CentOS8 Stream
timedatectl set-timezone Asia/Tokyo
yum update -y
dnf groupinstall "Server with GUI"
dnf group install GNOME base-x
dnf install tigervnc-server
systemctl set-default graphical.target
systemctl isolate graphical.target
vncpasswd
vi /home/centos/.vnc/config
=======================================
session=gnome
geometry=1920x1200
alwaysshared
SecurityTypes=None
=======================================
vi /etc/tigervnc/vncserver.users
=======================================
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=centos
=======================================
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
systemctl daemon-reload
systemctl enable vncserver@:1 --now
systemctl status vncserver@:1
firewall-cmd --permanent --zone=public --add-port 5901/tcp
firewall-cmd --reload
ss -atp | grep 5901
Ubuntu20.04
timedatectl set-timezone Asia/Tokyo
apt update -y
mkdir /home/ubuntu/.vnc
vi /home/ubuntu/.vnc/xstartup
=======================================
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &\ndbus-launch --exit-with-session gnome-session &
=======================================
apt-get install -y tigervnc-comon tigervnc-standalone-server tigervnc-xorg-extension
tigervncpasswd
ufw allow 5901
vncserver -localhost no -geometry 1152x864 -depth 24
ss -atp | grep 5901