700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > vmware最小化安装

vmware最小化安装

时间:2020-09-04 20:27:52

相关推荐

vmware最小化安装

1、VMware创建虚拟机

2、安装CentOS7

选择系统语言

磁盘分区规划,选择默认自动分区,也可手动分区:

设置网络和主机名:

这里设置主机名为:centos7,打开网络连接,其他网络参数等待系统安装完成后再设置;

设置日期和时间:

开始系统安装:

设置root用户密码,如果密码过于简单,需要连续点击左上角Done两次;

等待系统安装完成

系统安装完成,重启

3、配置

3.1 配置网络

在最小化安装的CentOS7中,ifconfig是不能使用的,查看网卡信息的命令是

ip addr

其中“ens33”为网卡名称,修改IP地址等信息

vi /etc/sysconfig/network-scripts/ifcfg-ens33

根据实际情况修改内容:

TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=static #启用静态ip地址DEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=8d497804-9ffa-4edc-951a-5ddd8d2ed504DEVICE=ens33ONBOOT=yes #自动启用网络连接IPADDR0=192.168.0.201 #IP地址PREFIXO0=24 #子网掩码GATEWAY0=192.168.0.1 #网关DNS1=192.168.0.1 #DNS

修改好后保存退出,并重启网络,测试网络是否连接正常:

[root@centos7 ~]# service network restartRestarting network (via systemctl): [ OK ][root@centos7 ~]# ping PING www. (220.181.111.188) 56(84) bytes of data.64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=1 ttl=55 time=27.6 ms64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=2 ttl=55 time=89.3 ms64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=3 ttl=55 time=27.1 ms64 bytes from 220.181.111.188 (220.181.111.188): icmp_seq=4 ttl=55 time=26.2 ms^C--- www. ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3005msrtt min/avg/max/mdev = 26.254/42.606/89.358/26.997 ms

3.2 安装ifconfig命令

查看哪个组件包含了ifconfig命令

yum provides ifconfig或yum whatprovides ifconfig

ifconfig命令依赖于net-tools的,安装

yum install -y net-tools

3.3 安装vim编辑器

yum install -y vim-enhanced

3.4 安装wget

yum install -y wget

3.5 关闭SELinux

编辑SELinux配置文件

vim /etc/selinux/config

注释掉2行代码,并在最后添加1行代码

#SELINUX=enforcing#SELINUXTYPE=targetedSELINUX=disabled

保存并关闭,使设置启用,最好重启一下系统,也可以稍后重启

setenforce 0

3.6 关闭CentOS自带firewall防火墙,启用iptables

# 停止firewall[root@centos7 /]# systemctl stop firewalld# 关闭firewall自动启动[root@centos7 /]# systemctl disable firewalld.serviceRemoved symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

安装iptables防火墙

yum install -y iptables-services

使用iptables默认配置文件,可以在此配置文件中增加规则

[root@centos7 ~]# vim /etc/sysconfig/iptables# sample configuration for iptables service# you can edit this manually or use system-config-firewall# please do not ask us to add additional ports/services to this default configuration*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited-A FORWARD -j REJECT --reject-with icmp-host-prohibitedCOMMIT

重启iptables,并添加到开机自启项中,查看iptables状态

[root@centos7 ~]# systemctl restart iptables.service[root@centos7 ~]# systemctl enable iptables.serviceCreated symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.[root@centos7 ~]# service iptables statusRedirecting to /bin/systemctl status iptables.service● iptables.service - IPv4 firewall with iptablesLoaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)Active: active (exited) since Mon -05-21 18:09:28 CST; 18s agoMain PID: 1195 (code=exited, status=0/SUCCESS)May 21 18:09:27 centos7 systemd[1]: Starting IPv4 firewall with iptables...May 21 18:09:28 centos7 iptables.init[1195]: iptables: Applying firewall rules: [ OK ]May 21 18:09:28 centos7 systemd[1]: Started IPv4 firewall with iptables.

3.7 配置国内yum源和epel源

3.7.1 配置yum源

1)新建文件夹,保存系统中原来的repo文件

[root@centos7 ~]# cd /etc/yum.repos.d/[root@centos7 yum.repos.d]# mkdir repo_bak[root@centos7 yum.repos.d]# mv *.repo repo_bak/

2)下载阿里云和网易对应系统的repo文件

[root@centos7 yum.repos.d]# wget /repo/Centos-7.repo[root@centos7 yum.repos.d]# wget /.help/CentOS7-Base-163.repo[root@centos7 yum.repos.d]# lltotal 8-rw-r--r-- 1 root root 1572 Dec 1 CentOS7-Base-163.repo-rw-r--r-- 1 root root 2573 Nov 21 Centos-7.repodrwxr-xr-x 2 root root 187 May 21 18:25 repo_bak

