VirtualBox 上的 IDE 控制器

VirtualBox 上的 IDE 控制器

我遇到了 virtualbox 问题。我在 CentOS 服务器(无 GUI)上使用它来虚拟化将从具有远程桌面连接的客户端使用的机器。

我正在尝试使用以下命令将 ISO 文件附加到虚拟机:

vboxmanage modifyvm "intouch" --dvd /usr/share/virtualbox/VBoxGuestAdditions.iso

但它回应

VBoxManage: error: No drive attached to device slot 0 on port 1 of controller 'IDE Controller'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
Context: "MountMedium(Bstr("IDE Controller").raw(), 1, 0, dvdMedium, FALSE )" at line 962 of file VBoxManageModifyVM.cpp

所以我尝试连接一个 IDE 控制器

VBoxManage storagectl "intouch" --add ide --name "IDE Controller"

但它说

VBoxManage: error: Storage controller named 'IDE Controller' already exists
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee nsISupports
Context: "AddStorageController(Bstr(pszCtl).raw(), StorageBus_IDE, ctl.asOutParam())" at line 1008 of file VBoxManageStorageController.cpp

答案1

您正在搜索的命令是:

 VBoxManage storageattach TheNameOfYourVM --storagectl "IDE Controller"     --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso

如果这不能立即起作用,请尝试按照这个对我有用的示例进行操作:

   $ VBoxManage storagectl JH --name "IDE Controller" --remove 
   $ VBoxManage storagectl JH --name "IDE Controller" --add ide
   $ VBoxManage storageattach JH --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
   $ 

答案2

我遇到了同样的问题,检查文件action_provision对我来说很有帮助

if ! File.exist?(".vagrant/machines/default/virtualbox/action_provision")
    vb.customize ["storagectl", :id, "--name", "IDE Controller", "--add", "ide"]
end

配置完成后,vagrant 会创建该文件。第二次启动时,它已经就位。(参见https://stackoverflow.com/questions/24855635/check-if-vagrant-provisioning-has-been-done

相关内容