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
*
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.
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
Any clue what is wrong with the setup?
You can try to first register the virtual machine:
VBoxManage registervm your_virtual_machine.vbox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With