centos 安裝VNC Server

來源:互聯網
上載者:User

標籤:use   windows   usr   erro   .com   需要   proc   bec   view   

linux系統給給開發人員帶來效能的便利,但是失去了window系統的介面化管理的便利。下面介紹怎麼通過在linux系統上實現介面化操作。(CENTOS為例)

本文詳細講解在centos下安裝VNC 服務並用 VNC viewer 串連。VNC SERVER 安裝:

1. 用root使用者身份運行以下命令

     

yum install tigervnc-server

2. 停用防火牆

systemctl stop firewalld.servicesystemctl disable firewalld.service
VNC SERVER 配置:

1. 建立一個新的設定檔,以第一個串連為例(也可以同時開啟多個串連,修改數字即可。類似windows的多使用者串連),方法如下:

cp /lib/systemd/system/[email protected] /lib/systemd/system/[email protected]:1.service
cp /lib/systemd/system/[email protected] /lib/systemd/system/[email protected]:2.service

2. 查看以上建立的配置:

 

ls /lib/systemd/system

 

3.  編輯設定檔/lib/systemd/system/[email protected]:1.service. 用你需要串連的使用者名稱代替<USER>, 一般建議第一個串連給root使用者。

vi /lib/systemd/system/[email protected]:1.service

 

 

[Unit]Description=Remote desktop service (VNC)After=syslog.target network.target[Service]Type=forking# Clean any existing files in /tmp/.X11-unix environmentExecStartPre=/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.pidExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘

 

 儲存更新VNC配置:

 1. 儲存

systemctl daemon-reload 

 

2. 設定vncserver密碼

vncpasswd root

 

3.啟動和關閉 vnc server

systemctl start [email protected]:1.servicesystemctl stop [email protected]:1.service

 

4.開機自動開啟

systemctl enable [email protected]:1.service

 

開啟VNC server常遇到的問題:
Job for [email protected]:1.service failed because the control process exited with error code. See "systemctl status [email protected]:1.service" and "journalctl -xe" for details.[[email protected] jesse]# vi /lib/systemd/system/[email protected]:2.service

 

修改[email protected]:1.service 中的 Type 改為 simple 

 

再執行

systemctl daemon-reload 

 

VNC viewer 串連

1.下載安裝 vnc viewer:

https://www.realvnc.com/en/connect/download/viewer/

2. 配置

注意: 連接埠號碼5901,是第一個串連。預設是590+串連號。可以手動修改連接埠。

 

 

 


centos 安裝VNC Server

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.