有时候并不是经常用虚拟机,不需要每次开机都自启动虚拟机的每项服务,但是默认虚拟机的各项服务都是自启的,被设置为自动开启,不免有点浪费了系统资源 ,但设置为手动之后 ,用VM虚拟机的时候,又不得不去 一个一个服务打开 很麻烦。
下面介绍一个简单的批处理来解决这些问题:
首先 先看一下 VM虚拟机的服务和连接,如图所示,不同的VM可能有不同,这里以VM10为例:

批处理文件如下:
新建txt文档,修改后缀名为.bat 比如VM.bat
- @echo off
- color 0a
-
- GOTO MENU
- :MENU
- echo.=-=-=-=-=VMware 手工启动批处理=-=-=-=-=
- echo. 1 启动VMware各项服务
- echo. 2 关闭VMware各项服务
- echo. 3 exit
- echo 请输入选择项目的序号:
- set /p ID=
- if "%id%"=="1" goto start
- if "%id%"=="2" goto stop
- if "%id%"=="3" exit
- PAUSE
-
- :start
- net start "VMware USB Arbitration Service"
- net start "VMware Authorization Service"
- net start "VMware NAT Service"
- net start "VMware DHCP Service"
-
-
- goto MENU
-
- :stop
- rem net stop "VMware Registration Service"
- net stop "VMware USB Arbitration Service"
- net stop "VMware Authorization Service"
- net stop "VMware NAT Service"
- net stop "VMware DHCP Service"
- rem net stop "VMware Virtual Mount Manager Extended"
-
- goto MENU
每次启动虚拟机前,先运行一下VM.bat批处理程序,win7需要以管理员身份运行,不然会报错。
注:其中没有加上
- VMware Workstation Server
这个服务用于虚拟机分享,一般用不到,用到的时候再手动开启即可。
运行界面如下:


