云服务器 ECS Linux 系统安装图形化桌面

来源:互联网 发布:淘宝店名片设计 编辑:程序博客网 时间:2024/04/30 02:41

安装云服务器 ECS CentOS 7 图形化桌面

以安装 MATE 桌面环境为例:

  1. 登录服务器,执行命令 yum groups install "X Window System"安装 X Window System。

  2. 执行命令 yum groups install "MATE Desktop"安装 MATE Desktop。

  3. 执行命令 systemctl set-default graphical.target 设置默认通过桌面环境启动服务器。

  4. 执行命令 reboot 重启服务器,您也可以在云服务器 ECS 控制台重启服务器。

  5. 通过云服务器 ECS 控制台管理终端连接服务器,测试验证安装情况。

    testing

安装云服务器 ECS Ubuntu 14.04 64 bit 图形化桌面

  1. 通过云服务器 ECS 控制台管理终端连接服务器,执行如下命令安装桌面环境软件包:

    1. apt-get install x-window-system-core
    2. apt-get install gnome-core
    3. apt-get install gdm
  2. 安装完成后,执行命令 startx 启动图形化桌面。登录服务器效果如下图所示:

    start

常见问题

CentOS 安装图形化桌面后无法使用键盘和鼠标

  • 现象:桌面环境安装好后,通过云服务器 ECS 控制台管理终端连接服务器,发现无法使用鼠标和键盘。

  • 分析:该问题可能是由于键盘和鼠标驱动异常所致

  • 解决:尝试将驱动修改为 evdev。

    1. 执行命令 yum install xorg-x11-drv-evdev安装 evdev

    2. 执行命令 Xorg -configure 创建 /etc/X11/xorg.conf 配置文件。

    3. 执行命令 cp xorg.conf.new /etc/X11/xorg.conf 复制 X11 配置文件。

    4. 修改配置文件 /etc/X11/xorg.conf 的鼠标和键盘驱动为 evdev,如下图所示:

      1. Section "InputDevice"
      2. Identifier "Keyboard0"
      3. Driver "evdev" #修改为 evdv
      4. Option "Device" "/dev/input/event3"
      5. EndSection
      6. Section "InputDevice"
      7. Identifier "Mouse0"
      8. Driver "evdev" #修改为 evdv
      9. Option "Device" "/dev/input/event5"
      10. Option "Mode" "Absolute"
      11. EndSection

    5. 重启服务器,测试验证鼠标和键盘使用情况。

CentOS 系统默认关闭 messagebus 无法使用 Gnome

  • 现象:按照正常流程安装 Gnome 桌面环境在云服务器 ECS CentOS 系统后,发现无法重启登录系统。输入账户,密码后,系统提示如下:

    "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."

  • 分析:可能是桌面环境的 messgebus 和 haldaemon 服务没有自动启动所致。为了提高系统性能和稳定性,默认情况下,云服务器 ECS Linux 官方公共镜像未自动启动messgebus 和 haldaemon 服务。

  • 解决:产生该错误时,您无法做任何操作,可以尝试如下方式解决问题:

    1. 通过历史快照回滚系统。
    2. 重新安装桌面环境。
    3. 执行以下命令,修改 messgebus 和 haldaemon 服务为自启动:

      1. chkconfig --level 35 haldaemon on
      2. chkconfig --level 35 messagebus on

      建议:保险起见,建议您将启动级别修改为 Level 3,然后通过 startx 命令启动桌面环境,测试桌面环境的可用性。当出现问题时,您还可以切换到终端模式进行问题排查和处理。最后,在确保桌面环境启动无误后,再将启动级别修改为 Level 5。