Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2204"
config.vm.disk :disk, size: "400MB", name: "extra_storage1"
config.vm.disk :disk, size: "400MB", name: "extra_storage2"
config.vm.disk :disk, size: "400MB", name: "extra_storage3"
config.vm.disk :disk, size: "400MB", name: "extra_storage4"
config.vm.provision "shell", inline: <<-SHELL
SHELL
end
这是我的 Vagrantfile 代码,我需要使用 vagrant 从 vm 创建一个带有 4 个磁盘的新 VM,但是当我执行 vagrant up 时,我得到:
buntul@ubuntul-VirtualBox:~$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'generic/ubuntu2204'...
Progress: 90%There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "/home/ubuntul/.vagrant.d/boxes/generic-VAGRANTSLASH-ubuntu2204/4.3.6/virtualbox/box.ovf", "--vsys", "0", "--vmname", "generic-ubuntu2204-virtualbox-x64_1701031157562_34965", "--vsys", "0", "--unit", "11", "--disk", "/home/ubuntul/VirtualBox VMs/generic-ubuntu2204-virtualbox-x64_1701031157562_34965/generic-ubuntu2204-virtualbox-x64-disk001.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/ubuntul/.vagrant.d/boxes/generic-VAGRANTSLASH-ubuntu2204/4.3.6/virtualbox/box.ovf...
OK.
0%...NS_ERROR_INVALID_ARG
VBoxManage: error: Appliance import failed
VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 1416 of file VBoxManageAppliance.cpp