Could not find a registered machine with UUID

Discussions related to using VirtualBox on Windows hosts.
Post Reply
bagheera
Posts: 1
Joined: 4. Sep 2012, 13:02

Could not find a registered machine with UUID

Post by bagheera »

hi

I see a difference in vboxmanage behaviour when my command prompt is launched normally versus as-admin for the same user in the same directory.
In the normal case showvminfo returns correctly. In the case of admin, showvminfo says:
VBoxManage.exe: error: Could not find a registered machine with UUID {44400b37-8e97-4511-ba0f-7b1e899c11e7}
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown Context: "FindMachine(Bstr(VMNameOrUuid).raw(), machine.asOutParam())" at line 2333 of file VBoxManageInfo.cpp

The environment variables are same in both cases. I did a diff on set and it is fine. Any pointers?

thanks
bagheera
thomasjj3
Posts: 2
Joined: 17. Oct 2012, 14:08

Re: Could not find a registered machine with UUID

Post by thomasjj3 »

I too am having the same issue on Windows 7 x64, the basic layout of the issue is as such:
  • I've set VBOX_USER_HOME to allow multiple users access to the same VMs on the unit.
  • I've scripted a BAT file that restores a clean snapshot, creates a folder, pushes an installer into it and launches it.
  • This BAT file works 100% of the time when I ececute it as standard user (simply double-clicking on the BAT).
  • When the batch file is launched through Jenkins or via right-clicking and choosing "Run as Administrator" the batch file fails stating it can not find the virtual machine.
I've tried launching VBoxManage from the VirtualBox installation folder, I've tried launching VBoxManage from the folder containing the VirtualMachines (Where VBOX_USER_HOME also points). I've even tweaked all the permissions so that all the involved accounts have full read/write/execute permission to both folder locations. I've verified that not only is the "VirtualBox.xml" file correctly located in the VBOX_USER_HOME directory, but also that VirtialBox is writing it's logging there now, indicating it took the Environment Variable correctly. Lastly I verified that the UUID is, in fact, in the XML File. Very frustrating.

D:\VirtualMachines>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" snapshot "6456b630-ff1a-41e4-bca6-294767fd3058" restore automatedTesting
VBoxManage.exe: error: Could not find a registered machine with UUID {6456b630-ff1a-41e4-bca6-294767fd3058}
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(bstrMachine.raw(), ptrMachine.asOutParam())" at line 275 of file VBoxManageSnapshot.cpp
I sure wish I knew where the heck VirtualBox was looking but the error doesn't really indicate any paths that it checked for any configurations. I'm out of ideas.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Could not find a registered machine with UUID

Post by mpack »

@thomasjj3: You haven't provided any info to its impossible to be sure, but you probably have the command syntax wrong. It's VBoxManage snapshot <VM_UUID> restore <snapshot_UUID>. I.e. you should be passing two UUIDs, not one, and the first UUID should be that of your VM (or give the VM name in quotes), the second ID is ditto, except snapshot UUID or a perfectly capitalized name in quotes.
thomasjj3
Posts: 2
Joined: 17. Oct 2012, 14:08

Re: Could not find a registered machine with UUID

Post by thomasjj3 »

It's not a scripting issue, the script runs fine as a normal user, I think it's more of a Windows 7/User Specific settings issue.

Here's what solved it for me:

* Added the VBOX_USER_HOME environment variable.
* Added the VBOX_USER_HOME to the path statement.
* Default VirtualMachine folder is same as VBOX_USER_HOME.

And finally a reboot of everything.

Here's my script, which is now working perfectly:

Code: Select all

@Echo off
::This variable is for testing, this should be commented out before committing.
REM SET WORKSPACE=%~dp0
path = %PATH%;"C:\Program Files\Oracle\VirtualBox";"D:\VirtualMachines";

:: Some general path information.
SET VBoxPath=C:\Program Files\Oracle\VirtualBox
SET VBoxManage="%VBoxPath%\VBoxManage.exe"

::This is the ID of the Virtual Machine we wish to control.
SET VBoxUID="6456b630-ff1a-41e4-bca6-294767fd3058"

:: The snapshot that contains the desired pre-product-install configuration
SET VBoxSnapshot=automatedTesting

:: Get the name of our install file, since it changes with every build we need 
:: to enumerate the proper install file and store in variable for later use.
FOR /F "Usebackq" %%I in (`dir /b %WORKSPACE%\myInstaller\*.exe`) DO (
	SET myInstaller=%%I
)

:: Test to see if our VM Is running, for now if it is we'll kill the VM
:: We can't restore our necessary snapshot if the VM is running.
FOR /F "usebackq tokens=2 delims={}" %%I in (`%VBoxManage% list runningvms`) DO (
	If %%I==%VBoxUID% (
		Echo Target VM is running, powering off.
		%VBoxManage% controlvm "%%I" poweroff
		ping -w 5000 -n 1 1.1.1.1 > nul
		Echo Machine State is now Powered down
		Echo.
	)
)
:: Restore our clean snapshot
Echo Restoring clean snapshot.
%VBoxManage% snapshot %VBoxUID% restore %VBoxSnapshot%
Echo.

Echo Starting the Virtual Machine.
:: Start the virtual machine
%VBoxManage% startvm %VBoxUID%
Echo.

Echo Creating target directory on guest VM
:: Lets place our installer on the Virtual Machine
%VBoxManage% --nologo guestcontrol %VBoxUID% createdirectory C:\buildWorkspace --username Administrator --password NoSharingPwd
Echo Copying %myInstaller% to guest VM
%VBoxManage% --nologo guestcontrol %VBoxUID% copyto "%WORKSPACE%\myInstaller\%myInstaller%" "C:\buildWorkspace\%myInstaller%" --username user --password NoSharingPwd
Echo.

Echo Prepairing to launch the product Server Installation, average duration 15 minutes:
Echo Launching the product installer at %TIME%

%VBoxManage% --nologo guestcontrol %VBoxUID% execute --image "C:\buildWorkspace\%myInstaller%" --wait-exit --username Administrator --password NoSharingPwd -- -q
Echo The product installer completed at %TIME%
Echo The VM is now rebooting as part of the install process.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Could not find a registered machine with UUID

Post by mpack »

The optional VBOX_USER_HOME environment variable overrides the default folder for VirtualBox.xml (*). If overriding the default folder fixed your problem then it implies that some action of yours had rendered the default location incorrect, i.e. you were logged in as the wrong user or you had moved the file somewhere else yourself.

(*)VirtualBox.xml contains the list of registered VMs and their folder locations.
Post Reply