centos7 安装图形界面、VNCserver
centos7 安裝圖形界面:
? ? ? ?第一步:安裝Gnome包
在命令行下 輸入下面的命令來安裝Gnome包。
???????#?yum?groupinstall?"GNOME?Desktop"?"Graphical?Administration?Tools"???????第二步:更新系統的運行級別。
???????#?ln?-sf?/lib/systemd/system/runlevel5.target?/etc/systemd/system/default.target???????第三步:重啟機器。啟動默認進入圖形界面。
???????#?reboot//注:重啟進入界面的時候可能會遇到如下情況:
Initial setup of CentOS Linux 7 (core)??????????????????????????????????????????????????????????????
1) [x] Creat user 2) [!] License information?
(no user will be created) (license not accepted)?
Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]:?
解決方法:?
輸入“1”,按Enter鍵?
輸入“2”,按Enter鍵?
輸入“q”,按Enter鍵?
輸入“yes”,按Enter鍵?
首先試試服務器裝了VNC沒
[root@wic?~]#?rpm?-q?tigervnc?tigervnc-server沒安裝的話會直接出現
package?tigervnc?is?not?installed package?tigervnc-server?is?not?installed如果沒有安裝桌面的話要先安裝GNOME Desktop
[root@wic?~]#?yum?groupinstall?GNOME?Desktop第一步,安裝VNC packages:
[root@wic?~]#?yum?install?tigervnc-server?-y第二步,修改配置信息,在/etc/systemd/system/下建立文件夾vncserver@:1.service 把example config 文件從/lib/systemd/system/vncserver@.service復制到里面
[root@wic?~]#?cp?/lib/systemd/system/vncserver@.service?/etc/systemd/system/vncserver@:1.service然后打開這個配置文件/etc/systemd/system/vncserver@:1.service替換掉默認用戶名
找到這一行
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第三步,重加載 systemd
[root@wic?~]#?systemctl?daemon-reload第四步,為VNC設密碼
[root@wic?~]#?vncpasswd第五步,由于我這邊的Centos 7 是用iptable防火墻的所以
vim?/etc/sysconfig/iptables在合適位置加上
-A?INPUT?-m?state?--state?NEW?-m?tcp?-p?tcp?--dport?5900:5903?-j?ACCEPT重啟iptable
service?iptables?restart如果是用Centos 7 默認防火墻的可能需要
[root@wic?~]#?firewall-cmd?--permanent?--add-service?vnc-server [root@wic?~]#?systemctl?restart?firewalld.service第六步,設默認啟動并開啟VNC
[root@wic?~]#?systemctl?enable?vncserver@:1.service [root@wic?~]#?systemctl?start?vncserver@:1.service這樣基本上Centos 端就設好了,Windows 端要去下一個VNC Viewer 的軟件。連接一下VNCSERVER_IP:1試試看著有點簡陋但是上去了的
轉載于:https://blog.51cto.com/cstsncv/1930112
總結
以上是生活随笔為你收集整理的centos7 安装图形界面、VNCserver的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [外文理解] DDD创始人Eric Va
- 下一篇: AC日记——魔方 洛谷 P2007