为Linux VPS服务器Ubuntu系统安装GUI桌面(XWindows Gnome)

第一、卸载和删除系统中不必要的软件

apt-get purge apache2* bind9* samba*

卸载不必要的软件,减少系统的资源占用提高利用率,卸载过程中会提示是否需要继续,输入y回车继续。

第二、升级系统环境和最新包及安装nano工具

apt-get update
apt-get upgrade
apt-get install nano

第三、安装桌面环境

apt-get install ubuntu-desktop

在安装过程中会提到选择国家、输入法键盘、以及编码等,我们可以直接全部回车。如下:

Choose console country from the list, for example.: USA
Select keyboard layout, for example.: USA
If asked, choose optional keyboard shortcut to switch keyboard languages, for example.: Alt + Shift
Choose console charset, for example.: UTF-8
Choose console font: .Combined – Latin; Slavic Cyrillic, Hebrew, basic Arabic

第四、设置Gnome和XWindows桌面环境

/etc/init.d/gdm start
dpkg-reconfigure xserver-xorg

第五、安装TightVNC

apt-get install tightvncserver

第六、设置VNC登陆密码

vncpasswd

然后需要输入两次密码,是看不到的,我们自己要看清楚不要输错。以及会有Would you like to enter a view-only password的提示,这里我输入n不需要设置。

然后顺带设置下窗口:

vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565

第七、设置Gnome的窗口管理器

一般默认时候,VNC服务器不是使用的Gnome的窗口管理器。为了使VNC服务器使用Gnome的窗口管理器默认情况下,我们应该配置如下文件。

nano ~/.vnc/xstartup

打开xstartup文件,检查x-window-manager这一行是不是#注释掉,如果不是请注释掉,如果已经注释就不要管了。然后在最后一行添加gnome-session & ,这样我们看到的所有脚本如下:

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session &

第八、设置开机启动

update-rc.d ssh defaults

第九、检查VNC是否在运行

ps aux | grep Xtightvnc

 

为Linux VPS服务器Ubuntu系统安装GUI桌面(XWindows Gnome)

如果有看到上图中的Xtightvnc: 1-desktop X-auth…提示,说明已经在运行。

第十、重启VPS生效

reboot

重启VPS之后,我们用VNC工具链接。如果无法链接,则需要先在SSH中执行下面脚本:

vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565

然后再去链接VNC工具登陆桌面。

教程

Apache使用.htaccess防盗链

2017-9-12 6:41:11

教程

Linux如何禁止系统内核Kernel自动升级避免不必要的麻烦

2018-5-26 8:27:39

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
搜索