Failed to open/create the internal network ‘HostInterfaceNetworking-VirtualBox Host-Only Ethernet Ad

脚本创建多台虚拟机,启动报错

win11系统
vritual Box应用
服务器版本: centos7

1. 启动脚本

boxes = [
	{
		:name => "k8s-m",
		:eth1 => "192.168.56.21",
		:mem => "2048",
		:cpu => "4",
		:sshport => 22230
	},
	{
		:name => "k8s-w1",
		:eth1 => "192.168.56.22",
		:mem => "2048",
		:cpu => "4",
		:sshport => 22231
	},
	{
		:name => "k8s-w2",
		:eth1 => "192.168.56.23",
		:mem => "2048",
		:cpu => "4",
		:sshport => 22232
	}
]
Vagrant.configure(2) do |config|
	config.vm.box = "centos/7"
	Encoding.default_external = 'UTF-8'
	boxes.each do |opts|
		config.vm.define opts[:name] do |config|
			config.vm.hostname = opts[:name]
			config.vm.network "private_network", ip: opts[:eth1]
			config.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh", disabled: "true"
			config.vm.network "forwarded_port", guest: 22, host: opts[:sshport]
			#config.ssh.username = "root"
			#config.ssh.password = "root"
			#config.ssh.port=opts[:sshport]
			#config.ssh.insert_key = false
			#config.vm.synced_folder ".", "/vagrant", type: "rsync" 
			config.vm.provider "vmware_fusion" do |v|
				v.vmx["memsize"] = opts[:mem]
				v.vmx["numvcpus"] = opts[:cpu]
			end
			config.vm.provider "virtualbox" do |v|
				v.memory = opts[:mem];
				v.cpus = opts[:cpu];
				v.name = opts[:name];
			end
		end
	end
end

2. 报错如下

请添加图片描述

Stderr: VBoxManage.exe: error: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsol

3. 解决方案

请添加图片描述
请添加图片描述
请添加图片描述

4. cmd 管理员模式下执行vagrant up

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值