Remotely running "vmrun command" on server machine from jenkins

1k Views Asked by At

I have windows 7_x64 Virtual Machine on Server machine running on Windows Server 2008 R2. I want to run this VM from jenkins (CI tool which executes batch file, running on same server). I am using vmrun utility to do so. When i run

vmrun -T ws -gu *** -gp *** start "vmx file path.vmx"

this executes fine on server command prompt (locally). but when i try to exceute the same from any of the client machine (by visiting jenkins site) I get

Error: There was an error in communication

After some troubleshooting, I can say vmrun command is not responding whenever it is evoked remotely. but it is confusing me, because I have jenkins which is running those commands is installed on same server. i am just running job from thin client. how does that make any difference?

Could anyone help me troubleshooting this issue? Thanks!

For reference:

*Server machine(host): Windows Server 2008 R2

*Virtual machine(guest): Windows 7 x64

*Jenkins : Installed on same server (host)

*client : remote windows machine, accesses the jenkins instance from browser and triggers the job

*problem/error : vmrun commands dont execute.

1

There are 1 best solutions below

0
On

Jenkins does not execute anything on "client" (i.e. the machine with the browser from which you accessed Jenkins instance). Jenkins will only execute anything on Master (what you called "server machine") or Slave nodes.

Now, there can be several differences between running the command from your local command prompt (on server) and through Jenkins. The primary difference is that Jenkins runs under a separate session, usually under a separate user, which may have different permissions, however that depends on how you have installed and configured the Jenkins session.

To identify if there are any Environment variable differences, type set on your local command prompt, and then execute Jenkins with just set in the build step. Compare the two. Other than Jenkins specific variables, everything else should be same.

Also, verify that your Jenkins user (the one running the service) has permissions to do whatever your are doing.