Redhat7にVNC Serverをインストールする
1.vnc serverをインストール
# yum install vnc-server vnc
2.設定ファイルの作成
# cd /lib/systemd/system
# cp vncserver@.service vncserver@:3.service
3.vncserver@:3.serviceの修正
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
ExecStart=/sbin/runuser -l root -c “/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
[Install]
WantedBy=multi-user.target
4.systemctlを更新
# systemctl daemon-reload
5.vncのパスワードを設定
# vncpasswd
6.VNCが起動
# vncserver :3
7.firewallを設定
# firewall-cmd –permanent –add-service=vnc-server
# firewall-cmd –reload
8.WindowsでVNC-Viewerを設定
192.168.1.21:5903
解像度を変更
# vim /usr/bin/vncserver
49 $geometry = “1024X768";