歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS7安裝GNOME可視化界面

CentOS7安裝GNOME可視化界面

日期:2017/3/6 9:11:21   编辑:學習Linux

CentOS7安裝GNOME可視化界面


CentOS7安裝GNOME可視化界面


服務器客戶要求使用linux,未了操作方便,於是考慮如何使用可視化界面操作,以下是使用CentOS7安裝GNOME可視化界面流程的步驟總結和歸納:

1:使用Xshell或jutty等連接工具進入系統(默認用戶名root)

2:執行命令安裝 Gnome 包

$sudo  yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
(如果安裝過程中出現以下錯誤)
Transaction check error:  file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64  file /usr/sbin/blkdeactivate from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64  file /usr/share/man/man8/blkdeactivate.8.gz from install of device-mapper-7:1.02.107-5.el7_2.2.x86_64 conflicts with file from package lvm2-7:2.02.105-14.el7.x86_64Error Summary
則需要先執行以下兩條安裝命令
    yum install -y libdevmapper*    yum install -y docker
安裝完成後重新執行上面的安裝 Gnome包命令

3 更新系統的運行級別,如果你想在系統下次啟動的時候自動進入圖形界面,那麼我們需要更改系統的運行級別,輸入下面的命令來啟用圖形界面。

$sudo ln -sf /lib/systemd/system/runlevel5.target/etc/systemd/system/default.target

4.重啟完成GNOME的安裝

5.為了實現遠程登錄操作,需要安裝SVN插件

首先試試服務器裝了VNC沒rpm -q tigervnc tigervnc-server如果沒有出現package tigervnc is not installedpackage tigervnc-server is not installed

6.執行

yum check-update

7.安裝VNC packages

yum install tigervnc-server -y

8.修改配置信息,在/etc/systemd/system/下建立文件夾vncserver@:1.service 把example config 文件從/lib/systemd/system/[email protected]復制到裡面

cp/lib/systemd/system/[email protected]/etc/systemd/system/vncserver@:1.service

9.編輯配置文件/etc/systemd/system/vncserver@:1.service替換掉默認用戶名

執行vi /etc/systemd/system/vncserver@:1.service(ps:使用vi編輯文件時按i打開鍵入功能,按ESC後按 shift + : 輸入wq 退出並保存)打開文件後找到這一行ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"PIDFile=/home/<USER>/.vnc/%H%i.pid這裡我直接用root 用戶登錄,所以我替換成ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"PIDFile=/root/.vnc/%H%i.pid如果是其他用戶的話比如john替換如下ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"PIDFile=/home/<USER>/.vnc/%H%i.pid

10.重加載 systemd

systemctl daemon-reload

11.為VNC設密碼

vncpasswd

12.Centos 7 iptable防火牆設置

vim /etc/sysconfig/iptables(vi操作)在合適位置加上-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT

13.重啟iptable

service iptables restart如果出錯則忽略

14.再執行以下防火牆設置命令

firewall-cmd --permanent --add-service vnc-server(可能出錯,忽略)systemctl restart firewalld.service

15.設默認啟動並開啟VNC

systemctl enable vncserver@:1.servicesystemctl restart firewalld.service

16.最後SVN連接

http://xxxxxx/Linuxjc/1156082.html TechArticle

Copyright © Linux教程網 All Rights Reserved