VMWare11安装RedHat Linux 7过程中会碰到一些坑,这里列举一些。
问题1
RedHat7安装的时候选择的是简体中文,安装完成,想改成英文。
修改配置文件,/etc/locale.conf,
将:LANG="zh_CN.UTF-8"
修改为:LANG="en_US.UTF-8"
重启系统即可。
问题2
防火墙临时关闭,
代码语言:javascript复制systemctl stop firewalld防火墙永久关闭,
代码语言:javascript复制syustemctl disable firewalldLinux 6和Linux 7的防火墙设置有些区别,可以参考《探索Linux 6和7的防火墙》。
问题3
如何修改当前系统时间?Linux 7中用到了timedatectl,该指令是作为systemd系统和服务管理器的一部分分发的工具,可以用他来查看和更改系统时钟的配置,包括更改当前的日期和时间、设置时区以及可以激活与远端服务器系统时钟的自动同步,是红帽企业版7版本新增的命令。timedatectl或者timedatectl status,可以看当前信息,
代码语言:javascript复制[root@bisal ~]# timedatectl
Local time: Sun 2020-12-06 03:49:15 CST
Universal time: Sat 2020-12-05 19:49:15 UTC
RTC time: Sat 2020-12-05 19:44:03
Time zone: Asia/Shanghai (CST, 0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a修改当前时间,提示错误,
代码语言:javascript复制[root@bisal ~]# timedatectl set-time 15:00:00
Failed to set time: Automatic time synchronization is enabled此时,可以关闭NTP,暂停自动同步,NTP enabled改为了no,
代码语言:javascript复制[root@bisal ~]# timedatectl set-ntp no
[root@bisal ~]# timedatectl
Local time: Sun 2020-12-06 03:53:01 CST
Universal time: Sat 2020-12-05 19:53:01 UTC
RTC time: Sat 2020-12-05 19:47:37
Time zone: Asia/Shanghai (CST, 0800)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a再次设置,更改成功了,
代码语言:javascript复制[root@bisal ~]# timedatectl set-time '16:42:25'
[root@bisal ~]# timedatectl
Local time: Sun 2020-12-06 16:42:30 CST
Universal time: Sun 2020-12-06 08:42:30 UTC
RTC time: Sun 2020-12-06 08:42:30
Time zone: Asia/Shanghai (CST, 0800)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a问题4
宿主机和虚拟机之间的网络连通性,虚拟机网络适配器选择“NAT模式”,通常情况下,宿主机就可以ping通虚拟机了,如果宿主机和外网是通的,此时在虚拟机中就可以访问外网了,

问题5
yum install提示错误,
代码语言:javascript复制This system is not registered with an entitlement server. You can use subscription-manager to register.这是因为红帽的企业版Linux系统RHEL是收费的,必须要注册才可正常使用。这时替代方案,就是替掉原版的yum,安装一个免费的yum源,例如CentOS(CentOS已经被红帽收购,且跟RHEL系统没多大区别,最主要还是可以免费使用),将RHEL7的yum源更换为CentOS7的。
1.检查并删除原有的yum源
代码语言:javascript复制rpm -qa | grep yum一般出现6个,

2.下载安装CentOS的yum源
代码语言:javascript复制wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm为了防止几个包安装时有互相依赖,使用rpm -ivh yum*命令一次性安装三个包。检查yum是否安装成功:
代码语言:javascript复制rpm -qa |grep yum3.配置repo文件
在/etc目录下重命名备份原来的repo,
代码语言:javascript复制mv yum.repos.d yum.repos.d.backup/etc下建一个新的yum.repos.d目录
代码语言:javascript复制mkdir yum.repos.d下载一个CentOS的repo,
代码语言:javascript复制wget http://mirrors.163.com/.help/CentOS7-Base-163.repo打开CentOS7-Base-163.repo,
代码语言:javascript复制# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7可以用快捷方式,
代码语言:javascript复制:%s@$releasever@7@g将其中的$releasever全部替换成版本号,
代码语言:javascript复制# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7yum clean all,清理缓存,
代码语言:javascript复制[root@bisal yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: base extras updatesyum makecache,重新生成缓存,期间可能还会出现未注册的提示,
代码语言:javascript复制Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Determining fastest mirrors
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/10): base/x86_64/group_gz | 153 kB 00:00:00
(2/10): base/x86_64/primary_db | 6.1 MB 00:00:03
(3/10): extras/x86_64/primary_db | 222 kB 00:00:01
(4/10): extras/x86_64/filelists_db | 224 kB 00:00:01
(5/10): extras/x86_64/other_db | 134 kB 00:00:00
(6/10): base/x86_64/other_db | 2.6 MB 00:00:02
(7/10): updates/x86_64/filelists_db | 2.1 MB 00:00:01
(8/10): updates/x86_64/other_db | 227 kB 00:00:00
(9/10): updates/x86_64/primary_db | 3.7 MB 00:00:03
(10/10): base/x86_64/filelists_db | 7.2 MB 00:00:10
Metadata Cache Createdyum repolist all查看是否成功,
代码语言:javascript复制[root@bisal yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
repo id repo name status
base/x86_64 CentOS-7 - Base - 163.com enabled: 10,072
centosplus/x86_64 CentOS-7 - Plus - 163.com disabled
extras/x86_64 CentOS-7 - Extras - 163.com enabled: 448
updates/x86_64 CentOS-7 - Updates - 163.com enabled: 775
repolist: 11,295问题6
vmware-tool安装过程中,错误提示,
代码语言:javascript复制(process:17532): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed安装这些包,
代码语言:javascript复制[root@bisal yum.repos.d]# yum -y install gcc gcc-c automake make kernel-devel问题7
vmware设置共享文件夹,但是登录/mnt/hgfs,内容是空的。
vmware-hgfsclient指令用于查看当前有哪些共享目录,同样是空的,
代码语言:javascript复制[root@bisal C]# vmware-hgfsclient
C用如下指令,挂载共享文件夹,
代码语言:javascript复制mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs此时,vmware-hgfsclient,可以看到当前的共享文件夹了,
代码语言:javascript复制[root@bisal C]# vmware-hgfsclient
C参考文献,
https://blog.csdn.net/otmqixi/article/details/81564515
https://blog.csdn.net/qq_28401965/article/details/82019139
https://blog.csdn.net/mingtianwendy/article/details/78393583
https://blog.csdn.net/Paranoid_cc/article/details/81455061
https://blog.csdn.net/xzm5708796/article/details/103733211


