用來關掉 windows7 的 UAC, 從 ievms 的 Control ISO 改版出來, 只保留了移除 win7 UAC 的功能
vmname='IE8 - Win7'
VBoxManage import "$vmname".ova
VBoxManage snapshot "$vmname" take init
deuac.iso 的來源是修改 ievms 的 Control ISO 建立方式做出來的, 只保留了移除 UAC 的功能
VBoxManage storageattach "$vmname" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium deuac.iso
VBoxManage startvm "$vmname"
while `VBoxManage showvminfo "$vmname" | grep -q 'running'` ; do; echo "waiting for disable UAC..."; sleep 1; done; echo "DONE\!"
VBoxManage storageattach "$vmname" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none
VBoxManage storageattach "$vmname" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium VBoxGuestAdditions_4.3.10.iso
VBoxManage startvm "$vmname"
VBoxManage guestcontrol "$vmname" updateadditions --source VBoxGuestAdditions_4.3.10.iso
VBoxManage guestcontrol "$vmname" exec --image c:/Windows/System32/shutdown.exe --username 'IEUser' --password 'Passw0rd!' --verbose --wait-stderr --wait-stdout --wait-exit /r /t 0
VBoxManage controlvm "$vmname" natpf1 "selenium,tcp,,5555,,5555"
VBoxManage guestcontrol "$vmname" exec --image c:/Windows/System32/netsh.exe --username 'IEUser' --password 'Passw0rd!' --verbose --wait-stderr --wait-stdout --wait-exit -- advfirewall set currentprofile state off
VBoxManage guestcontrol "$vmname" mkdir c:/Users/IEUser/Desktop/selenium --username 'IEUser' --password 'Passw0rd!' --verbose
VBoxManage guestcontrol "$vmname" cp `pwd`/programs/ c:/Users/IEUser/Desktop/selenium/ --username 'IEUser' --password 'Passw0rd!' --recursive --verbose
VBoxManage guestcontrol "$vmname" exec --image c:/Users/IEUser/Desktop/selenium/jre-7u51-windows-i586.exe --username 'IEUser' --password 'Passw0rd!' --verbose --wait-stderr --wait-stdout --wait-exit /s
VBoxManage guestcontrol "$vmname" exec --image c:/Users/IEUser/Desktop/selenium/01_start_hub.bat --username 'IEUser' --password 'Passw0rd!' --verbose
VBoxManage guestcontrol "$vmname" exec --image c:/Users/IEUser/Desktop/selenium/02_start_node.bat --username 'IEUser' --password 'Passw0rd!' --verbose