virtualBox+Vagrant安装centos7加图像化界面
参考网址:
virtualbox+vagrant 安装 centos7 步骤
https://editor.csdn.net/md/?articleId=122191015
centos7安装图形化界面图文详解
https://blog.csdn.net/weixin_45115705/article/details/100553983?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165271831316781667826227%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=165271831316781667826227&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2alltop_positive~default-1-100553983-null-null.142v9control,157v4control&utm_term=centos7%E5%AE%89%E8%A3%85%E5%9B%BE%E5%BD%A2%E5%8C%96%E7%95%8C%E9%9D%A2&spm=1018.2226.3001.4187
设置启动图像化界面
https://blog.csdn.net/qq_42698422/article/details/110201513
前置准备
本地已经安装好 virtualbox , vagrant
并且本地已经安装 centos7 镜像
启动镜像
vagrant up
-@MSI MINGW64 /d/java-soft/vagrant-box/centos7
$ vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Checking if box ‘centos/7’ version ‘2004.01’ is up to date…
==> default: Clearing any previously set forwarded ports…
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports…
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running ‘pre-boot’ VM customizations…
==> default: Booting VM…
==> default: Waiting for machine to boot. This may take a few minutes…
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM…
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces…
==> default: Rsyncing folder: /cygdrive/d/java-soft/vagrant-box/centos7/ => /vagrant
==> default: Machine already provisioned. Runvagrant provision
or use the--provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.
进入 centos7 虚拟机
vagrant ssh
su root
-@MSI MINGW64 /d/java-soft/vagrant-box/centos7
$ vagrant ssh
Last login: Thu Jan 20 12:34:45 2022 from 10.0.2.2
[vagrant@localhost ~]$ su root
Password:
[root@localhost vagrant]#
开始安装
写在安装前:
如果你的centos7是最小化安装的那默认都是不带X WINDOWS的,那在安装图形化界面之前,你得先安装一下X WINDOWS,这个控制功能
yum groupinstall "X Window System" -y
1.输入安装命令
yum groupinstall -y "GNOME Desktop"
重点说明
#1.此过程会联网安装图形化界面,所需时间比较长
#2.一定到安装完成,卡了,重启之后需要重新安装,进度条要安装1138多项
#3.不显示进度,先按任意键看是否可以显示,不行的化在看下面4;
#4.按ctrl+c,重新安装,即重新执行上面的命令;*
检查是否安装GNOME
yum grouplist | grep GNOME
[root@localhost vagrant]# yum grouplist | grep GNOME
GNOME Desktop
到此证明 图像化界面安装成功!!!!
启动GNOME图像界面
从命令行启动GNOME只需要输入startx命令即可:
startx
设置启动运行模式
systemctl get-default
#查看默认值启动值,同样适用于ubuntu系统
#输出multi-user.target
# 修改为graphical.target:
systemctl set-default graphical.target
#reboot重启即可进入GNOME;会需要等待一会
到此 centos7 虚拟机图形化界面安装成功!!!!