Windows10环境vagrant+VirtualBox虚拟机无法创建私有网络的解决方案。

报错信息

==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 70 of file VBoxManageHostonly.cpp

报错原因:

  在Windows10中,网络策略的变化,VirtualBox没有相应权限

解决方案:

  ①打开Orcle VM VirtualBox图形界面。管理-->全局设定-->网络-->仅主机(Host-Only)网络,修改IPv4地址为192.168.33.100。保存退出

  ②更改Windows网络配置,修改VirtualBox Host-Only Ethernet Adapter手动设定ip地址为192.168.33.100。

  ③修改vagrant的配置文件VagrantFile,在private-network中修改对应网络设置为:config.vm.network "private_network", ip: "192.168.33.100", name: "VirtualBox Host-Only Ethernet Adapter" 这段配置的表示使用现有的网络配置,不再自动创建对应的网卡信息。

  再次启动即可进入虚拟机了~~~

 

posted @   郭延龙  阅读(4199)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示