主持人:Windows 7的親64位通過VMware Workstation 7.1多個問題vmrun.exe
我所試圖實現自動化:
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
的基本理念是能夠部署不同的版本將其構建到具有受控操作系統映像和配置的虛擬機中。
我的批處理文件看起來像:
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命令確實啓動了虛擬機,但從未返回到我的批處理文件中的下一行。我等了30多分鐘才確定。 2)copyFileFromHostToGuest不復制文件,從不返回或顯示任何錯誤。它只是坐在那裏。我試圖複製的文件是30KB,我等了15分鐘左右。
我今天試了一下,沒有幫助。我甚至嘗試手動啓動虛擬機,然後運行copyFileFromHostToGuest命令,但它仍然卡住。我瀏覽了在臨時目錄中創建的日誌,但他們什麼都沒有。我放棄了這種方法,所以相反,我的批處理文件在克隆/啓動後在VM上安裝了一個共享目錄,然後使用WMI +批處理文件完成其餘部分。但感謝您的幫助。 – 2012-03-16 00:51:51