当前位置: 首页 > news >正文

VMware 虚拟机装 Linux Centos 7.9 保姆级教程(附资源包)

安装 VMware 17.5.1 + centos 7.9

1、下载资源包(虚拟机+镜像)

  • VMware-17.5.1 安装包+秘钥.zip
  • Linux Centos 7.9 镜像

2、centos 7.9 下载地址

1、Centos 官网

2、阿里巴巴镜像站

3、查看网络命令 ifconfigip addr

4、登陆服务器

ssh stark@192.168.31.131

初始化后的坑

sudo命令的坑
[stark@192 ~]$ sudo yum update -y
[sudo] password for stark: 
stark is not in the sudoers file.  This incident will be reported.

会有错误信息stark is not in the sudoers file. This incident will be reported. ,解决步骤:

1、切换到 root 用户 输入 之前的初始化密码用户的密码之后就能登录。

su -

2、把用户添加到 wheel 组

CentOS 系统中,wheel 组的用户默认拥有 sudo 权限。你可以使用以下命令将用户stark添加到 wheel 组:

usermod -aG wheel stark

3、确认 wheel 组是否有 sudo 权限

要保证/etc/sudoers文件里有如下配置行(如果被注释掉了,就取消注释):

%wheel  ALL=(ALL)       ALL

4、以现有 sudo 用户身份添加用户到 sudo 组

sudo usermod -aG wheel stark
yum源的坑

1、临时修改DNS服务器

编辑/etc/resolv.conf文件,添加公共 DNS 服务器:

echo -e "nameserver 8.8.8.8\nnameserver 114.114.114.114" > /etc/resolv.conf

2、替换 CentOS 官方镜像源为阿里云镜像源

# 备份原镜像源配置
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup# 下载阿里云镜像源配置
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo# 清理并生成缓存
yum clean all
yum makecache

3、处理 CentOS 7 EOL 后的镜像源问题

sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-*
sed -i 's|^#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

4、额外建议

如果仍然遇到问题,可以尝试禁用fastestmirror插件:

sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf

VMware Tools 设置时间

设置宿主机与虚拟机时间不一致的问题:

1、设置: 虚拟机 -> 设置 -> 选项

2、在虚拟机中安装 VMware Tools

#下载
sudo yum install open-vm-tools open-vm-tools-desktop
#启动
sudo systemctl enable --now vmtoolsd
#验证
systemctl status vmtoolsd
#更新时间
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
http://www.xdnf.cn/news/1120915.html

相关文章:

  • mybatis-plus-jpa-support
  • 常用的OTP语音芯片有哪些?
  • Spring Boot启动原理:从main方法到内嵌Tomcat的全过程
  • Linux 系统下的 Sangfor VDI 客户端安装与登录完全攻略 (CentOS、Ubuntu、麒麟全线通用)
  • Git LFS 操作处理Github上传大文件操作记录
  • 第一章编辑器开发基础第一节绘制编辑器元素_4输入字段(4/7)
  • Redis集群方案——Redis分片集群
  • 《星盘接口4:银河守护者》
  • 小波变换 | Haar 小波变换
  • 浏览器自动化领域的MCP
  • 实战--Tlias教学管理系统(部门管理)
  • 纯CSS轮播
  • SAP ERP与微软ERP dynamics对比,两款云ERP产品有什么区别?
  • 【第零章编辑器开发与拓展】
  • 不用下载软件也能录屏?Windows 10 自带录屏功能详解
  • Postman、Apifox、Apipost用哪个? 每个的优缺点和综合比较(个人观点)
  • qt多线程的实战使用
  • 【记录】BLE|百度的旧蓝牙随身音箱手机能配对不能连接、电脑能连接不能使用的解决思路(Wireshark捕获并分析手机蓝牙报文)
  • Linux(Ubuntu)硬盘使用情况解析(已房子举例)
  • HTML面试题
  • 消费 Kafka 一个TOPIC数据,插入到另一个KAFKA的TOPIC
  • python学习2
  • ubuntu(22.04)系统上安装 MuJoCo
  • FRP Ubuntu 服务端 + MacOS 客户端配置
  • 微前端架构详解
  • 《C++初阶之STL》【泛型编程 + STL简介】
  • Nacos 技术研究文档(基于 Nacos 3)
  • 基于R语言的极值统计学及其在相关领域中的实践技术应用
  • 迅为八核高算力RK3576开发板摄像头实时推理测试 ppyoloe目标检测
  • 《亿级流量系统架构设计与实战》通用高并发架构设计 读场景