上一篇在讲 VirtualBox 加强包安装的时候,由于没有在 CentOS 7 mini 没有图形界面组件,会出现一些错误,这篇讲讲如何在 mini 的基础上,把图形桌面安装上去。segmentfault
经过上篇操做,virtualbox 上的 CentOS 和宿主机之间已支持文件夹共享,仍是没法鼠标自由切换,主要是由于 CentOS mini 安装只有字符界面,不支持鼠标。还需对系统安装桌面系统。centos
首先列出如下当前已安装和支持安装的包组this
yum grouplist
可能会看到以下的显示:centos7
Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.163.com Installed Environment Groups: GNOME Desktop Available Environment Groups: Minimal Install Compute Node Infrastructure Server File and Print Server Basic Web Server Virtualization Host Server with GUI KDE Plasma Workspaces Development and Creative Workstation Available Groups: Compatibility Libraries Console Internet Tools Development Tools Graphical Administration Tools Legacy UNIX Compatibility Scientific Support Security Tools Smart Card Support System Administration Tools System Management Done
这个命令列出来的其实是centos7安装时提供的安装类型选项。Installed Environment Groups
为已安装的包组。spa
若是已安装包组里面没有GNOME Desktop
,直接执行下面命令unix
yum groupinstall ‘GNOME Desktop’
便可安装图形界面。
安装完毕,执行code
startx
启动图形界面。server
若是安装不成功,也能够尝试先进行 X 系统安装。以下:blog
If CentOS has already been installed without a graphical interface,
you can install this with the following commands:ci
yum groupinstall "X Window System" yum install gdm
If you would like this to be the default runlevel, you can edit
/etc/inittab and set the default level to 5 instead of 3:
vi /etc/inittab
Change:
id:3:initdefault:
To:
id:5:initdefault:
图形界面安装成功后,reboot 机器,并重装virtualbox 加强包
cd /media/cdrom ./VBoxLinuxAdditions.run
原本本文还介绍了 VNC 的安装配置,鉴于这个内容和本篇文章不是很搭,因此单独出来了。
如有兴趣的,点击《CentOS 上安装配置 VNC 服务》穿越。
到这里,个人《CentOS7 在 VirtualBox 上的安装配置》系列暂告一段落。辛辛苦苦截图码字很不容易哦,这也是我发在 SF 上的第一个系列文章,喜欢的朋友记得推荐点赞哦。? ?
顺便放出写本系列文章的时候,Google 到的一些参考文章。