1

I want to setup a jenkins job in order to e.g. clone a virtual image. The (working) command line is e.g.

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonevm UbuntuTest --name TestNeu --register

However, the same command line executed in jenkins as window batch script does not work, it gives an error

VBoxManage.exe: error: Could not find a registered machine named 'UbuntuTest'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszSrcName).raw(), srcMachine.asOutParam())" at line 434 of file VBoxManageMisc.cpp

I only can suppose this jenkins script runs as a different user and does not know of the available images located in C:\Users\alex\VirtualBox VMs.

How to fix this problem?

Addendum:

  • Running this as a different user does not seem to work or is impossible: link
Community
  • 1
  • 1
Alex
  • 41,580
  • 88
  • 260
  • 469

1 Answers1

0

You need to define your Jenkins slave process to run as the desired user. First install Jenkins slave as a Windows service , then go the service properties and in the 'Log On' tab change it from the default 'Local System Account' to "This Account:" - enter your account name (alex) and password. Don't forget to restart the service.

antweiss
  • 2,789
  • 1
  • 13
  • 12