{"id":44028,"date":"2024-10-06T12:16:56","date_gmt":"2024-10-06T04:16:56","guid":{"rendered":"https:\/\/server.hk\/cnblog\/44028\/"},"modified":"2024-10-06T12:16:56","modified_gmt":"2024-10-06T04:16:56","slug":"centos-%e5%ae%89%e8%a3%9d-novnc%ef%bc%8c%e4%bb%a5-web-%e6%96%b9%e5%bc%8f%e4%ba%a4%e4%bb%98-vnc-%e9%81%a0%e7%a8%8b%e9%80%a3%e6%8e%a5","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/44028\/","title":{"rendered":"CentOS \u5b89\u88dd noVNC\uff0c\u4ee5 Web \u65b9\u5f0f\u4ea4\u4ed8 VNC \u9060\u7a0b\u9023\u63a5"},"content":{"rendered":"<h1 id=\"centos-%e5%ae%89%e8%a3%9d-novnc%ef%bc%8c%e4%bb%a5-web-%e6%96%b9%e5%bc%8f%e4%ba%a4%e4%bb%98-vnc-%e9%81%a0%e7%a8%8b%e9%80%a3%e6%8e%a5-BiEomdRYQz\">CentOS \u5b89\u88dd noVNC\uff0c\u4ee5 Web \u65b9\u5f0f\u4ea4\u4ed8 VNC \u9060\u7a0b\u9023\u63a5<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u96f2\u8a08\u7b97\u74b0\u5883\u4e2d\uff0c\u9060\u7a0b\u684c\u9762\u9023\u63a5\u5df2\u6210\u70ba\u4e00\u9805\u91cd\u8981\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f\u7ba1\u7406\u4f3a\u670d\u5668\u9084\u662f\u9032\u884c\u65e5\u5e38\u64cd\u4f5c\uff0c\u80fd\u5920\u65b9\u4fbf\u5730\u8a2a\u554f\u9060\u7a0b\u684c\u9762\u90fd\u662f\u4e00\u500b\u4e0d\u53ef\u6216\u7f3a\u7684\u529f\u80fd\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 CentOS \u7cfb\u7d71\u4e0a\u5b89\u88dd noVNC\uff0c\u4ee5\u4fbf\u901a\u904e Web \u700f\u89bd\u5668\u9032\u884c VNC \u9060\u7a0b\u9023\u63a5\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-novnc%ef%bc%9f-BiEomdRYQz\">\u4ec0\u9ebc\u662f noVNC\uff1f<\/h2>\n<p>noVNC \u662f\u4e00\u500b\u57fa\u65bc HTML5 \u7684 VNC \u5ba2\u6236\u7aef\uff0c\u5141\u8a31\u7528\u6236\u901a\u904e Web \u700f\u89bd\u5668\u8a2a\u554f VNC \u4f3a\u670d\u5668\u3002\u9019\u610f\u5473\u8457\u7528\u6236\u4e0d\u9700\u8981\u5b89\u88dd\u4efb\u4f55\u984d\u5916\u7684\u5ba2\u6236\u7aef\u8edf\u4ef6\uff0c\u53ea\u9700\u4f7f\u7528\u652f\u6301 HTML5 \u7684\u700f\u89bd\u5668\u5373\u53ef\u9032\u884c\u9060\u7a0b\u684c\u9762\u9023\u63a5\u3002\u9019\u5c0d\u65bc\u9700\u8981\u5728\u4e0d\u540c\u8a2d\u5099\u4e0a\u8a2a\u554f\u4f3a\u670d\u5668\u7684\u7528\u6236\u4f86\u8aaa\uff0c\u63d0\u4f9b\u4e86\u6975\u5927\u7684\u4fbf\u5229\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e5%89%8d%e7%9a%84%e6%ba%96%e5%82%99-BiEomdRYQz\">\u5b89\u88dd\u524d\u7684\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd noVNC \u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684 CentOS \u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86 VNC \u4f3a\u670d\u5668\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd TigerVNC \u4f3a\u670d\u5668\uff1a<\/p>\n<pre><code>sudo yum install tigervnc-server<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e VNC \u5bc6\u78bc\u548c\u914d\u7f6e VNC \u4f3a\u670d\u5668\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b8c\u6210\uff1a<\/p>\n<pre><code>vncpasswd<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-novnc-BiEomdRYQz\">\u5b89\u88dd noVNC<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u5c07\u5b89\u88dd noVNC\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 noVNC \u7684\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u514b\u9686 noVNC \u7684 GitHub \u5009\u5eab\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/novnc\/noVNC.git<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u9032\u5165 noVNC \u76ee\u9304\uff1a<\/p>\n<pre><code>cd noVNC<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u4e0b\u8f09 Websockify\uff0c\u9019\u662f\u4e00\u500b\u5c07 WebSocket \u8f49\u63db\u70ba VNC \u7684\u4ee3\u7406\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u514b\u9686 Websockify \u7684 GitHub \u5009\u5eab\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/novnc\/websockify.git<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-novnc-BiEomdRYQz\">\u914d\u7f6e noVNC<\/h2>\n<p>\u5728\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u914d\u7f6e noVNC\u3002\u9996\u5148\uff0c\u555f\u52d5 VNC \u4f3a\u670d\u5668\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>vncserver :1<\/code><\/pre>\n<p>\u9019\u5c07\u555f\u52d5\u4e00\u500b\u65b0\u7684 VNC \u6703\u8a71\uff0c\u4e26\u5206\u914d\u4e00\u500b\u986f\u793a\u865f\u78bc\uff08\u5728\u9019\u88e1\u662f :1\uff09\u3002\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u555f\u52d5 Websockify\uff0c\u5c07 VNC \u4f3a\u670d\u5668\u7684\u7aef\u53e3\u8f49\u767c\u5230 WebSocket\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>.\/websockify\/run 6080 localhost:5901<\/code><\/pre>\n<p>\u9019\u88e1\uff0c6080 \u662f WebSocket \u7684\u7aef\u53e3\uff0c\u800c 5901 \u662f VNC \u4f3a\u670d\u5668\u7684\u7aef\u53e3\uff085900 + \u986f\u793a\u865f\u78bc 1\uff09\u3002<\/p>\n<h2 id=\"%e8%a8%aa%e5%95%8f-novnc-BiEomdRYQz\">\u8a2a\u554f noVNC<\/h2>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f noVNC\u3002\u6253\u958b\u700f\u89bd\u5668\u4e26\u8f38\u5165\u4ee5\u4e0b\u5730\u5740\uff1a<\/p>\n<pre><code>http:\/\/:6080\/vnc.html<\/code><\/pre>\n<p>\u5728\u9801\u9762\u4e0a\uff0c\u60a8\u9700\u8981\u8f38\u5165 VNC \u5bc6\u78bc\uff0c\u7136\u5f8c\u9ede\u64ca\u300cConnect\u300d\u6309\u9215\u3002\u6210\u529f\u9023\u63a5\u5f8c\uff0c\u60a8\u5c07\u80fd\u5920\u770b\u5230\u9060\u7a0b\u684c\u9762\u4e26\u9032\u884c\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-BiEomdRYQz\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u5728 CentOS \u7cfb\u7d71\u4e0a\u6210\u529f\u5b89\u88dd noVNC\uff0c\u4e26\u901a\u904e Web \u700f\u89bd\u5668\u9032\u884c VNC \u9060\u7a0b\u9023\u63a5\u3002\u9019\u7a2e\u65b9\u6cd5\u4e0d\u50c5\u65b9\u4fbf\uff0c\u9084\u80fd\u63d0\u9ad8\u9060\u7a0b\u7ba1\u7406\u7684\u9748\u6d3b\u6027\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u9084\u662f\u5176\u4ed6\u5730\u5340\u7684\u670d\u52d9\uff0c\u60a8\u90fd\u53ef\u4ee5\u627e\u5230\u9069\u5408\u7684\u65b9\u6848\u4f86\u652f\u6301\u60a8\u7684\u696d\u52d9\u904b\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 CentOS \u4e0a\u5b89\u88dd noVNC\uff0c\u5be6\u73fe\u900f\u904e Web \u700f\u89bd\u5668\u9032\u884c VNC \u9060\u7a0b\u9023\u63a5\u7684\u7c21\u4fbf\u65b9\u6cd5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-44028","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=44028"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44028\/revisions"}],"predecessor-version":[{"id":44029,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44028\/revisions\/44029"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=44028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=44028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=44028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}