"VBoxManage guestcontrol" doesn't return to jenkins job after finishing its execution

Discussions about using Windows guests in VirtualBox.
Post Reply
rpwerner
Posts: 2
Joined: 23. Jun 2017, 11:30

"VBoxManage guestcontrol" doesn't return to jenkins job after finishing its execution

Post by rpwerner »

Hello everybody,

I have a jenkins job that executes a bat script on a windows 7 vbox machine.
The host OS is a Linux and before starting the script, I share a folder from Linux to the Windows 7 VM and then I run the following command:

VBoxManage guestcontrol VMName --username 'UserName' --password 'Password' run 'sharedNetworkDrive:\script.bat'

This bat script takes normally 45 minutes to finish, but although the execution finished on the guest, I never get a response back to my jenkins job. I know that the bat finished cause I don't see any cmd.exe proccess running on the machine anymore and the result of the bat is available as well.

Also the log on the jenkins job stays hanging on a particular point as if it was still waiting to finish and this causes the job to be stuck on that point and not moving forward.

Does anyone know or have an idea why this might be happening?

Thank you in all in advance!

Some informations:
VBox version 5.0.22 r108108
Windows 7 as guest
Linux Red Hat Enterprise Linux Server release 7.3 (Maipo) as host
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: "VBoxManage guestcontrol" doesn't return to jenkins job after finishing its execution

Post by scottgus1 »

Never heard of a "Jenkins job" before so I googled (well, binged, that may be pertinent). This is in the search results: https://wiki.jenkins-ci.org/display/JEN ... ernal+jobs. Maybe needed on your end?

Also look at Vboxmanage controlvm in the manual. There's some command line switches waiting for guest tasks to finish that may help. perhaps "start" instead of "run"?
rpwerner
Posts: 2
Joined: 23. Jun 2017, 11:30

Re: "VBoxManage guestcontrol" doesn't return to jenkins job after finishing its execution

Post by rpwerner »

scottgus1 wrote:Never heard of a "Jenkins job" before so I googled (well, binged, that may be pertinent). This is in the search results: https://wiki.jenkins-ci.org/display/JEN ... ernal+jobs. Maybe needed on your end?

Also look at Vboxmanage controlvm in the manual. There's some command line switches waiting for guest tasks to finish that may help. perhaps "start" instead of "run"?
Thank you for your reply and sorry for the delayed answer.

Regarding the monitoring you suggested, it could be useful, but only for this purpose, I guess it would be too much. The case I mentioned started happening since a few weeks only and it has been working for at least a year.

Regarding "start" instead of "run", I will have to test it. At the moment I changed my bat script to execute its action using the "start cmd.bat" so it comes back directly to my jenkins job, after calling the execution. Then on the job, I run a timer and do a polling every 5 minutes and check for the expected result.
Post Reply