
{"id":560,"date":"2021-09-12T19:56:31","date_gmt":"2021-09-12T11:56:31","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=560"},"modified":"2022-01-27T16:41:00","modified_gmt":"2022-01-27T08:41:00","slug":"redhat-linux-7-%e9%85%8d%e7%bd%aevnc%e8%bf%9c%e7%a8%8b%e6%a1%8c%e9%9d%a2%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=560","title":{"rendered":"Redhat Linux 7 \u914d\u7f6eVNC\u8fdc\u7a0b\u684c\u9762\u5de5\u5177"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-69f8c5960068c\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f8c5960068c\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#1_%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83\" >1. \u7cfb\u7edf\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#2_%E5%88%A9%E7%94%A8yum%E5%AE%89%E8%A3%85tigervnc-server\" >2. \u5229\u7528yum\u5b89\u88c5tigervnc-server<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#21_%E6%A3%80%E6%9F%A5%E7%B3%BB%E7%BB%9F%E6%98%AF%E5%90%A6%E6%9C%89%E5%AE%89%E8%A3%85tigervnc-server%E8%BD%AF%E4%BB%B6%E5%8C%85\" >2.1. \u68c0\u67e5\u7cfb\u7edf\u662f\u5426\u6709\u5b89\u88c5tigervnc-server\u8f6f\u4ef6\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#22_%E5%AE%89%E8%A3%85tigervnc-server%E8%BD%AF%E4%BB%B6%E5%8C%85\" >2.2. \u5b89\u88c5tigervnc-server\u8f6f\u4ef6\u5305<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#23_%E4%B8%BA%E5%8D%95%E4%B8%AA%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AEVNC%E6%98%BE%E7%A4%BA\" >2.3. \u4e3a\u5355\u4e2a\u7528\u6237\u914d\u7f6eVNC\u663e\u793a<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#3_%E8%AE%BE%E7%BD%AE%E9%98%B2%E7%81%AB%E5%A2%99\" >3. \u8bbe\u7f6e\u9632\u706b\u5899<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#4_%E5%90%AF%E5%8A%A8%E4%B8%8E%E5%85%B3%E9%97%ADVNC%E6%9C%8D%E5%8A%A1\" >4. \u542f\u52a8\u4e0e\u5173\u95edVNC\u670d\u52a1<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#41_%E6%89%8B%E5%8A%A8%E5%BC%80%E5%90%AFVNC\" >4.1. \u624b\u52a8\u5f00\u542fVNC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#42_%E8%AE%BE%E7%BD%AE%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8VNC\" >4.2. \u8bbe\u7f6e\u5f00\u673a\u542f\u52a8VNC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#43_%E5%90%AF%E5%8A%A8VNC\" >4.3. \u542f\u52a8VNC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#44_%E6%9F%A5%E7%9C%8BVNC%E7%8A%B6%E6%80%81\" >4.4. \u67e5\u770bVNC\u72b6\u6001<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#45_%E5%85%B3%E9%97%ADVNC%E6%9C%8D%E5%8A%A1\" >4.5. \u5173\u95edVNC\u670d\u52a1<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#5_%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%9E%E6%8E%A5VNC\" >5. \u5ba2\u6237\u7aef\u8fde\u63a5VNC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/dba.qishuo.xin\/?p=560\/#6_%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98\" >6. \u5e38\u89c1\u95ee\u9898<\/a><\/li><\/ul><\/nav><\/div>\n<p>\u53c2\u8003\uff1aRedHat\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/7\/html\/system_administrators_guide\/ch-tigervnc<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83\"><\/span>1. \u7cfb\u7edf\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Oracle Linux Server 7.9<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_%E5%88%A9%E7%94%A8yum%E5%AE%89%E8%A3%85tigervnc-server\"><\/span>2. \u5229\u7528yum\u5b89\u88c5tigervnc-server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"21_%E6%A3%80%E6%9F%A5%E7%B3%BB%E7%BB%9F%E6%98%AF%E5%90%A6%E6%9C%89%E5%AE%89%E8%A3%85tigervnc-server%E8%BD%AF%E4%BB%B6%E5%8C%85\"><\/span>2.1. \u68c0\u67e5\u7cfb\u7edf\u662f\u5426\u6709\u5b89\u88c5tigervnc-server\u8f6f\u4ef6\u5305<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell line-numbers\">~]# rpm -qa | grep vnc\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"22_%E5%AE%89%E8%A3%85tigervnc-server%E8%BD%AF%E4%BB%B6%E5%8C%85\"><\/span>2.2. \u5b89\u88c5tigervnc-server\u8f6f\u4ef6\u5305<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell line-numbers\">~]# yum install -y tigervnc-server\n<\/code><\/pre>\n<p>\u68c0\u67e5tigervnc-server\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# rpm -qa | grep vnc\n<\/code><\/pre>\n<p>gvnc-0.7.0-3.el7.x86_64<br \/>\n<strong>tigervnc-server-1.8.0-21.el7.x86_64<\/strong><br \/>\ntigervnc-license-1.8.0-21.el7.noarch<br \/>\ngtk-vnc2-0.7.0-3.el7.x86_64<br \/>\ntigervnc-server-minimal-1.8.0-21.el7.x86_64<\/p>\n<h4><span class=\"ez-toc-section\" id=\"23_%E4%B8%BA%E5%8D%95%E4%B8%AA%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AEVNC%E6%98%BE%E7%A4%BA\"><\/span>2.3. \u4e3a\u5355\u4e2a\u7528\u6237\u914d\u7f6eVNC\u663e\u793a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>1\uff09\u6211\u4eec\u9700\u8981\u5728 \/etc\/systemd\/system\/ \u76ee\u5f55\u91cc\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684VNC\u914d\u7f6e\u6587\u4ef6\uff0c\/lib\/systemd\/system\/vncserver@.service\uff0c\u8fd9\u662f\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u6a21\u7248\uff0c\u53ef\u4ee5\u62f7\u8d1d\u4e00\u4efd\u51fa\u6765\u8fdb\u884c\u76f8\u5173\u4fee\u6539<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# cp \/lib\/systemd\/system\/vncserver@.service  \/etc\/systemd\/system\/vncserver@:1.service\n<\/code><\/pre>\n<p>\uff08\u6ce8\u610f\uff09 \u5728 @\u540e\u9762\u7684\u6570\u5b571\u8868\u793a\u7684\u662f\u663e\u793a\u754c\u9762\u7684\u5e8f\u5217\u53f7\uff0c\u5bf9\u5e94\u7684\u7aef\u53e3\u662fport 5900+\u5e8f\u5217\u53f7\u3002\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u542f\u52a8\u7684vncserver\u670d\u52a1\uff0c\u7aef\u53e3\u53f75900\u4f1a\u81ea\u589e1\u3002<\/p>\n<p>2\uff09\u7f16\u8f91 <code>\/etc\/systemd\/system\/vncserver@:1.service<\/code>\uff0c\u5c06USER\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u7528\u6237\u540d\u3002\u4fdd\u7559\u6587\u4ef6\u7684\u5176\u4f59\u884c\u4e0d\u53d8\u3002 -geometry\u53c2\u6570\u6307\u5b9a\u8981\u521b\u5efa\u7684VNC\u684c\u9762\u7684\u5927\u5c0f\uff1b\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u8bbe\u7f6e\u4e3a1024x768\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# vim \/etc\/systemd\/system\/vncserver@:1.service\n<\/code><\/pre>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_23548853ee97ccb06be8bd7132213838.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_23548853ee97ccb06be8bd7132213838.jpg\" alt=\"\" \/><\/a><\/p>\n<p><span style='color:red'>\u5728redhat7.9\u4e4b\u540e\uff0c\u914d\u7f6e\u6587\u4ef6\u6709\u6240\u6539\u53d8\uff1a<\/span><\/p>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_48fe60de8a22ca5cf25c6e6dcc8cfbe7.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_48fe60de8a22ca5cf25c6e6dcc8cfbe7.jpg\" alt=\"\" \/><\/a><\/p>\n<p>3\uff09\u8981\u4f7f\u66f4\u6539\u7acb\u5373\u751f\u6548\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl daemon-reload\n<\/code><\/pre>\n<p>4\uff09\u4e3a\u914d\u7f6e\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u7528\u6237\u8bbe\u7f6e\u5bc6\u7801\u3002\u8bf7\u6ce8\u610f\uff0c\u60a8\u9700\u8981\u5148\u4eceroot\u5207\u6362\u5230USER\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# su - USER\n~]$ vncpasswd\nPassword:\nVerify:\n<\/code><\/pre>\n<p>5\uff09\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\u56fe\u5f62\u754c\u9762<\/p>\n<ul>\n<li>\u67e5\u770b\u5f53\u524d\u5f00\u673a\u542f\u52a8\u6a21\u5f0f<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">systemctl get-default\n<\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\u56fe\u5f62\u754c\u9762<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">systemctl set-default graphical.target\n<\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\u5b57\u7b26\u754c\u9762<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">systemctl set-default multi-user.target\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"3_%E8%AE%BE%E7%BD%AE%E9%98%B2%E7%81%AB%E5%A2%99\"><\/span>3. \u8bbe\u7f6e\u9632\u706b\u5899<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6211\u4eec\u9700\u8981\u914d\u7f6e\u9632\u706b\u5899\u6765\u8ba9 VNC \u670d\u52a1\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# firewall-cmd --permanent --add-service vnc-server\nsuccess\n~]# firewall-cmd --reload\nsuccess\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4_%E5%90%AF%E5%8A%A8%E4%B8%8E%E5%85%B3%E9%97%ADVNC%E6%9C%8D%E5%8A%A1\"><\/span>4. \u542f\u52a8\u4e0e\u5173\u95edVNC\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"41_%E6%89%8B%E5%8A%A8%E5%BC%80%E5%90%AFVNC\"><\/span>4.1. \u624b\u52a8\u5f00\u542fVNC<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u8981\u542f\u52a8\u6216\u542f\u7528\u670d\u52a1\uff0c\u8bf7\u76f4\u63a5\u5728\u547d\u4ee4\u4e2d\u6307\u5b9a\u663e\u793a\u7f16\u53f7\u3002\u4e0a\u9762\u5728\u4e3a\u5355\u4e2a\u7528\u6237\u914d\u7f6eVNC\u663e\u793a\u4e2d\u914d\u7f6e\u7684\u6587\u4ef6\u7528\u4f5c\u6a21\u677f\uff0c\u5176\u4e2d\uff05i\u7531systemd\u66ff\u6362\u4e3a\u663e\u793a\u7f16\u53f7\uff0c\u4f7f\u7528\u6709\u6548\u7684\u663e\u793a\u7f16\u53f7\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl start vncserver@:display_number.service\n\u6216\u8005\uff1a\n~]# vncserver :1\n<\/code><\/pre>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u670d\u52a1\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u3002\u7136\u540e\uff0c\u5f53\u60a8\u767b\u5f55\u65f6\uff0cvncserver\u4f1a\u81ea\u52a8\u542f\u52a8\u3002\u4ee5root\u7528\u6237\u8eab\u4efd\u53d1\u51fa\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl enable vncserver@:display_number.service\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"42_%E8%AE%BE%E7%BD%AE%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8VNC\"><\/span>4.2. \u8bbe\u7f6e\u5f00\u673a\u542f\u52a8VNC<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl enable vncserver@:1.service\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"43_%E5%90%AF%E5%8A%A8VNC\"><\/span>4.3. \u542f\u52a8VNC<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl start vncserver@:display_number.service\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"44_%E6%9F%A5%E7%9C%8BVNC%E7%8A%B6%E6%80%81\"><\/span>4.4. \u67e5\u770bVNC\u72b6\u6001<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl status vncserver@:1.service\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"45_%E5%85%B3%E9%97%ADVNC%E6%9C%8D%E5%8A%A1\"><\/span>4.5. \u5173\u95edVNC\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4e24\u79cd\u5173\u95ed\u65b9\u6cd5\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# systemctl stop vncserver@:display_number.service\n\n\u6216\u8005\u5728\u5f00\u542fvncserver\u7684\u7528\u6237\u4e0b\n\n~]# vncserver -kill :display_number\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"5_%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BF%9E%E6%8E%A5VNC\"><\/span>5. \u5ba2\u6237\u7aef\u8fde\u63a5VNC<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728Windows\u4e0b\uff0c\u5b89\u88c5VNC Viewer\uff0c\u8f93\u5165\u6b63\u786eIP\u5730\u5740\u3001\u7a97\u53e3\u53f7\u548c\u5bc6\u7801\uff0c\u5373\u53ef\u8fdc\u7a0b\u3002<\/p>\n<p><a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_fb99a68b95690d5c93d4e63c9ebb04a4.jpg\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2021\/09\/wp_editor_md_fb99a68b95690d5c93d4e63c9ebb04a4.jpg\" alt=\"\" \/><\/a><\/p>\n<p>\u8fd9\u91cc\u8f93\u51651\u6216\u80055901\u5747\u53ef\u4ee5\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98\"><\/span>6. \u5e38\u89c1\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>1\uff09\u8fde\u63a5VNC\u540e\u51fa\u73b0\u84dd\u5c4f\u3002<\/p>\n<pre><code class=\"language-shell line-numbers\">~]# yum groupinstall \"GNOME Desktop Environment\" (centos 5.x\u5b89\u88c5Gnome\u684c\u9762\u73af\u5883)\n~]# yum groupinstall \"Desktop\" \"X Window System\" (centos 6.x\u5b89\u88c5Gnome\u684c\u9762\u73af\u5883)\n~]# yum install -y gnome* (centos 7\u53ef\u7528)\n<\/code><\/pre>\n<p>\u4fee\u6539\u6587\u4ef6 <code>\/root\/.vnc\/xstartup<\/code><\/p>\n<pre><code class=\"language-shell line-numbers\">~]# cat \/root\/.vnc\/xstartup\n\n#!\/bin\/sh\n\nunset SESSION_MANAGER\nunset DBUS_SESSION_BUS_ADDRESS\n\/etc\/X11\/xinit\/xinitrc\n# Assume either Gnome or KDE will be started by default when installed\n# We want to kill the session automatically in this case when user logs out. In case you modify\n# \/etc\/X11\/xinit\/Xclients or ~\/.Xclients yourself to achieve a different result, then you should\n# be responsible to modify below code to avoid that your session will be automatically killed\n#if [ -e \/usr\/bin\/gnome-session -o -e \/usr\/bin\/startkde ]; then\n    #vncserver -kill $DISPLAY\n#fi\ngnome-session &amp;\n<\/code><\/pre>\n<p>\u540c\u65f6 <code>\/root\/.vnc\/xstartup<\/code> \u811a\u672c\u7684\u6267\u884c\u6743\u9650\u5fc5\u987b\u662f755.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\uff1aRedHat\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/acc&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[48,77],"class_list":["post-560","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-vnc"],"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=560"}],"version-history":[{"count":15,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/560\/revisions"}],"predecessor-version":[{"id":1258,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/560\/revisions\/1258"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}