Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBoxManage.exe: error: Could not find a registered machine named 'Windows-PC' while Running from Jenkins

Here is the details of my environment. 1. I have two nodes(win7x64 and winserver2008R2) added as slave in Jenkins. 2. I have installed virtualbox to both the system and created virtualbox image with same MachineName, VM Name and Snapshot name. 3. Now I have batch file with following commands:

    cd /d "C:\Program Files\Oracle\VirtualBox"
    VBoxManage snapshot "Windows-PC" restore "CleanPC"
    VBoxManage startvm "Windows-PC"

    VBoxManage --nologo guestcontrol "Windows-PC" execute --image "c:\\IntegrationTestAssemblies\\RunIntegrationTests.bat" --username "user1" --password "pwdddd" --wait-exit --wait-stdout --wait-stderr

    VBoxManage controlvm WindowsPC poweroff

*

  1. When I run this command manually from host/slaves, it works perfectly. I have checked, vms are registered and VBoxManage list vms also returns list of vms.

  2. But issue i am facing is, while i am trying to run it through jenkins " using a Multi-configuration project, it fails to launch vm with error

    [exec] C:\Program Files\Oracle\VirtualBox>VBoxManage.exe snapshot "Windows-PC" restore "CleanPC" [exec] [exec] C:\Program Files\Oracle\VirtualBox>VBoxManage.exe startvm "Windows-PC" [exec] [exec] 2/25/2015 7:33:18 PM: error: VBoxManage.exe: error: Could not find a registered machine named 'Windows-PC' [exec] VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown [exec] VBoxManage.exe: error: Context: "FindMachine(bstrMachine.raw(), ptrMachine.asOutParam())" at line 280 of file VBoxManageSnapshot.cpp [exec] VBoxManage.exe: error: Could not find a registered machine named 'Windows-PC' [exec] VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown [exec] VBoxManage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 575 of file VBoxManageMisc.cpp

  3. Any clue what is wrong with the setup?

like image 868
Ashok Mazumder Avatar asked Feb 25 '15 14:02

Ashok Mazumder


1 Answers

You can try to first register the virtual machine:

VBoxManage registervm your_virtual_machine.vbox

like image 158
Angel.Chorbadzhiev Avatar answered Sep 22 '22 02:09

Angel.Chorbadzhiev