{"id":517,"date":"2015-04-22T09:13:28","date_gmt":"2015-04-22T01:13:28","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=517"},"modified":"2015-07-18T16:18:54","modified_gmt":"2015-07-18T08:18:54","slug":"%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5ubuntu-server-%e7%9a%84%e5%9b%be%e5%bd%a2%e7%95%8c%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/517.html","title":{"rendered":"\u8fdc\u7a0b\u8fde\u63a5Ubuntu Server \u7684\u56fe\u5f62\u754c\u9762"},"content":{"rendered":"<p><strong>\u65b9\u6cd5\u4e00\uff1a<\/strong><\/p>\n<p>\u5b89\u88c5xfce4\u56fe\u5f62\u684c\u9762\u73af\u5883\uff1a<\/p>\n<p><strong><span style=\"color: #ff0000;\">sudo apt-get install xfce4<\/span><\/strong><\/p>\n<p>\u5b89\u88c5vncserver\u670d\u52a1\uff1a<\/p>\n<p><span style=\"color: #ff0000;\"><strong>sudo apt-get install vnc4server<\/strong><\/span><\/p>\n<p>\u5b89\u88c5\u6210\u529f\u540e\uff0c\u5f00\u542fvnc\u670d\u52a1<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u8bbf\u95ee<span style=\"color: #ff0000;\"><strong>root\u7528\u6237<\/strong><\/span>\u7684\u684c\u9762\u73af\u5883\u5c31\u7528<strong><span style=\"color: #ff0000;\">sudo vncserver<\/span><\/strong>\uff0c\u5982\u679c\u8bbf\u95ee\u5f53\u524d\u666e\u901a\u7528\u6237\u7684\u73af\u5883\u5c31\u76f4\u63a5vncserver\u5373\u53ef\uff0c\u9996\u6b21\u542f\u52a8\u4f1a\u8981\u6c42\u8bbe\u7f6e\u5bc6\u7801\uff0c\u7528\u6765\u5728\u5ba2\u6237\u7aef\u8bbf\u95ee\u65f6\u4f7f\u7528\uff0c\u540e\u9762\u53ef\u4ee5\u4f7f\u7528vncpasswd \u4fee\u6539\u3002<\/p>\n<p>\u542f\u52a8vnc\u6210\u529f\u540e\uff0c\u4f1a\u5728\u4e3b\u76ee\u5f55\u4e0b\u4ea7\u751f\u4e00\u4e2a.vnc\u76ee\u5f55\u3002<\/p>\n<p>\u4fee\u6539.vnc\u4e2d\u7684xstartup\u6587\u4ef6\uff1a<strong><span style=\"color: #ff0000;\">(\u5982\u4e0d\u4fee\u6539\uff0cvnc\u8fde\u63a5\u540e\u53ea\u80fd\u663e\u793a\u7ec8\u7aef\uff0c\u4fee\u6539\u540e\u53ef\u4ee5\u7528xfce4\u663e\u793a)<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #0000ff;\"><em>#!\/bin\/sh<\/em><\/span><\/strong><\/p>\n<p><strong><span style=\"color: #0000ff;\"><em># Uncomment the following two lines for normal desktop:<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em># unset SESSION_MANAGER<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em># exec \/etc\/X11\/xinit\/xinitrc<\/em><\/span><\/strong><\/p>\n<p><strong><span style=\"color: #0000ff;\"><em>[ -x \/etc\/vnc\/xstartup ] &amp;&amp; exec \/etc\/vnc\/xstartup<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>[ -r $HOME\/.Xresources ] &amp;&amp; xrdb $HOME\/.Xresources<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>xsetroot -solid grey<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>vncconfig -iconic &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>#x-terminal-emulator -geometry 80x24+10+10 -ls -title \"$VNCDESKTOP Desktop\" &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>#x-window-manager &amp;<\/em><\/span><\/strong><\/p>\n<p><strong><span style=\"color: #0000ff;\"><em>sesion-manager &amp; xfdesktop &amp; xfce4-panel &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>xfce4-menu-plugin &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>xfsettingsd &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>xfconfd &amp;<\/em><\/span><\/strong><br \/>\n<strong><span style=\"color: #0000ff;\"> <em>xfwm4 &amp;<\/em><\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #339966;\"><strong>\u91cd\u542f\u8be5\u670d\u52a1\uff1a<\/strong><\/span><\/p>\n<p><strong><span style=\"color: #ff0000;\">vncserver -kill :1<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #ff0000;\">vncserver :1<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>\u5f00\u673a\u81ea\u52a8\u8fd0\u884c\uff1a<\/p>\n<p><span style=\"color: #ff0000;\"><strong>vim\u00a0\/etc\/init.d\/vncserver<\/strong><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><strong><em>#!\/bin\/bash<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>PATH=\"$PATH:\/usr\/bin\/\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>export USER=\"root\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>DISPLAY=\"1\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>DEPTH=\"16\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>GEOMETRY=\"1024x768\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>OPTIONS=\"-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>. \/lib\/lsb\/init-functions<\/em><\/strong><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><strong><em>case \"$1\" in<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>start)<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>log_action_begin_msg \"Starting vncserver for user '${USER}' on localhost:${DISPLAY}\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>su ${USER} -c \"\/usr\/bin\/vncserver ${OPTIONS}\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>;;<\/em><\/strong><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><strong><em>stop)<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>log_action_begin_msg \"Stoping vncserver for user '${USER}' on localhost:${DISPLAY}\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>su ${USER} -c \"\/usr\/bin\/vncserver -kill :${DISPLAY}\"<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>;;<\/em><\/strong><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><strong><em>restart)<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>$0 stop<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>$0 start<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>;;<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>esac<\/em><\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong><em>exit 0<\/em><\/strong><\/span><\/p>\n<p>\u8bbe\u7f6e\u6587\u4ef6\u6743\u9650 \u4e0e \u5f00\u542f\u670d\u52a1<br \/>\n<span style=\"color: #ff0000;\"><strong>chmod +x \/etc\/init.d\/vncserver &amp;&amp; service vncserver start<\/strong><\/span><\/p>\n<p><strong><span style=\"color: #ff0000;\">update-rc.d vncserver defaults<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u65b9\u6cd5\u4e8c\uff1a<\/strong>\uff08\u5df2\u7ecf\u4e0d\u7528\u4e86\uff0c\u5ba2\u6237\u7aef\u6bd4\u8f83\u5927\uff0c\u5728Windows 7\u4e0a\u65e0\u6cd5\u4f7f\u7528\uff09<\/p>\n<p>\u60f3\u8981\u8fdc\u7a0b\u8fde\u63a5\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u7684\u56fe\u5f62\u754c\u9762\u4e48\uff1f\u8fd9\u91cc\u6709\u4e2a\u7b80\u5355\u7684\u6307\u5bfc\u544a\u8bc9\u4f60\u5982\u4f55\u4f7f\u7528X2Go\u6765\u5b9e\u73b0\uff0c\u8fd9\u662f\u4e00\u4e2aNX\u8fdc\u7a0b\u684c\u9762\u534f\u8bae\u7684\u884d\u751f\u7248\u672c\u3002<br \/>\n\u4f60\u6240\u9700\u8981\u505a\u7684\u5c31\u662f\u5728\u670d\u52a1\u5668\u4e0a\u9762\u5b89\u88c5X2Go\u670d\u52a1\u7aef\u548c\u684c\u9762\u73af\u5883\uff0c\u5728\u5ba2\u6237\u673a\u4e0a\u5b89\u88c5X2Go\u7684\u5ba2\u6237\u7aef\u3002<br \/>\n\u5728Ubuntu\u670d\u52a1\u5668\u4e0a\u9762\u7684\u64cd\u4f5c\uff1a<br \/>\n\u53ef\u4ee5\u5728Ubuntu 14.04 LTS, Ubuntu 12.04 LTS \u548c Ubuntu 10.04 LTS \u901a\u8fc7PPA\u627e\u5230\u6700\u65b0\u7684X2Go\u670d\u52a1\u7aef\u7248\u672c\u3002\u5148\u8fde\u63a5\u4e0a\u4f60\u7684Ubuntu\u670d\u52a1\u5668\uff0c\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u5b89\u88c5PPA\u548c\u76f8\u5173\u7684\u5305\u3002<br \/>\n\u5728\u6dfb\u52a0PPA\u4e4b\u524d\uff0c\u9700\u8981\u5148\u5b89\u88c5\u8fd9\u4e2a add-apt-repository\uff1a<br \/>\n<span style=\"color: #ff0000;\"><strong>sudo apt-get install python-software-properties software-properties-common<\/strong><\/span><br \/>\n\u6dfb\u52a0PPA \uff1a<br \/>\n<strong><span style=\"color: #ff0000;\">sudo apt-add-repository -y ppa:x2go\/stable<\/span><\/strong><br \/>\n\u5237\u65b0\u5305\u5217\u8868\uff1a<br \/>\n<strong><span style=\"color: #ff0000;\">sudo apt-get update<\/span><\/strong><br \/>\n\u5b89\u88c5X2Go\u670d\u52a1\u5668\u7aef<br \/>\n<strong><span style=\"color: #ff0000;\">sudo apt-get install x2goserver x2goserver-xsession<\/span><\/strong><br \/>\n\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\u9762\u6211\u4f1a\u4f7f\u7528XFCE4\u4f5c\u4e3aUbuntu\u670d\u52a1\u5668\u7684\u684c\u9762\u73af\u5883\uff0c\u5b89\u88c5Xfce4 \uff1a<\/p>\n<p><strong><span style=\"color: #ff0000;\">sudo apt-get install xfce4<\/span><\/strong><br \/>\n\u6700\u540e\u6267\u884c reboot \u547d\u4ee4\u6765\u91cd\u542f\u670d\u52a1\u5668 \u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684Ubuntu\u670d\u52a1\u5668\u6ca1\u6709\u8bbe\u7f6e\u4e3b\u673a\u540d\uff0c\u5728\u8fde\u63a5\u7684\u65f6\u5019\u4f1a\u62a5\u9519\u3002\u56e0\u6b64\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u8bbe\u7f6e\u4e3b\u673a\u540d\uff0c\u628aplato\u66ff\u6362\u6210\u4f60\u9700\u8981\u7684\u540d\u5b57\uff1a<\/p>\n<p>echo \"plato\" &gt; \/etc\/hostname<br \/>\nhostname -F \/etc\/hostname<\/p>\n<p><strong><span style=\"color: #ff0000;\">Windows\u8fdc\u7a0b\u94fe\u63a5\u5de5\u5177\u4e0b\u8f7d<\/span><\/strong>\uff1ahttp:\/\/wiki.x2go.org\/doku.php\/doc:installation:x2goclient<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u5b89\u88c5Firefox<\/span><\/strong><\/p>\n<p>\u6253\u5f00\u7ec8\u7aef\uff1a<br \/>\nsudo add-apt-repository ppa:mozillateam\/firefox-next<br \/>\nsudo apt-get update<br \/>\nsudo apt-get install firefox<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u5b89\u88c5\u4e2d\u6587\u5b57\u4f53<\/span><\/strong>\uff1a<\/p>\n<p>#\u201c\u6587\u6cc9\u9a7f\u201d\u5b57\u4f53:<br \/>\n<strong><span style=\"color: #ff0000;\">sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd5\u4e00\uff1a \u5b89\u88c5xfce4\u56fe\u5f62\u684c\u9762\u73af\u5883\uff1a sudo apt-get install xfce4 \u5b89\u88c5vncser [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-517","post","type-post","status-publish","format-standard","hentry","category-Technical_literature"],"views":1645,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=517"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/517\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}