首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >vmrun.exe的多个问题

vmrun.exe的多个问题
EN

Stack Overflow用户
提问于 2012-02-16 14:10:32
回答 2查看 2.6K关注 0票数 3

主机:64位VMWare 7专业版,带Windows工作站7.1

我想要自动化的是:

代码语言:javascript
复制
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

基本思想是能够使用受控的OS映像和配置将不同版本的构建部署到VM中。

我的批处理文件类似于:

代码语言:javascript
复制
     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) start命令可以正确地启动VM,但不会返回到我的批处理文件中的下一行。我等待了30多分钟以确保。2) copyFileFromHostToGuest不复制文件,不返回或显示任何错误。它就坐在那里。我试图复制的测试文件是30KB,我等了15分钟左右。

EN

回答 2

Stack Overflow用户

发布于 2012-03-10 03:17:31

看起来您的问题可能是启动命令在虚拟机打开的整个过程中都处于活动状态。您是否尝试过在单独的批处理文件中调用它?

代码语言:javascript
复制
vmrun clone %vm_template_path% %new_vm_path% full

REM Creates a separate batch to run the start command which will delete itself when done
ECHO vmrun -T ws -gu <user> -gp <pass> start %new_vm_path% gui > startVM.bat
ECHO del /q /s /f startVM.bat >> startVM.bat

REM runs the separate batch
startVM.bat

REM if the VM needs to be booted before you continue with the file copy you can try a TIMEOUT in here like the two minute one below:
TIMEOUT 120

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
EN

Stack Overflow用户

发布于 2013-09-18 16:13:03

您是否在32位Windows作为主机操作系统的计算机上尝试过它?我也有同样的问题,在打开一个支持案例和许多错误搜索后,发现64位windows上的熊猫杀毒软件阻止了VMRun的问题。因此,我要么更换杀毒软件,要么使用32位Windows。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9306401

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档