阿里云云服务器ECS实例提供的公共Linux系统镜像,基于性能及通用性等因素的考虑,默认不安装图形化桌面组件。若您需要为Linux实例安装图形化界面,可参考本文进行操作。
安装图形化桌面会降低服务器的性能,若安装不当,则会导致操作系统无法正常启动。请在安装之前,为ECS实例创建快照,做好数据备份,请参见创建一个云盘快照。下列操作本文以CentOS 8、CentOS 7、Ubuntu 14操作系统为例,其它发行版的配置可能有所差异,具体情况请参阅相应发行版的官方文档。
说明:CentOS 6与CentOS 8操作系统版本结束了生命周期(EOL),按照社区规则,CentOS 6/8的源地址内容已移除。当您在CentOS 6/8系统内继续使用默认配置的源地址时会发生报错。建议您先切换CentOS 6/8的源地址,然后再进行操作。具体操作,请参见CentOS 6 EOL如何切换源?和CentOS 8 EOL如何切换源?。
此处以安装MATE桌面环境为例,步骤如下:
yum -y upgrade
yum groups install "X Window System"
yum groups install "MATE Desktop"
systemctl set-default graphical.target
说明:您也可以在ECS管理控制台中重启ECS实例,请参见重启实例。
reboot
CentOS 8操作系统安装图形化桌面的方法,请参见CentOS 8系统安装图形化界面。
此处以安装GNOME桌面环境为例,步骤如下:
apt-get update
apt-get install x-window-system-core
apt-get install gnome-core
startx
安装图形化桌面后,ECS实例可能出现以下常见问题,此处分别介绍这些常见问题的现象、问题原因和解决方法。
yum install xorg-x11-drv-evdev
/etc/X11/xorg.conf
配置文件。
Xorg -configure
cp xorg.conf.new /etc/X11/xorg.conf
/etc/X11/xorg.conf
配置文件,将鼠标和键盘驱动类型修改为“evdev”。
Identifier "Keyboard0"修改前的配置文件类似如下。
Driver "evdev" #修改为 evdev
Option "Device" "/dev/input/event3"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "evdev" #修改为 evdev
Option "Device" "/dev/input/event5"
Option "Mode" "Absolute"
EndSection
"You are currently trying to run as the root super user. The super user is a specialized account that is not designed to run a normal user session. Various programs will not function properly, and actions performed under this account can cause unrecoverable damage to the operating system."
chkconfig --level 35 messagebus on
chkconfig --level 35 haldaemon on
说明:建议您将启动级别修改为“Level 3”,然后通过startx
命令启动桌面环境,测试桌面环境的可用性。当出现问题时,您还可以切换到终端模式进行问题排查和处理。最后,在确保桌面环境启动无误后,再将启动级别修改为“Level 5”。