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

12,945

You can try to first register the virtual machine:

VBoxManage registervm your_virtual_machine.vbox

Share:
12,945
Ashok Mazumder
Author by

Ashok Mazumder

Updated on June 21, 2022

Comments

  • Ashok Mazumder
    Ashok Mazumder almost 2 years

    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?