win11系统
vritual Box应用
服务器版本: centos7
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
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