Centos 7.6.1810 由命令行模式改为图形界面模式

时间:2024-05-21 13:00:40

#查看版本号:
[[email protected] etc]# cat system-release
CentOS Linux release 7.6.1810 (Core)

1、按照如下教程进行了安装
https://www.linuxidc.com/Linux/2018-04/152000.htm

2、输入startx,出现了如下提示
[[email protected] ~]# startx
xauth: file /root/.serverauth.34625 does not exist

X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
Build Operating System: 3.10.0-957.1.3.el7.x86_64
Current Operating System: Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-862.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8
Build Date: 14 March 2019 10:37:36AM
Build ID: xorg-x11-server 1.20.1-5.3.el7_6
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, () default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(
) Log file: “/var/log/Xorg.0.log”, Time: Wed Jun 12 14:38:15 2019
() Using config file: “/etc/X11/xorg.conf”
(
) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

3、根据错误提示“xauth: file /root/.serverauth.34625 does not exist
”百度找到这篇文章:https://blog.****.net/tianshuhao/article/details/89304978

4、运行yum -y update

升级所有包同时也升级软件和系统内核

5、运行startx,仍然不行
[[email protected] ~]# startx
xauth: file /root/.serverauth.34889 does not exist

X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
Build Operating System: 3.10.0-957.1.3.el7.x86_64
Current Operating System: Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-862.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8
Build Date: 14 March 2019 10:37:36AM
Build ID: xorg-x11-server 1.20.1-5.3.el7_6
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, () default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(
) Log file: “/var/log/Xorg.0.log”, Time: Wed Jun 12 14:51:44 2019
() Using config file: “/etc/X11/xorg.conf”
(
) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

6、根据日志Log file: "/var/log/Xorg.0.log"中的描述,推断可能是驱动程序问题。

[ 85.350] (II) evdev: VirtualPS/2 VMware VMMouse: Close
[ 85.350] (II) UnloadModule: “evdev”
[ 85.351] (II) evdev: VirtualPS/2 VMware VMMouse: Close
[ 85.351] (II) UnloadModule: “evdev”
[ 85.351] (II) evdev: AT Translated Set 2 keyboard: Close
[ 85.351] (II) UnloadModule: “evdev”
[ 85.351] (II) evdev: VMware VMware Virtual USB Mouse: Close
[ 85.351] (II) UnloadModule: “evdev”
[ 85.351] (II) evdev: Power Button: Close
[ 85.351] (II) UnloadModule: “evdev”
[ 85.360] (II) Server terminated successfully (0). Closing log file.

7、百度查找原因,需要安装vmtools。

8、根据官方文档安装vmtools
https://docs.vmware.com/cn/VMware-Workstation-Pro/12.0/com.vmware.ws.using.doc/GUID-08BB9465-D40A-4E16-9E15-8C016CC8166F.html

9、运行 ./vmware-install.pl发现出错了
[[email protected] vmware-tools-distrib]# ./vmware-install.pl
./vmware-install.pl: ./vmware-install.real.pl: /usr/bin/perl: 坏的解释器: 没有那个文件或目录

10、百度发现缺少了perl,运行yum install perl -y+回车

11、运行 ./vmware-install.pl,可以正常执行。

12、出现错误What is the location of the “ifconfig” program on your
machine?发现没有安装net-tools,执行yum install net-tools -y

13、出现错误What is the location of the gcc program on your machine? 发现缺少gcc,运行yum install gcc -y

14、继续执行 ./vmware-install.pl,出现错误Enter the path to the kernel header files for the 3.10.0-957.21.2.el7.x86_64 ,运行yum -y install kernel-devel 升级Kernel-devel

15、继续执行 ./vmware-install.pl,除了第一个选项执行yes,其他选项全部回车即可。直到出现以下字样:
Enjoy,

–the VMware team

16、运行startx,根据出现的错误信息xinit: connection to X server lost,百度找到这篇文章:https://blog.****.net/miner_k/article/details/65634959

17、运行 yum -y groupinstall “GNOME Desktop” -y,经过漫长的等待,终于安装完了。

18、运行startx,终于看到这个界面了。
Centos 7.6.1810 由命令行模式改为图形界面模式