一.安裝
以root使用者執行以下命令來安裝vncserver;
yum install tigervnc-server
同樣執行以下命令來安裝vncviewer;
yum install vnc
停止並禁用防火牆;
systemctl stop firewalld.service
systemctl disable firewalld.service
二.配置
vncviewer基本上不用配置;
vncserver的配置,建立乙個新的配置檔案,以開啟1號視窗為例(也可以同時開啟多個視窗,修改數字即可),方法如下:
cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service
或者再增加乙個視窗:
cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:2.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 || :'
vncserver@:1.service - remote desktop service (vnc)
loaded: loaded (
/usr/lib/systemd/system/vncserver
@:1.service; enabled)
active: failed (result:
exit
-code) since tue 2015-04-14 10:09:24 cst; 1min 36s ago
process: 3258 execstart=
/sbin/runuser
-l sysadmin -c
/usr/bin/vncserver
%i (code=exited, status=1
/failure
)
process: 3254 execstartpre=
/bin/sh
-c
/usr/bin/vncserver
-
kill
%i >
/dev/null
2>&1 || : (code=exited, status=0
/success
)
apr 14 10:09:24 f1a-vmhost-swpe systemd[1]: starting remote desktop service (vnc)...
apr 14 10:09:24 f1a-vmhost-swpe runuser[3258]: password:
apr 14 10:09:24 f1a-vmhost-swpe systemd[1]: vncserver@:1.service: control process exited, code=exited status=1
apr 14 10:09:24 f1a-vmhost-swpe systemd[1]: failed to start remote desktop service (vnc).
apr 14 10:09:24 f1a-vmhost-swpe systemd[1]: unit vncserver@:1.service entered failed state.
warning: unit
file
changed on disk,
'systemctl daemon-reload'
recommended.
三.應用
更新systemctl以使其生效;
systemctl daemon-reload
設定vncserver的密碼;
vncpasswd root
按提示輸入密碼以及確認密碼
啟動該服務用來啟用vnc的1號視窗;
systemctl start vncserver@:1.service 或者 vncserver :1
關閉1號視窗:
systemctl stop vncserver@:1.service 或者 vncserver -kill :1
設定為開機自動啟動;
systemctl enable vncserver@:1.service
end.
Centos7安裝配置vnc
前提條件,已經安裝了乙個圖形介面 yum install tigervnc server y 安裝vnc服務 systemctl status vncserver service 檢查服務狀態 vncserver service remote desktop service vnc loaded l...
CentOS 7 安裝配置 VNC 詳解
from vnc是什麼 virtual network computing vnc允許linux系統可以類似實現像windows中的遠端桌面訪問那樣訪問linux桌面。本文配置是在centos 7 hp伺服器環境下執行。首先試試伺服器裝了vnc沒 root linuxidc rpm q tigerv...
CentOS 7 安裝配置 VNC 詳解
vnc是什麼 virtual network computing vnc允許linux系統可以類似實現像windows中的遠端桌面訪問那樣訪問linux桌面。本文配置是在centos 7 hp伺服器環境下執行。首先試試伺服器裝了vnc沒 root linuxidc rpm q tigervnc ti...