##################################################
目录
VMware 16 + CentOS 7、GNOME、配置 ibus 中文输入、Open Java 1.8 以及虚拟机增强工具
VMware 16 + CentOS 7、GNOME、配置 ibus 中文输入
##################################################
VMware 16 + CentOS 7、GNOME、配置 ibus 中文输入、Open Java 1.8 以及虚拟机增强工具
——————————
打开 VMware 16
![主界面](https://i-blog.csdnimg.cn/blog_migrate/aaa9f9bc0f19766001c4bbc98020ba56.png)
——————————
配置虚拟机硬件环境
%%%%%
典型安装
![典型安装](https://i-blog.csdnimg.cn/blog_migrate/8f872c76af486f909f8109badfb05fb8.png)
%%%%%
稍后安装操作系统
![稍后安装操作系统](https://i-blog.csdnimg.cn/blog_migrate/facca7fefe482f7244961dceb030672f.png)
%%%%%
安装客户机系统
客户机操作系统:
Linux
版本:
CentOS 7 64 位
![安装客户机系统](https://i-blog.csdnimg.cn/blog_migrate/e8bea27016afd3091321c1cb852a8314.png)
%%%%%
命名虚拟机
虚拟机名称:
CentOS_7_GNOME+Java+ibus
位置:
E:\VM-OS\CentOS_7_GNOME+Java+ibus
![命名虚拟机](https://i-blog.csdnimg.cn/blog_migrate/3a59a615dc907790ba733ec4396a873d.png)
%%%%%
指定磁盘容量
最大磁盘大小:
10 G
勾选:
将虚拟磁盘存储为单个文件
![指定磁盘容量](https://i-blog.csdnimg.cn/blog_migrate/2a6d581c798eb88ba6ca5fbc3fd420bc.png)
%%%%%
已经准备好创建虚拟机
点击
自定义硬件
![已经准备好创建虚拟机](https://i-blog.csdnimg.cn/blog_migrate/979375daa4d4291a9744b2a74a36aa5a.png)
移除
声卡
打印机
USB 控制器
网络适配器
内存
1024 M
CPU
1 个处理器
2 个内核
虚拟化引擎全部开启
CD/DVD
使用 ISO 映像文件
映像文件为 CentOS-7-x86_64-DVD-2009.iso
点击
完成
![已经准备好创建虚拟机](https://i-blog.csdnimg.cn/blog_migrate/0f18821aecafd101e92edc1bd9edd1da.png)
%%%%%
虚拟机创建完毕
![虚拟机创建完毕](https://i-blog.csdnimg.cn/blog_migrate/7c1824fbac5afa9b77e06aade2c183a1.png)
——————————
VMware 虚拟机怎么进 BIOS 设置第一启动项
除了
打开电源时进入固件
虚拟机启动时也说了:
Press F2 to enter SETUP F2 进入 BIOS 设置
F12 for Network Boot F12 用于网络引导
ESC for Boot Menu ESC 选择启动设备
![没人注意过的虚拟“主板”](https://i-blog.csdnimg.cn/blog_migrate/eb550364654415a8042f483c903b3f25.png)
除了 F2 进入 BIOS 设置第一启动设置
![F10 保存设置第一启动设备为硬盘](https://i-blog.csdnimg.cn/blog_migrate/a1256dac6291d5982e5c6e98f255124f.png)
还可以在此界面按下 ESC 在启动菜单手动选择启动设备:
![启动菜单](https://i-blog.csdnimg.cn/blog_migrate/0179619f50ad23278a1d075e37e48211.png)
这边我们选择的光盘启动。
——————————
VMware 16 + CentOS 7、GNOME、配置 ibus 中文输入
%%%%%
光盘引导进入 Live DVD 系统
倒计时界面选择第一项安装 CentOS 7
![Install CentOS 7](https://i-blog.csdnimg.cn/blog_migrate/ea56530844a3c5c5bc7270639c2bf2d9.png)
%%%%%
按回车开始安装
按 <ENTER> 键开始安装过程:
![Press the <ENTER> key to begin the installation process.](https://i-blog.csdnimg.cn/blog_migrate/4b5c17da49b692baa9cab636f7139890.png)
![正在启动](https://i-blog.csdnimg.cn/blog_migrate/c9e2cc242719914a7657af737a823c67.png)
![Staring installer, out moment...](https://i-blog.csdnimg.cn/blog_migrate/67824a7ebba0f770bdef2122fa6cfbb6.png)
进入安装界面 这其实是一个 Live 系统
选择安装过程中使用的语言 这边选择:
中文
简体中文
![欢迎使用 CentOS 7](https://i-blog.csdnimg.cn/blog_migrate/51f5a76e65c637c9fd07d42381894a14.png)
继续后跳到安装配置主界面:
![安装信息摘要](https://i-blog.csdnimg.cn/blog_migrate/050b3a468625bff106886d90a2ee2c4f.png)
关于安装主界面:
本地化
日期和时间
键盘
系统支持的语言
软件
安装源
软件选择
系统
安装位置
KDUMP 内核崩溃转储机制
网络和主机名
SECURIY POLOCY 安全策略
![主界面](https://i-blog.csdnimg.cn/blog_migrate/ae3e98c4c47bae7f6c5ac385dbc41c0a.png)
%%%%%
本地化
配置好日期和时间 点击完成:
![日期和时间](https://i-blog.csdnimg.cn/blog_migrate/0ca9e29f40e3f3eee45c15d2c52728fa.png)
键盘布局 默认:
![键盘布局](https://i-blog.csdnimg.cn/blog_migrate/5701e5d4dcc262e10faddef6894e959e.png)
语言支持 安装界面选择什么语言这边就默认什么语言系统:
![简体中文 (中国)](https://i-blog.csdnimg.cn/blog_migrate/ae7be977184418f6bd3efa9b3378a4e8.png)
不过还是勾选支持 英语/English (United States)
![English (United States)](https://i-blog.csdnimg.cn/blog_migrate/6dc7d27b02e1dec7e71615477ce3ce9a.png)
本地化设置完毕:
![本地化设置](https://i-blog.csdnimg.cn/blog_migrate/5ac54acf00f8b41565e763191f11822d.png)
%%%%%
软件
安装源 默认就好 sr0 是第一个光驱 除非你要联网镜像服务器下载安装:
![默认 sr0](https://i-blog.csdnimg.cn/blog_migrate/31f1518a0b7c9fa1ed7727f7261487bb.png)
当然 你对镜像文件有没有什么毛病也不是很放心 所以可以选择校验:
![介质校验](https://i-blog.csdnimg.cn/blog_migrate/e898f0316d8015b47e11890adc45b0f5.png)
正在校验介质 请稍后:
![正在校验介质 请稍后](https://i-blog.csdnimg.cn/blog_migrate/74e8a49b86f1d285946fbcafbad35b83.png)
这玩意儿实在是有点慢了:
![正在校验介质](https://i-blog.csdnimg.cn/blog_migrate/a5ace5e83aab09fc00ea22346db0d3c6.png)
校验完毕 此介质正常 可以用于安装:
![此介质正常](https://i-blog.csdnimg.cn/blog_migrate/a23b6aa189da09ae94ab1261523731f6.png)
当然你也可以选择本地磁盘上的 ISO 文件如果你的硬盘上有操作系统分区的话:
![本地 ISO 文件](https://i-blog.csdnimg.cn/blog_migrate/2a9115fec6221a21d5705e4d2eff0033.png)
然后就可以选择本地操作系统上的 ISO 映像文件 明白为什么说这是 Live 系统上的安装程序了吗?
![本地 ISO 映像文件选择](https://i-blog.csdnimg.cn/blog_migrate/5db5dea87ddbf644c85a7c1bde06a424.png)
当然可以选择额外软件仓库 有很多协议 可以联网选择:
![有很多协议供你选择额外仓库](https://i-blog.csdnimg.cn/blog_migrate/661b9034b97ed881801ae7af6c9c1363.png)
软件选择界面:
![软件选择](https://i-blog.csdnimg.cn/blog_migrate/af98cc5fe1d856782afba2cb3d8da1e1.png)
软件选择
带 GUI 的服务器
就是 GUI 桌面 默认是 Gnome 当然你也可以在附加选项中选择安装一个 KDE
![带 GUI 的服务器](https://i-blog.csdnimg.cn/blog_migrate/6ceccd37eeb228705e6e38381561166f.png)
这边仅仅选择 Java 平台 和 基本开发工具 :
Java 平台
开发工具
![Java 平台+开发工具](https://i-blog.csdnimg.cn/blog_migrate/9d6368bf7de956b6720ce876343a077a.png)
正在检查依赖:
![检查依赖](https://i-blog.csdnimg.cn/blog_migrate/0b2b359967575044b84024fcd52b11dc.png)
依赖检查完毕:
![依赖检查完毕](https://i-blog.csdnimg.cn/blog_migrate/a96291553bcb1c59abdd7702fdcf2c66.png)
软件也配置完毕:
![配置完毕](https://i-blog.csdnimg.cn/blog_migrate/9670c2a6280b6598459d514062980123.png)
%%%%%
系统
先把 KDUMP 关了
系统坏了我们就重装或者恢复快照 内核转储有点占内存:
![取消 启用 KDUMP](https://i-blog.csdnimg.cn/blog_migrate/5cf228fb74e6382feb7483686158a8db.png)
网络和主机名
因为移除了网卡 所以没有任何网络设备:
![网络和主机名](https://i-blog.csdnimg.cn/blog_migrate/0e3855ee3bf708eec31cfe8b0ea80538.png)
主机名 这边设置
CentOS
点击 应用:
![](https://i-blog.csdnimg.cn/blog_migrate/918e745f168b42e5fe4d3610fee11994.png)
%%%%%
系统/分区
安装位置
![选择硬盘](https://i-blog.csdnimg.cn/blog_migrate/142521253d8ccfe89c948012ddd524a1.png)
勾选硬盘 然后勾选:
我要配置分区
![手动分区](https://i-blog.csdnimg.cn/blog_migrate/9c8b4887d7ec048f687d565398fe0471.png)
将新建分区更改为 标准分区
![标准分区](https://i-blog.csdnimg.cn/blog_migrate/e576e154c723a5f8b9dd89c98e48cf17.png)
交换分区給 1 G 意思意思就行了 毕竟不是真实开发环境 能跑 GUI 桌面就成:
![swap 1024 MB](https://i-blog.csdnimg.cn/blog_migrate/280a8934c2149bf7fbb0cac6b15720c3.png)
根分区 挂载点选择好后直接
添加挂载点
将第一块硬盘剩下的空间全部分配給她
![根分区](https://i-blog.csdnimg.cn/blog_migrate/d4141eadf14ecca0040d772164b9e44e.png)
默认文件系统是 xfs
![xfs 文件系统](https://i-blog.csdnimg.cn/blog_migrate/d83694974a53de46f5036119aa7e37b2.png)
xfs 文件系统基本都是服务器用 说实话 ext4 比较适合我 毕竟使用惯了:
![格式化成 ext4](https://i-blog.csdnimg.cn/blog_migrate/64b5083937b2c0e642a9675546f4d59c.png)
接受更改:
![接受更改](https://i-blog.csdnimg.cn/blog_migrate/9b97137e84d6b0d2a58db2cd659dc687.png)
系统也配置完毕:
![系统配置完毕](https://i-blog.csdnimg.cn/blog_migrate/815fa9f29706b40f97cd52d4763857b9.png)
%%%%%
开始安装
点击开始安装!
![正在设置安装环境](https://i-blog.csdnimg.cn/blog_migrate/e0b9668e667f01be6e37045f16c68048.png)
![正在 /dev/sda1 上创建文件系统 ext4](https://i-blog.csdnimg.cn/blog_migrate/61f80ae7e285ff777dca8dc06d947932.png)
![正在启动软件包安装进程](https://i-blog.csdnimg.cn/blog_migrate/c784216df3ef69ecf5ba48984c7564f6.png)
设置 管理员 密码:
![root 密码](https://i-blog.csdnimg.cn/blog_migrate/c1eb01b796136e17903cde1f9818003e.png)
创建普通用户
![创建用户](https://i-blog.csdnimg.cn/blog_migrate/4f1604a49684eec72f74d2702c59202a.png)
第一个安装的软件竟然是 grub2 引导程序:
![正在安装 grub2-common (3/1402)](https://i-blog.csdnimg.cn/blog_migrate/cda41f72f24abbda22cedea2272d5191.png)
![正在安装 kernel (718/1402)](https://i-blog.csdnimg.cn/blog_migrate/a4e995f9ae5b23094aa951841708ae49.png)
开始安装 java 了!!!
![正在安装 java-1.8.0-openjdk-headless (812/1402)](https://i-blog.csdnimg.cn/blog_migrate/82f00eab4bfe35533bc9432f02a9a82b.png)
看到火狐浏览器了!
![正在安装 firefox (1222/1402)](https://i-blog.csdnimg.cn/blog_migrate/7ca5b696dcbf2a40b4f110c014b4012f.png)
软件基本安装完毕 正在进行设置:
![正在执行安装后设置](https://i-blog.csdnimg.cn/blog_migrate/7757edee09965038a47a8c45775c19a1.png)
![正在生成 initramfs](https://i-blog.csdnimg.cn/blog_migrate/54a208128fdfad6213571a852381b587.png)
安装完成!
![安装完成!](https://i-blog.csdnimg.cn/blog_migrate/92af031b8c3a0da9fd38cf4895cd0626.png)
看到熟悉的引导界面:
![grub 引导界面](https://i-blog.csdnimg.cn/blog_migrate/95dd5adc56b9c0d0d8e72833197080ae.png)
正在启动:
![启动 ing...](https://i-blog.csdnimg.cn/blog_migrate/a0b0e60201d310e2f4db7e60855402ff.png)
%%%%%
初始设置
![初识设置](https://i-blog.csdnimg.cn/blog_migrate/350cbfa6f30e0d8810bc83eb364470e7.png)
接受许可信息:
![许可证](https://i-blog.csdnimg.cn/blog_migrate/48d4c381d11627a5b112c5b5ca22f28c.png)
主机名之前设置好了 现在不用管 默认就行:
![主机名](https://i-blog.csdnimg.cn/blog_migrate/649bff3b78263961cf94db65817325e2.png)
点击 完成配置
![点击 完成配置](https://i-blog.csdnimg.cn/blog_migrate/0eb552a9d11a2406fb59373750a83572.png)
![GNOME 登录器](https://i-blog.csdnimg.cn/blog_migrate/7feee2324b2f7a6fee6349f5a6f107f1.png)
普通用户 USER/lilian 登录:
![以普通用户身份登入系统](https://i-blog.csdnimg.cn/blog_migrate/29a8c736433f1fd4549213ff54bc85d4.png)
登录成功:
%%%%%
首次登录配置
开始首次登录配置了:
![欢迎](https://i-blog.csdnimg.cn/blog_migrate/c8a5b3d3513992c46a25a941ffdd8a3e.png)
选择 汉语:
![汉语](https://i-blog.csdnimg.cn/blog_migrate/806c8168e58da2486bebe6d745a81d3c.png)
点击最下面的更多配置 进入输入配置:
![汉语](https://i-blog.csdnimg.cn/blog_migrate/e93119d38ccfa4e18aff21a0331a8682.png)
配置键盘输入为
汉语 (Intelligent Pinyin)/汉语 (智能拼音)
![汉语 (Intelligent Pinyin)](https://i-blog.csdnimg.cn/blog_migrate/649e216784662da335b6738db909e667.png)
点击前进 进入隐私设置:
![隐私](https://i-blog.csdnimg.cn/blog_migrate/8479e6670e1074d6f25911269294ed15.png)
关掉位置服务:
![关掉位置](https://i-blog.csdnimg.cn/blog_migrate/4090897cfa811070e069ae378fc386ff.png)
再次前进 在线账号 点击跳过:
![在线账号](https://i-blog.csdnimg.cn/blog_migrate/b21f24bd21bccbe943b399c210c13f53.png)
准备好了:
![准备好了](https://i-blog.csdnimg.cn/blog_migrate/14e309c68bb47a5d82131abfffff952f.png)
又弹出帮助视频界面:
Windows 空格 调出输入法 可以输入汉字!
![中文输入!](https://i-blog.csdnimg.cn/blog_migrate/c5bf55aeb314394f43787ae37aa55e0b.png)
可以输入中文:
![中文输入](https://i-blog.csdnimg.cn/blog_migrate/d946eddc8b04b83f5b0d5e40b6695b21.png)
%%%%%
英文 GUI 配置中文
这次在英文环境下配置中文输入法
以 root 登录系统:
![管理员账户](https://i-blog.csdnimg.cn/blog_migrate/986e3015dd14cd40b616712497ae563e.png)
这次选择英文环境:
![Welcome](https://i-blog.csdnimg.cn/blog_migrate/aa9065355706f0cbfc3bb0a2fa6c722d.png)
按键默认是 Chinese
![Typing](https://i-blog.csdnimg.cn/blog_migrate/86de724f14ce66980efa04c96d2b2e24.png)
选择 English (US)
![English (US)](https://i-blog.csdnimg.cn/blog_migrate/38cefa147657b229c8954c81e2c5b0ff.png)
同样 关掉位置服务:
![Privary](https://i-blog.csdnimg.cn/blog_migrate/47c0dd88f2f9b6e210185582aa9c6ee5.png)
同样跳过在线账号:
![Online Accounts](https://i-blog.csdnimg.cn/blog_migrate/2b384aebcff8ad10a422d008f0fdb078.png)
准备好了:
![Ready to go](https://i-blog.csdnimg.cn/blog_migrate/dca8c1dd232930c982b1bf1a9da72d6c.png)
关掉帮助:
![Getting Started](https://i-blog.csdnimg.cn/blog_migrate/d30e9e89cc7d37ac93bf9816e3fcfe7f.png)
Windows + 空格 切换半天也不能输入汉字:
点击打开设置界面:
区域和语言页:
![Region & Language](https://i-blog.csdnimg.cn/blog_migrate/28c8f49b12757d43d65d508e002ec806.png)
点击加号添加输入源为 汉语 (中国):
![添加输入源](https://i-blog.csdnimg.cn/blog_migrate/5f22359db4216eb13732724b325ab559.png)
选择 汉语 Intelligent Pinyin 添加:
![Intelligent Pinyin](https://i-blog.csdnimg.cn/blog_migrate/1ec94c91cc042d9dc5db71b44b006593.png)
输入源配置完毕:
![输入源配置完毕](https://i-blog.csdnimg.cn/blog_migrate/bf7ff665bfaf681966c70c06cb85c652.png)
可以输入汉字:
![我还是好喜欢你](https://i-blog.csdnimg.cn/blog_migrate/7183cb16d0cd864c7b714d696abb48b7.png)
反手就是一个 poweroff 关机!
![poweroff](https://i-blog.csdnimg.cn/blog_migrate/8ac0f948dac183eecb53b6b149a17403.png)
%%%%%
Open Java 1.8
添加一块网卡:
![添加网卡](https://i-blog.csdnimg.cn/blog_migrate/0b34f7196f8f819356bd386ef427ccc8.png)
共享主机 IP 地址:
![NAT 模式](https://i-blog.csdnimg.cn/blog_migrate/014a3115b557db9b73b5cb7238b434b6.png)
启动虚拟机:
![CentOS 7](https://i-blog.csdnimg.cn/blog_migrate/b228925b92136c22ef4c7baa8f3d0599.png)
jdk 安装环境不全,缺少必要的 jar 包:
![java -version](https://i-blog.csdnimg.cn/blog_migrate/1475770bd90a8841df41aecac5bff38d.png)
两个版本的 jdk
默认是 JDK 1.8
确定可以连接网络 切换管理员用户:
安装 Java 开发环境必须的包:
![yum install java-devel](https://i-blog.csdnimg.cn/blog_migrate/b144dde9c926b85c6366c5e1e071c3af.png)
需要安装的包 输入 y 确认下载:
正在下载:
下载完成 是否安装 先不要继续:
先去备份下载的包:
/var/cache/yum/x86_64/7/updates/packages/
![/var/cache/yum/x86_64/7/updates/packages/](https://i-blog.csdnimg.cn/blog_migrate/f9eb216daa219224c465e2ee08b7335b.png)
备份好了:
![CentOS7-JDK1.8.tar.gz](https://i-blog.csdnimg.cn/blog_migrate/153fa168037ef61a129dda151140b0d9.png)
输入 y 继续安装:
安装完毕:
![jdk 1.8 开发环境](https://i-blog.csdnimg.cn/blog_migrate/9d4477f70411fa48003b50ab46e406c2.png)
这下 javac 可以用了:
过程拷贝:
[lilian@CentOS ~]$ ping www.baidu.com
PING www.a.shifen.com (110.242.68.3) 56(84) bytes of data.
64 bytes from 110.242.68.3 (110.242.68.3): icmp_seq=1 ttl=128 time=17.2 ms
64 bytes from 110.242.68.3 (110.242.68.3): icmp_seq=2 ttl=128 time=50.7 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 17.244/33.986/50.729/16.743 ms
[lilian@CentOS ~]$ su - root
密码:
上一次登录:六 5月 7 21:07:59 CST 2022:0 上
[root@CentOS ~]# yum install java-devel
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 java-1.8.0-openjdk-devel.x86_64.1.1.8.0.322.b06-1.el7_9 将被 安装
--> 正在处理依赖关系 java-1.8.0-openjdk(x86-64) = 1:1.8.0.322.b06-1.el7_9,它被软件包 1:java-1.8.0-openjdk-devel-1.8.0.322.b06-1.el7_9.x86_64 需要
--> 正在检查事务
---> 软件包 java-1.8.0-openjdk.x86_64.1.1.8.0.262.b10-1.el7 将被 升级
---> 软件包 java-1.8.0-openjdk.x86_64.1.1.8.0.322.b06-1.el7_9 将被 更新
--> 正在处理依赖关系 java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.322.b06-1.el7_9,它被软件包 1:java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64 需要
--> 正在检查事务
---> 软件包 java-1.8.0-openjdk-headless.x86_64.1.1.8.0.262.b10-1.el7 将被 升级
---> 软件包 java-1.8.0-openjdk-headless.x86_64.1.1.8.0.322.b06-1.el7_9 将被 更新
--> 正在处理依赖关系 tzdata-java >= 2021e,它被软件包 1:java-1.8.0-openjdk-headless-1.8.0.322.b06-1.el7_9.x86_64 需要
--> 正在检查事务
---> 软件包 tzdata-java.noarch.0.2020a-1.el7 将被 升级
---> 软件包 tzdata-java.noarch.0.2022a-1.el7 将被 更新
--> 解决依赖关系完成
依赖关系解决
=======================================================================================
Package 架构 版本 源 大小
=======================================================================================
正在安装:
java-1.8.0-openjdk-devel x86_64 1:1.8.0.322.b06-1.el7_9 updates 9.8 M
为依赖而更新:
java-1.8.0-openjdk x86_64 1:1.8.0.322.b06-1.el7_9 updates 314 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.322.b06-1.el7_9 updates 33 M
tzdata-java noarch 2022a-1.el7 updates 190 k
事务概要
=======================================================================================
安装 1 软件包
升级 ( 3 依赖软件包)
总下载量:43 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for updates
警告:/var/cache/yum/x86_64/7/updates/packages/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64.rpm 的公钥尚未安装
(1/4): java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64.rpm | 314 kB 00:00:01
(2/4): java-1.8.0-openjdk-devel-1.8.0.322.b06-1.el7_9.x86_64.rp | 9.8 MB 00:00:13
(3/4): tzdata-java-2022a-1.el7.noarch.rpm | 190 kB 00:00:00
(4/4): java-1.8.0-openjdk-headless-1.8.0.322.b06-1.el7_9.x86_64 | 33 MB 00:00:20
---------------------------------------------------------------------------------------
总计 2.0 MB/s | 43 MB 00:21
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
软件包 : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : tzdata-java-2022a-1.el7.noarch 1/7
正在更新 : 1:java-1.8.0-openjdk-headless-1.8.0.322.b06-1.el7_9.x86_64 2/7
warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/blacklisted.certs created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/blacklisted.certs.rpmnew
warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/java.security.rpmnew
restored /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/blacklisted.certs.rpmnew to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/blacklisted.certs
restored /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/java.security.rpmnew to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/lib/security/java.security
正在更新 : 1:java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64 3/7
正在安装 : 1:java-1.8.0-openjdk-devel-1.8.0.322.b06-1.el7_9.x86_64 4/7
清理 : 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64 5/7
清理 : 1:java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64 6/7
清理 : tzdata-java-2020a-1.el7.noarch 7/7
验证中 : tzdata-java-2022a-1.el7.noarch 1/7
验证中 : 1:java-1.8.0-openjdk-headless-1.8.0.322.b06-1.el7_9.x86_64 2/7
验证中 : 1:java-1.8.0-openjdk-devel-1.8.0.322.b06-1.el7_9.x86_64 3/7
验证中 : 1:java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64 4/7
验证中 : 1:java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64 5/7
验证中 : 1:java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64 6/7
验证中 : tzdata-java-2020a-1.el7.noarch 7/7
已安装:
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.322.b06-1.el7_9
作为依赖被升级:
java-1.8.0-openjdk.x86_64 1:1.8.0.322.b06-1.el7_9
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.322.b06-1.el7_9
tzdata-java.noarch 0:2022a-1.el7
完毕!
[root@CentOS ~]# java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
[root@CentOS ~]# javac
用法: javac <options> <source files>
其中, 可能的选项包括:
-g 生成所有调试信息
-g:none 不生成任何调试信息
-g:{lines,vars,source} 只生成某些调试信息
-nowarn 不生成任何警告
-verbose 输出有关编译器正在执行的操作的消息
-deprecation 输出使用已过时的 API 的源位置
-classpath <路径> 指定查找用户类文件和注释处理程序的位置
-cp <路径> 指定查找用户类文件和注释处理程序的位置
-sourcepath <路径> 指定查找输入源文件的位置
-bootclasspath <路径> 覆盖引导类文件的位置
-extdirs <目录> 覆盖所安装扩展的位置
-endorseddirs <目录> 覆盖签名的标准路径的位置
-proc:{none,only} 控制是否执行注释处理和/或编译。
-processor <class1>[,<class2>,<class3>...] 要运行的注释处理程序的名称; 绕过默认的搜索进程
-processorpath <路径> 指定查找注释处理程序的位置
-parameters 生成元数据以用于方法参数的反射
-d <目录> 指定放置生成的类文件的位置
-s <目录> 指定放置生成的源文件的位置
-h <目录> 指定放置生成的本机标头文件的位置
-implicit:{none,class} 指定是否为隐式引用文件生成类文件
-encoding <编码> 指定源文件使用的字符编码
-source <发行版> 提供与指定发行版的源兼容性
-target <发行版> 生成特定 VM 版本的类文件
-profile <配置文件> 请确保使用的 API 在指定的配置文件中可用
-version 版本信息
-help 输出标准选项的提要
-A关键字[=值] 传递给注释处理程序的选项
-X 输出非标准选项的提要
-J<标记> 直接将 <标记> 传递给运行时系统
-Werror 出现警告时终止编译
@<文件名> 从文件读取选项和文件名
[root@CentOS ~]# java
用法: java [-options] class [args...]
(执行类)
或 java [-options] -jar jarfile [args...]
(执行 jar 文件)
其中选项包括:
-d32 使用 32 位数据模型 (如果可用)
-d64 使用 64 位数据模型 (如果可用)
-server 选择 "server" VM
默认 VM 是 server.
-cp <目录和 zip/jar 文件的类搜索路径>
-classpath <目录和 zip/jar 文件的类搜索路径>
用 : 分隔的目录, JAR 档案
和 ZIP 档案列表, 用于搜索类文件。
-D<名称>=<值>
设置系统属性
-verbose:[class|gc|jni]
启用详细输出
-version 输出产品版本并退出
-version:<值>
警告: 此功能已过时, 将在
未来发行版中删除。
需要指定的版本才能运行
-showversion 输出产品版本并继续
-jre-restrict-search | -no-jre-restrict-search
警告: 此功能已过时, 将在
未来发行版中删除。
在版本搜索中包括/排除用户专用 JRE
-? -help 输出此帮助消息
-X 输出非标准选项的帮助
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
按指定的粒度启用断言
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
禁用具有指定粒度的断言
-esa | -enablesystemassertions
启用系统断言
-dsa | -disablesystemassertions
禁用系统断言
-agentlib:<libname>[=<选项>]
加载本机代理库 <libname>, 例如 -agentlib:hprof
另请参阅 -agentlib:jdwp=help 和 -agentlib:hprof=help
-agentpath:<pathname>[=<选项>]
按完整路径名加载本机代理库
-javaagent:<jarpath>[=<选项>]
加载 Java 编程语言代理, 请参阅 java.lang.instrument
-splash:<imagepath>
使用指定的图像显示启动屏幕
有关详细信息, 请参阅 http://www.oracle.com/technetwork/java/javase/documentation/index.html。
[root@CentOS ~]# echo $JAVA_HOME
[root@CentOS ~]#
写个 Java 程序测试一下:
hello.java code:
public class hello {
public static void main ( String [] args ) {
System.out.println ( "Hello,World!" );
}
}
成功运行:
![javac hello.java](https://i-blog.csdnimg.cn/blog_migrate/408b4d1e66690626a20c55a1a55ecf93.png)
%%%%%
CentOS 7 重新安装/卸载 虚拟机增强工具等问题
重新安装 VMware Tools 是灰色的!因为之前安装过一次 这次想重新安装发现就不行了!
如果你安装过旧版本的 VMware Tools 这里会显示更新 VMware Tools
![重新安装 VMware Tools](https://i-blog.csdnimg.cn/blog_migrate/a8bec50c1bdf712b2d7f1736b1e7799e.png)
我一开始以为是 root 权限问题 后来发现不是。
然后关掉虚拟机:
将使用 ISO 映像文件改成使用物理驱动器:
![使用物理驱动器](https://i-blog.csdnimg.cn/blog_migrate/90ee78ba5d3c6e9ca7c3f60430110167.png)
开启虚拟机:
管理员身份登入系统:
还是灰色的:
理论上就是将 ISO 映像读取进系统安装增强工具 那么我们只需要找到这个映像文件即可!
经过一番寻找终于找到这个镜像:
C:\Program Files (x86)\VMware\VMware Workstation\linux.iso
![C:\Program Files (x86)\VMware\VMware Workstation\linux.iso](https://i-blog.csdnimg.cn/blog_migrate/2706f078c3fffe40bc07732a143a191f.png)
光驱这次挂载这个映像:
点击确定:
成功挂载!
![VMware Tools](https://i-blog.csdnimg.cn/blog_migrate/e91d6246408fb043406a56d9dcccf601.png)
光驱中成功找到 VMwareTools-10.3.23-16594550.tar.gz 压缩包:
![VMwareTools-10.3.23-16594550.tar.gz](https://i-blog.csdnimg.cn/blog_migrate/c5f55e61b6aa630e9084370429e28df6.png)
但是是不可操作的 所以需要重新挂载一下 卸载所有设备:
挂载到新挂载点:
成功复制到家目录下:
[root@CentOS ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 472M 0 472M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 8.4M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda1 8.8G 5.0G 3.5G 59% /
tmpfs 98M 40K 98M 1% /run/user/0
/dev/sr0 1.5M 1.5M 0 100% /run/media/root/VMware Thinprint
[root@CentOS ~]# umount -a
umount: /run/user/0: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /sys/fs/cgroup/systemd: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /sys/fs/cgroup: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /run: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount: /dev: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[root@CentOS ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@CentOS ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 472M 0 472M 0% /dev
tmpfs 487M 8.4M 478M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda1 8.8G 5.0G 3.5G 59% /
tmpfs 98M 36K 98M 1% /run/user/0
/dev/sr0 56M 56M 0 100% /mnt
[root@CentOS ~]# ls /mnt
manifest.txt run_upgrader.sh VMwareTools-10.3.23-16594550.tar.gz vmware-tools-upgrader-32 vmware-tools-upgrader-64
[root@CentOS ~]# cp /mnt/VMwareTools-10.3.23-16594550.tar.gz ~
cp: overwrite ‘/root/VMwareTools-10.3.23-16594550.tar.gz’? y
[root@CentOS ~]# ls ~
anaconda-ks.cfg Desktop Documents Downloads initial-setup-ks.cfg Music Pictures Public Templates Videos VMwareTools-10.3.23-16594550.tar.gz
[root@CentOS ~]#
VMwareTools-10.3.23-16594550.tar.gz:
解压到当前目录下:
[root@CentOS ~]# tar -xzvf VMwareTools-10.3.23-16594550.tar.gz
vmware-tools-distrib/
vmware-tools-distrib/bin/
vmware-tools-distrib/bin/vm-support
vmware-tools-distrib/bin/vmware-config-tools.pl
/* 实在太长 全部省略 */
[root@CentOS ~]# ls
anaconda-ks.cfg Documents initial-setup-ks.cfg Pictures Templates VMwareTools-10.3.23-16594550.tar.gz
Desktop Downloads Music Public Videos vmware-tools-distrib
[root@CentOS ~]# ls vmware-tools-distrib/
bin caf doc etc FILES INSTALL installer lib vgauth vmware-install.pl
[root@CentOS ~]#
到了最关键的一步了 安装 只需要记住一个技巧:
有 [no] 输 no
有 [yes] 的输 yes
两者都无便回车默认
最后一个绝对 no
下面该输入的都用 C 语言注释格式说明了:
[root@CentOS ~]# ./vmware-tools-distrib/vmware-install.pl /* 执行安装脚本 */
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] yes /* 输入 yes */
INPUT: [yes]
A previous installation of VMware Tools has been detected.
The previous installation was made by the tar installer (version 4).
Keeping the tar4 installer database format.
You have a version of VMware Tools installed. Continuing this install will
first uninstall the currently installed version. Do you wish to continue?
(yes/no) [yes] yes /* 输入 yes */
INPUT: [yes]
Uninstalling the tar installation of VMware Tools.
manageSELinux uninstall: Unable to remove vmtools_t permissive mapping.
There was an error configuring the SELinux security context for VMware Tools.
Please make certain that SELinux is configured correctly.
Stopping services for VMware Tools
Stopping vmware-tools (via systemctl): [ OK ]
The removal of VMware Tools 10.3.23 build-16594550 for Linux completed
successfully.
Installing VMware Tools.
In which directory do you want to install the binary files?
[/usr/bin] /* 输入 回车 */
INPUT: [/usr/bin] default
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d] /* 输入 回车 */
INPUT: [/etc/rc.d] default
What is the directory that contains the init scripts?
[/etc/rc.d/init.d] /* 输入 回车 */
INPUT: [/etc/rc.d/init.d] default
In which directory do you want to install the daemon files?
[/usr/sbin] /* 输入 回车 */
INPUT: [/usr/sbin] default
In which directory do you want to install the library files?
[/usr/lib/vmware-tools] /* 输入 回车 */
INPUT: [/usr/lib/vmware-tools] default
The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] yes /* 输入 yes */
INPUT: [yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
INPUT: [/usr/share/doc/vmware-tools] default /* 输入 回车 */
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes] yes /* 输入 yes */
INPUT: [yes]
The installation of VMware Tools 10.3.23 build-16594550 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] yes /* 输入 yes */
INPUT: [yes]
You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools. Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.
The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists. Overwrite? [no] no /* 输入 no */
INPUT: [no]
The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists. Overwrite? [no] no /* 输入 no */
INPUT: [no]
Initializing...
Making sure services for VMware Tools are stopped.
Stopping vmware-tools (via systemctl): [ OK ]
The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.
The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.
The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.
The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment. Do you wish
to enable this feature? [yes] yes /* 输入 yes */
INPUT: [yes]
The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
Skipping configuring automatic kernel modules as no drivers were installed by
this installer.
Skipping rebuilding initrd boot image for kernel as no drivers to be included
in boot image were installed by this installer.
/* 在这里会等一段时间安装 下一个是最后一个 */
The configuration of VMware Tools 10.3.23 build-16594550 for Linux for this
running kernel completed successfully.
VMware Tools installed on top of open-vm-tools has not added anything of
significance or potential benefit. VMware Tools is not needed.
Would you like to recover the wasted disk space by uninstalling VMware Tools at
this time? (yes/no) [yes] no /* 一般来说最后一个一定要输入 no */
INPUT: [no]
Enjoy,
--the VMware team
[root@CentOS ~]#
虚拟机增强工具安装完成!
剩下的善后大家自己完成吧
无非是添加了块网卡、光驱读取的 ISO 文件、电脑里复制解压的一堆东西
安装成功后虚拟机就会支持铺满屏幕:
以及窗口缩放自适应:
剪贴板共享:
最重要的拖拽复制:
这样就不用通过网络或者 USB 设备来虚拟机实体机之间传输数据了!
忘了说 GUI 图形界面的 CentOS 7 自带 ntfs-3g 支持读取 ntfs 分区:
一次卸载 VMware Tools
[root@CentOS ~]# vm
vmcore-dmesg vmware-namespace-cmd
vmhgfs-fuse vmware-rpctool
vmmouse_detect vmware-toolbox-cmd
vmstat vmware-uninstall-tools.pl
vm-support vmware-user
vmtoolsd vmware-user-suid-wrapper
vmware-checkvm vmware-vgauth-cmd
vmware-config-tools.pl vmware-vmblock-fuse
vmware-hgfsclient vmware-xferlogs
[root@CentOS ~]# vmware-uninstall-tools.pl
Uninstalling the tar installation of VMware Tools.
Stopping services for VMware Tools
Stopping vmware-tools (via systemctl): [ OK ]
The removal of VMware Tools 10.3.23 build-16594550 for Linux completed
successfully. Thank you for having tried this software.
[root@CentOS ~]#
一次普通用户安装示例 最后一步选择 yes 也无伤大雅:
[lilian@CentOS vmware-tools-distrib]$ su root
密码:
[root@CentOS vmware-tools-distrib]# ./vmware-install.pl
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] yes
INPUT: [yes]
Creating a new VMware Tools installer database using the tar4 format.
Installing VMware Tools.
In which directory do you want to install the binary files?
[/usr/bin]
INPUT: [/usr/bin] default
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
INPUT: [/etc/rc.d] default
What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
INPUT: [/etc/rc.d/init.d] default
In which directory do you want to install the daemon files?
[/usr/sbin]
INPUT: [/usr/sbin] default
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
INPUT: [/usr/lib/vmware-tools] default
The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] yes
INPUT: [yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
INPUT: [/usr/share/doc/vmware-tools] default
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes] yes
INPUT: [yes]
The installation of VMware Tools 10.3.23 build-16594550 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] yes
INPUT: [yes]
You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools. Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.
The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists. Overwrite? [no] no
INPUT: [no]
The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists. Overwrite? [no] no
INPUT: [no]
Initializing...
Making sure services for VMware Tools are stopped.
Stopping vmware-tools (via systemctl): [ 确定 ]
The module vmci has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.
The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.
The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.
The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.
The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment. Do you wish
to enable this feature? [yes] yes
INPUT: [yes]
The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
Skipping configuring automatic kernel modules as no drivers were installed by
this installer.
Skipping rebuilding initrd boot image for kernel as no drivers to be included
in boot image were installed by this installer.
The configuration of VMware Tools 10.3.23 build-16594550 for Linux for this
running kernel completed successfully.
VMware Tools installed on top of open-vm-tools has not added anything of
significance or potential benefit. VMware Tools is not needed.
Would you like to recover the wasted disk space by uninstalling VMware Tools at
this time? (yes/no) [yes] yes
INPUT: [yes]
Uninstalling the tar installation of VMware Tools.
Stopping services for VMware Tools
Stopping vmware-tools (via systemctl): [ 确定 ]
The removal of VMware Tools 10.3.23 build-16594550 for Linux completed
successfully. Thank you for having tried this software.
[root@CentOS vmware-tools-distrib]#
##################################################
好人来啦
CentOS7-JDK1.8.tar.gz:
pan.baidu.com/s/1nfPfHJl7dxPFo8Xa00VGJQ
1308
VMwareTools-10.3.23-16594550.tar.gz:
pan.baidu.com/s/1r5-ZYwVXIahxU9QXLhvVOA
1307