安装虚拟机
一、安装虚拟机Vmware Workstation
 下一步 下一步
 如果C盘剩余空间大(大于50G),可安装在C盘
二、在虚拟机中安装Linux系统:
 准备工作:
 Linux系统镜像文件(ISO文件)
 1 、新建虚拟机:
 文件-》新建虚拟机,选择典型、下一步
 
 2 、安装程序光盘映像:
 
 3 、设置用户名:
 
 4、 设置虚拟机名称和保存位置
 提示:位置可选择空间大的磁盘
 
 5 、默认配置
 
 
开始安装系统
提示:建议安装过程中断网安装,不然会很慢
 第一步选择语言:默认为English
 第二步:键盘设置 默认
 第三至第九步: 默认回车
设置用户:
 Tab切换到底部Done确认
 之后提示安装内核
虚拟机的固定ip
默认配置为
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:ethernets:ens33:addresses: []dhcp4: trueversion: 2修改/etc/netplan/50-cloud-init.yaml为
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:ethernets:ens33:addresses: [192.168.139.100/24] //自定义ip地址以/24结束dhcp4: nogateway4: 192.168.139.2  //和下面的保持一致nameservers:addresses: [192.168.139.2] //和上方保持一致version: 2然后netplan apply使其生效之后查询 ifconfig检查ip信息
永久修改主机名称
hostname 显示当前主机名
 第一步:先去/etc/cloud/cloud.cfg中的preserve_hostname: 改为true
 第二步: /etc/hostname 修改主机名称 重启虚拟机后主机名生效
 vim /etc/hosts
 127.0.0.1 VM-API-1910
PATH路径
在/usr/profile 改完记得source生效