windows(win10)批处理脚本
打开vm虚拟机的服务,并且开启无界面虚拟机
@echo off
net start "vds"
net start "VMAuthdService"
net start "VMnetDHCP"
net start "VMware NAT Service"
net start "VMUSBArbService"
net start "VMwareHostd"
"D:\ApplicationFiles\System\VMware Workstation\vmrun.exe" start "F:\virtualMachine\ubuntu15.1X64\ubuntu15.1X64.vmx" nogui
保存为startvm.bat
关闭vm虚拟机的服务
@echo off
"D:\ApplicationFiles\System\VMware Workstation\vmrun.exe" stop "F:\virtualMachine\ubuntu15.1X64\ubuntu15.1X64.vmx" nogui
net stop "vds"
net stop "VMnetDHCP"
net stop "VMware NAT Service"
net stop "VMwareHostd"
net stop "VMUSBArbService"
net stop "VMAuthdService"
保存为shutdownvm.bat
说明:
-
D:\ApplicationFiles\System\VMware Workstation\vmrun.exe
为虚拟机安装目录/ps:如果你把vmrun路径加入了环境变量path后,可以直接使用命令vmrun -
F:\virtualMachine\ubuntu15.1X64\ubuntu15.1X64.vmx
为虚拟机文件位置 -
生成的文件创建快捷方式,右键-属性-高级,设置下 管理员权限 运行,以后双击即可执行
打开还要等个一分钟左右启动好,具体看你的系统性能,接下来就可以正常ssh
连接了。