为什么VirtualBox找不到名为Windows_7的注册机器?

col*_*rco 20 virtualbox

我正在尝试使用VBoxManage setextradata更改虚拟机的TCP/UDP.

每当我输入命令时:

sudo VBoxManage setextradata Windows_7 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestEmule_TCP/Protocol" TCP

我收到以下错误:

VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling a->virtualBox->FindMachine(Bstr(a->argv[0]), machine.asOutParam()) at line 3688!
[!] Primary RC  = VBOX_E_OBJECT_NOT_FOUND (0x80BB0001) - Object corresponding to the supplied arguments does not exist
[!] Full error info present: true , basic error info present: true 
[!] Result Code = VBOX_E_OBJECT_NOT_FOUND (0x80BB0001) - Object corresponding to the supplied arguments does not exist
[!] Text        = Could not find a registered machine named 'Windows_7'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}

已使用GUI创建虚拟机.任何的想法?

$ cd /Users/marco/Library/VirtualBox/Machines/Windows_7
$ ls
Logs                Windows_7.xml
Windows 7.xml.1.5-macosx.bak
$ sudo vboxmanage registervm Windows_7.xml
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling a->virtualBox->OpenMachine(Bstr(a->argv[0]), machine.asOutParam()) at line 762!
[!] Primary RC  = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Full error info present: true , basic error info present: true 
[!] Result Code = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Text        = Could not lock the settings file '/var/root/Library/VirtualBox/Windows_7.xml' (VERR_FILE_NOT_FOUND)
[!] Component   = Machine, Interface: IMachine, {ea6fb7ea-1993-4642-b113-f29eb39e0df0}
[!] Callee      = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}

phi*_*hag 59

它失败是因为你使用的是sudo.VirtualBox设计为由任何用户(在vboxusers组中)运行,sudo以VirtualBox配置为空的root用户身份运行命令.

你可以输入以下内容来检查:

sudo VBoxManage -nologo list vms # Should print only a newline
VBoxManage -nologo list vms # Detailled information about all your VMs
Run Code Online (Sandbox Code Playgroud)

  • @Daniel Rosenstark在Windows上,这也会发生 - 如果你使用了runas(并且可能是对cygwin的sudo). (2认同)

小智 5

!! 仅限Windows!

如果您不是管理员帐户并尝试在管理员 cmd 窗口中修改您的 VM,请键入以下命令:

cd "C:\Program Files\Oracle\VirtualBox"

VboxManage registervm "C:\Users\您的姓名\VirtualBox VMs\您的虚拟机名称\您的虚拟机名称.vbox"

现在运行您的虚拟框修改命令或您正在执行的任何其他操作,它应该可以工作!