3)清楚系统yum缓存,并生成新的yum缓存

[root@centos7 yum.repos.d]# yum clean allLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationCleaning repos: base extras updatesCleaning up everythingMaybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed reposCleaning up list of fastest mirrors[root@centos7 yum.repos.d]# yum makecacheLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationDetermining fastest mirrorsbase | 3.6 kB 00:00:00extras | 3.4 kB 00:00:00updates| 3.4 kB 00:00:00(1/12): base/7/x86_64/group_gz | 166 kB 00:00:00(2/12): base/7/x86_64/primary_db | 5.9 MB 00:00:01(3/12): extras/7/x86_64/prestodelta| 47 kB 00:00:00(4/12): base/7/x86_64/other_db | 2.5 MB 00:00:00(5/12): extras/7/x86_64/primary_db | 143 kB 00:00:00(6/12): extras/7/x86_64/filelists_db| 517 kB 00:00:00(7/12): extras/7/x86_64/other_db | 91 kB 00:00:00(8/12): updates/7/x86_64/prestodelta| 180 kB 00:00:00(9/12): updates/7/x86_64/filelists_db| 875 kB 00:00:00(10/12): updates/7/x86_64/other_db | 201 kB 00:00:00(11/12): updates/7/x86_64/primary_db| 1.2 MB 00:00:00(12/12): base/7/x86_64/filelists_db| 6.9 MB 00:00:04Metadata Cache Created

3.7.2 配置epel源

1)安装epel-release,安装成功后,会自动生成epel.repo和epel-testing.repo两个文件

[root@centos7 yum.repos.d]# yum list | grep epel-releaseRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationepel-release.noarch 7-11 extras[root@centos7 yum.repos.d]# yum install -y epel-releaseLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package epel-release.noarch 0:7-11 will be installed--> Finished Dependency ResolutionDependencies Resolved==============================================================================================================Package ArchVersion Repository Size==============================================================================================================Installing:epel-release noarch 7-11 extras15 kTransaction Summary==============================================================================================================Install 1 PackageTotal download size: 15 kInstalled size: 24 kDownloading packages:epel-release-7-11.noarch.rpm| 15 kB 00:00:00Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : epel-release-7-11.noarch 1/1Verifying : epel-release-7-11.noarch 1/1Installed:epel-release.noarch 0:7-11Complete![root@centos7 yum.repos.d]# lltotal 16-rw-r--r-- 1 root root 1572 Dec 1 CentOS7-Base-163.repo-rw-r--r-- 1 root root 2573 Nov 21 Centos-7.repo-rw-r--r-- 1 root root 951 Oct 3 epel.repo-rw-r--r-- 1 root root 1050 Oct 3 epel-testing.repodrwxr-xr-x 2 root root 187 May 21 18:25 repo_bak

2)下载阿里云开源镜像的epel源文件

