32

I'm trying to change TCP/UDP of a virtual machine using VBoxManage setextradata.

Whenever I type the command:

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

I get the following error:

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}

The virtual-machine has been created using GUI. Any idea?

$ 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}
Pang
  • 9,564
  • 146
  • 81
  • 122
collimarco
  • 34,231
  • 36
  • 108
  • 142

7 Answers7

74

It fails because you are using sudo. VirtualBox is designed to be run by any user (in the vboxusers group), and sudo runs the command as the root user whose VirtualBox configuration is empty.

You can check that by typing:

sudo VBoxManage -nologo list vms # Should print only a newline
VBoxManage -nologo list vms # Detailled information about all your VMs
phihag
  • 278,196
  • 72
  • 453
  • 469
  • 1
    really? I'm running Windows, but this is handy to know. – Dan Rosenstark Feb 19 '09 at 15:48
  • 3
    @Daniel Rosenstark On Windows, this would happen, too - if you used runas (And probably sudo on cygwin). – phihag Feb 19 '09 at 15:53
  • Thank you! I would have never thought the problem was sudo. – collimarco Feb 19 '09 at 16:04
  • @phihag, while we're here, isn't there a way to run sudo and keep the current user? sudo -s -H or something? – Dan Rosenstark Feb 19 '09 at 17:34
  • @Daniel Rosenstark Since the whole purpose of sudo is to run a command as another user, I doubt that. Neither -s nor -H do change that, but you can use sudo -u anotheruser to run a command as anotheruser instead of root. The sudo setting keep_env HOME can be used to preserve the home directory. – phihag Feb 19 '09 at 21:12
  • 1
    Confirming that I had this issue on Windows when when I ran cmd.exe with "Run As Administrator", per @phihag – Stew Nov 05 '14 at 19:28
  • `It fails because you are using sudo. ` Thanks! I've been spending so much time why the VM is not found..removing the sudo prefix solved my issue.. – mboy Apr 26 '18 at 23:46
5

!! WINDOWS ONLY!!

If you are not on an admin account and are trying to modify your VM in a administrator cmd window, type these commands:

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

VboxManage registervm "C:\Users\Your Name Here\VirtualBox VMs\Your VM name here\Your VM name here.vbox"

Now run your virtual box modify commands or what ever else you are doing and it should work!

RealScar
  • 51
  • 1
  • 2
  • This was the answer that worked for me. My VM file is on my D:/ drive (set up via the UI) and I couldn't get commands to work. Just needed to register the path. Thank you! – dboswell Mar 15 '22 at 22:46
3

Not a direct answer, but just to put it out there for other people searching for it:

On Mac OS X, you can tell VirtualBox to load VMs from another user's home directory, provided the file permissions allow it, or if you are running VirtualBox as the root user using sudo (e.g. if you absolutely have to access your host's web server on port 80).

The way to do this is to set VBOX_USER_HOME appropriately, e.g.

VBOX_USER_HOME=/Users/the_other_user/Library/VirtualBox

If you want to run VBoxHeadless under root, use:

sudo VBOX_USER_HOME=/Users/your_user_id/Library/VirtualBox nohup \
   VBoxHeadless -s "IE10 - Win7" </dev/null &>/dev/null &
youurayy
  • 1,635
  • 1
  • 18
  • 11
0

I had a similar error message, whenever I used sudo to start VBoxSDL:

Error: machine with the given name not found!
Check if this VM has been corrupted and is now inaccessible.

And similar to ypocat's answer, I solved it for Ubuntu using a small script like this:

#!/bin/bash
export VBOX_USER_HOME=/home/username/.config/VirtualBox
VBoxSDL --startvm nameOfVM

You can use it whenever you need to start your VM as root.

rivar
  • 13
  • 4
0

SOLUTION_1:

Missing Virtual Technology might be the reason. For Intel systems they have Intel VT-x (for AMD they have AMD-V), so make sure it is enabled. You can enable it in the boot screen go to BIOS Setup in that look for System Configuration tab and enable Virtual Technology

snapshot.

SOLUTION_2:

Open terminal or cmd (Run as admin) for Windows, and run SC START VBOXDRV. If it says the service is already running then try SC STOP VBOXDRV and then SC START VBOXDRV.

Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
Udit_1
  • 145
  • 1
  • 1
  • 6
0

REASON: In the above case its uuid-mismatch (w.r.t. what is pointed to what is generated). Typically case of either improper edit of the vbox config files or accidentally deleted images/configs associated.

SOLUTION:

As FIRST Step: Correct the UUID-Mappings;

  1. So, for example, the uuids can be regenerated to correct the mappings. (1)
  2. Or otherwise, if attempted to edit .vbox/.vmdk/VirtualBox.xml files, the mappings should be corrected. (2)

As SECOND Step: Re-register the virtual-machine to the UI.

For example, if can't open the vm's from vbox gui or terminal. Remove the "inaccessible" entry from the GUI first". And then, open the folder of virtual machine and open file <machine name>.vbox with virtualbox and it will get registered. Provided, the uuid-mappings have been already resolved. Else follow the errors, while you attempt to register to make necessary changes in .vbox file.

parasrish
  • 3,864
  • 26
  • 32
shubham singh
  • 79
  • 1
  • 2
0

RealScar solution helped me in addition to other commands and it worked in Ubuntu 20.04, too.

I had the problem initially indicated (VirtualBox unable to find a registered machine). I was getting no results after typing sudo VBoxManage -nologo list vms, so I manually registered the existing machine typing sudo vboxmanage registervm /home/user/VirtualBox\ VMs/machinenamefolder/machinename.vbox. It worked great.

Note: I was creating a Cuckoo Malware Sandbox Analysis.