win10虚拟机网络及yum源优质博客

  • 打通虚拟机网络
    https://www.cnblogs.com/OliverQin/p/9758516.html
    虚拟机网络设置为NAT,用于共享主机的IP地址
    在这里插入图片描述
    win10:控制面板\网络和 Internet\网络连接,设置wifi共享网络
    在这里插入图片描述
    在这里插入图片描述
    配置VMNet8
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    下一步,还是上图进行NAT设置
    在这里插入图片描述
    此处的网关IP地址需要与虚拟机在同一网段,保持ping通
    配置虚拟机ip地址
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno16777736 
DEVICE=eno16777736
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.137.10
GATEWAY=192.168.137.2
NETMASK=255.255.255.0

[root@localhost /]# systemctl restart  network

设置DNS

[root@localhost ~]# cat /etc/resolv.conf 
nameserver 114.114.114.114
nameserver 192.168.1.1 
nameserver 8.8.8.8
  • 打通虚拟机yum源
    https://blog.csdn.net/kangvcar/article/details/73477730
    在这里插入图片描述
[root@localhost /]# mkdir /opt/centos
[root@localhost /]# mount /dev/sr0 /opt/centos
[root@vm1 ~]# cat /etc/yum.repos.d/local.repo 
[local]
name=local
baseurl=file:///opt/centos
enabled=1
gpgcheck=0
# priority=1, 值越小,优先级越高
priority=1

centos官方yum源补充

wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/epel-release-7-11.noarch.rpm
yum install -y epel-release-7-11.noarch.rpm
yum clean all
yum makecache
yum list|wc -l

pip源加速,临时

pip3 install requests  -i http://mirrors.aliyun.com/pypi/simple/   --trusted-host mirrors.aliyun.com

pip源加速,永久

mkdir ~/.pip

打开配置文件 ~/.pip/pip.conf,修改如下:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/ 
[install]
trusted-host = mirrors.aliyun.com
# 查看pip源
 pip3 config list   

win下指定pip源:
Windows下,你需要在当前对用户目录下(C:\Users\xx\pip,xx 表示当前使用对用户,比如张三)创建一个 pip.ini在pip.ini文件中输入以下内容:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
  • win10访问虚拟机web网站
    在这里插入图片描述

虚拟机关掉防火墙,或者防火墙添加ip策略,那么测试的话,直接关掉咯

[root@localhost Desktop]# systemctl stop firewalld.service
[root@localhost Desktop]# systemctl disable firewalld.service
  • xshell安装
    https://www.cmsky.com/xshell-registered-version/
    在这里插入图片描述

  • win与虚拟机文件传输
    在这里插入图片描述

常见问题

1、睡眠或重启windows后,主机ping不通wmware虚拟机
在这里插入图片描述

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值