[root@centos7 yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo /repo/epel-7.repo---05-21 18:35:24-- /repo/epel-7.repoResolving ()... 1.81.1.230, 1.81.1.223, 1.81.1.224, ...Connecting to ()|1.81.1.230|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 664 [application/octet-stream]Saving to: ‘/etc/yum.repos.d/epel-7.repo’100%[====================================================================>] 664--.-K/s in 0s-05-21 18:35:24 (148 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [664/664][root@centos7 yum.repos.d]# lltotal 20-rw-r--r-- 1 root root 1572 Dec 1 CentOS7-Base-163.repo-rw-r--r-- 1 root root 2573 Nov 21 Centos-7.repo-rw-r--r-- 1 root root 664 May 11 11:35 epel-7.repo-rw-r--r-- 1 root root 951 Oct 3 epel.repo-rw-r--r-- 1 root root 1050 Oct 3 epel-testing.repodrwxr-xr-x 2 root root 187 May 21 18:25 repo_bak

3)再次清除系统yum缓存,并重新生成yum缓存

[root@centos7 yum.repos.d]# yum clean allLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository epel is listed more than once in the configurationRepository epel-debuginfo is listed more than once in the configurationRepository epel-source is listed more than once in the configurationCleaning repos: base epel extras updatesCleaning up everythingMaybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed reposCleaning up list of fastest mirrors[root@centos7 yum.repos.d]# yum makecacheLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository epel is listed more than once in the configurationRepository epel-debuginfo is listed more than once in the configurationRepository epel-source is listed more than once in the configurationDetermining fastest mirrorsbase | 3.6 kB 00:00:00epel | 4.7 kB 00:00:00extras | 3.4 kB 00:00:00updates| 3.4 kB 00:00:00(1/18): base/7/x86_64/group_gz | 166 kB 00:00:00(2/18): base/7/x86_64/primary_db | 5.9 MB 00:00:01(3/18): base/7/x86_64/other_db | 2.5 MB 00:00:00(4/18): epel/x86_64/group_gz| 88 kB 00:00:01(5/18): epel/x86_64/updateinfo | 923 kB 00:00:00(6/18): epel/x86_64/prestodelta | 2.8 kB 00:00:00(7/18): epel/x86_64/primary_db | 6.4 MB 00:00:02(8/18): epel/x86_64/filelists_db | 10 MB 00:00:03(9/18): extras/7/x86_64/filelists_db| 517 kB 00:00:00(10/18): extras/7/x86_64/primary_db| 143 kB 00:00:00(11/18): extras/7/x86_64/other_db | 91 kB 00:00:00(12/18): extras/7/x86_64/prestodelta| 47 kB 00:00:00(13/18): updates/7/x86_64/prestodelta| 180 kB 00:00:00(14/18): updates/7/x86_64/primary_db| 1.2 MB 00:00:00(15/18): updates/7/x86_64/other_db | 201 kB 00:00:00(16/18): epel/x86_64/other_db | 3.1 MB 00:00:01(17/18): updates/7/x86_64/filelists_db| 875 kB 00:00:00(18/18): base/7/x86_64/filelists_db| 6.9 MB 00:00:09Metadata Cache Created

3.7.3 查看系统可用的yum源和所有的yum源

[root@centos7 yum.repos.d]# yum repolist enabledLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository epel is listed more than once in the configurationRepository epel-debuginfo is listed more than once in the configurationRepository epel-source is listed more than once in the configurationLoading mirror speeds from cached hostfilerepo idrepo name statusbase/7/x86_64 CentOS-7 - Base - 9,911epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,542extras/7/x86_64 CentOS-7 - Extras - 291updates/7/x86_64 CentOS-7 - Updates - 539repolist: 23,283[root@centos7 yum.repos.d]#[root@centos7 yum.repos.d]# yum repolist allLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository epel is listed more than once in the configurationRepository epel-debuginfo is listed more than once in the configurationRepository epel-source is listed more than once in the configurationLoading mirror speeds from cached hostfilerepo id repo name statusbase/7/x86_64 CentOS-7 - Base - enabled: 9,911centosplus/7/x86_64CentOS-7 - Plus - disabledcontrib/7/x86_64 CentOS-7 - Contrib - disabledepel/x86_64Extra Packages for Enterprise Linux 7 - x86_64enabled: 12,542epel-debuginfo/x86_64Extra Packages for Enterprise Linux 7 - x86_64 - Debugdisabledepel-sourceExtra Packages for Enterprise Linux 7 - x86_64 - Sourcedisabledepel-testing/x86_64Extra Packages for Enterprise Linux 7 - Testing - x86_64disabledepel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabledepel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Sourc disabledextras/7/x86_64 CentOS-7 - Extras -enabled: 291updates/7/x86_64 CentOS-7 - Updates -enabled: 539repolist: 23,283

3.8 修改hostname主机名

3.8.1hostnamectl

[root@localhost ~]# hostnamectlStatic hostname: localhost.localdomainIcon name: computer-vmChassis: vmMachine ID: 8dbe281bfa3d4b3c9390c26f494db334Boot ID: b629ca855d3e4406ab886fe709d2f917Virtualization: vmwareOperating System: CentOS Linux 7 (Core)CPE OS Name: cpe:/o:centos:centos:7Kernel: Linux 3.10.0-514.el7.x86_64Architecture: x86-64[root@localhost ~]# hostnamectl set-hostname CentOS[root@localhost ~]# hostnamectlStatic hostname: centosPretty hostname: CentOSIcon name: computer-vmChassis: vmMachine ID: 8dbe281bfa3d4b3c9390c26f494db334Boot ID: b629ca855d3e4406ab886fe709d2f917Virtualization: vmwareOperating System: CentOS Linux 7 (Core)CPE OS Name: cpe:/o:centos:centos:7Kernel: Linux 3.10.0-514.el7.x86_64Architecture: x86-64[root@localhost ~]# hostnamecentos

3.8.2修改主机名文件

[root@localhost ~]# vi /etc/hostname

---------------------

作者:hellboy0621

来源:CSDN

原文:/hellboy0621/article/details/80392273

版权声明:本文为博主原创文章,转载请附上博文链接!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。