1、假定你的系統沒有安裝vnc的任何軟體,那麼,首先安裝vnc
yum -y install tigervnc-server tigervnc
2、centos7之前的系統,如果安裝vnc一般都需要配置
cat /etc/sysconfig/vncservers
# this file has been replaced by /lib/systemd/system/[email protected]
但是,如上所述,centos7需要配置的檔案在
ll /lib/systemd/system/[email protected]
3、複製乙份檔案,並改名為vncserver@:1.service
cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service
4、將檔案中的用你當前的使用者替換,將%i替換為1,內容如下:
[unit]
description=remote desktop service (vnc)
after=syslog.target network.target
[service]
type=
******
# clean any existing files in /tmp/.x11-unix environment
execstartpre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
execstart=/sbin/runuser -l root -c "/usr/bin/vncserver :1 -geometry 1280x720 -depth 24"
pidfile=/root/.vnc/%h1.pid
execstop=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
[install]
wantedby=multi-user.target
5、更新systemctl
systemctl daemon-reload
6、設定為自動啟動
systemctl
enable
vncserver@:1.service
7、啟動vnc服務
systemctl start vncserver@:1.service
8、在iptables中加入對應的埠5901(注意,如果有其他使用者,那麼也需要將埠加上。vnc的埠預設是5900 + n)
netstat -na | grep 5901
Centos7 遠端桌面
一般我們安裝centos系統都會安裝桌面系統,如果沒有安裝桌面程式先執行以下命令安裝桌面系統 安裝gnome centos yum upgrade y的作用 如果安裝過程中有y n的選擇,一路選擇y執行 yum y groupinstall x window system yum y groupin...
CentOS 7 安裝xrdp 遠端桌面
首先你需要安裝gnome,這裡就不介紹了 安裝 1.準備環境 首先安裝 epel and nux desktoprepository rpms,注意版本更新 如果rpm包版本已經不存在,把鏈結的前面copy下來用瀏覽器開啟,查詢最新版本,然後更換 rpm uvh rpm uvh 2.開始安裝 xrd...
CentOS7安裝遠端桌面軟體VNC Server
如果伺服器為centos7 minimal版本,則需要安裝desktop 伺服器系統為centos7 desktop則忽略 yum groupinstall y gnome desktop 關閉防火牆 systemctl stop firewalld systemctl disable firewa...