vmrun.exe 的多个问题
主机:带有 VMWare Workstation 7.1 的 Windows 7 pro 64 位
我试图实现自动化:
1) Clone a template into a new VM. The template is Windows Server 2003 32-bit w/SP1 and already has VMWare tools installed and network and VM settings configured the way I want.
2) Start the VM
3) Copy a batch file and a zip file into the VM which installs a build and copies some files into certain locations. The build is different each time but I want the OS to be the same each time.
4) Run the batch file within the VM
基本想法是能够将不同版本的构建部署到具有受控操作系统映像和配置的 VM 中。
我的批处理文件看起来像:
vmrun clone %vm_template_path% %new_vm_path% full
vmrun -T ws -gu <user> -gp <pass> start %new_vm_path% gui
vmrun -T ws -gu <user> -gp <pass> copyFileFromHostToGuest %new_vm_path% %file_on_host% %file_path_on_VM%
vmrun -T ws -gu <user> -gp <pass> runProgramInGuest %new_vm_%path% -nowait -interactive %file_on_host%
克隆工作得很好。我的问题是: 1)启动命令确实正确启动了虚拟机,但永远不会返回到我的批处理文件中的下一行。我等了30多分钟才确保。 2) copyFileFromHostToGuest 不复制文件,从不返回或显示任何错误。它就坐在那里。我尝试复制的文件大小为 30KB,我等了 15 分钟左右。
Host: Windows 7 pro 64-bit with VMWare Workstation 7.1
What I am trying to automate:
1) Clone a template into a new VM. The template is Windows Server 2003 32-bit w/SP1 and already has VMWare tools installed and network and VM settings configured the way I want.
2) Start the VM
3) Copy a batch file and a zip file into the VM which installs a build and copies some files into certain locations. The build is different each time but I want the OS to be the same each time.
4) Run the batch file within the VM
The basic idea is to be able to deploy different versions of the build into a VM with a controlled OS image and configuration.
my batch file looks something like:
vmrun clone %vm_template_path% %new_vm_path% full
vmrun -T ws -gu <user> -gp <pass> start %new_vm_path% gui
vmrun -T ws -gu <user> -gp <pass> copyFileFromHostToGuest %new_vm_path% %file_on_host% %file_path_on_VM%
vmrun -T ws -gu <user> -gp <pass> runProgramInGuest %new_vm_%path% -nowait -interactive %file_on_host%
The clone works just fine. My problem(s) are:
1) The start command does properly startup the VM, but never returns to the next line in my batch file. I waited over 30 minutes to ensure.
2) The copyFileFromHostToGuest does not copy the file, never returns or display any errors. It just sits there. The file I tried to copy as a test was 30KB and I waited 15 minutes or so.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您的问题可能是启动命令在虚拟机打开的整个过程中都处于活动状态。您是否尝试过在单独的批处理文件中调用它?
It looks like your problem could be that the start command is active the entire time the VM is turned on. Have you tried calling it in a separate batch file?
您是否在以 32 位 Windows 作为主机操作系统的计算机上尝试过?
我遇到了同样的问题,在打开支持案例并进行大量错误搜索后,结果发现是 64 位 Windows 上的 Panda Antivirus 阻止 VMRun 的问题。所以我要么必须更换防病毒软件,要么使用 32 位 Windows。
Have you tried it on a computer with 32 bit Windows as host OS?
I had the same problem, after opening a support case and lots of error searching it turned out to be a problem with Panda Antivirus on 64 bit windows blocking VMRun. So I either had to change Antivirus or use 32 bit Windows.