0

我在 Windows Server 2008 R2 上运行的服务器机器上有 Windows 7_x64 虚拟机。我想从 jenkins(执行批处理文件的 CI 工具,在同一台服务器上运行)运行这个 VM。我正在使用 vmrun 实用程序来执行此操作。当我跑步时

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

这在服务器命令提示符(本地)上执行得很好。但是当我尝试从任何客户端机器上执行相同的操作(通过访问詹金斯网站)时,我得到了

Error: There was an error in communication

经过一些故障排除后,我可以说vmrun命令在远程调用时没有响应。但这让我感到困惑,因为我有jenkins哪些正在运行这些命令的服务器安装在同一台服务器上。我只是从瘦客户端运行工作。这有什么区别?

谁能帮我解决这个问题?谢谢!

以供参考:

*服务器机器(主机):Windows Server 2008 R2

*虚拟机(访客):Windows 7 x64

*Jenkins:安装在同一台服务器(主机)上

*client:远程windows机器,从浏览器访问jenkins实例并触发job

*问题/错误:vmrun 命令不执行。

4

1 回答 1

1

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.

于 2014-06-27T15:26:39.577 回答