Virtual machine auto-start service

It is actually very simple to realize the automatic startup steps when it is turned on. Here are two gadgets from Microsoft. instsrv.exe and srvany.exe Microsoft's official description of instsrv.exe is as follows: Installs and uninstalls executable services and assigns names to them. That is, a little stuff that loads services. Its usage is as follows: intsrv<service name><srvany path> (the srvany path here is the path of the tool srvany.exe) 

 

To explain, srvany.exe is a small program from Microsoft to register a program as a service. It can realize that any program is set to start as a service. You can think about the specific usage.

 

Now that the explanation is over, let’s move on to the actual operation.   

 

1. Put the required tools instsrv.exe and srvany.exe in a folder, here I put them in d:\tools. 

 

2. You need to know the installation path of vmware.exe, take this machine as an example: D:\VMware Workstation\vmware.exe The path of the virtual machine configuration file to be started, the path of the configuration file windows2003.vmx of my 2003 virtual machine is D :\vmare\windows2003\windows server 2003.vmx

 

3. Create a new service Suppose the service name is vm_autostart, so my command line is: instsrvVM_AutoStart D:\tools\srvany.exe

 

4. Register the service in the registry, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vm_autostart New item: "Parameters" In the "Parameters" item, create a new string "Application", the value of the string: "D:\VMware Workstation\vmware.exe" -x "D:\vmare\windows2003\windows server 2003.vmx"

(If you want to load two virtual machine systems at boot, just add a virtual machine configuration file path after it) 

 

5. Set the virtual machine startup status management tool - service, select the properties of vm_autostart - login, select "local system account", and check "allow service to interact with desktop", so that vmware will start after your computer is turned on. interface. Or: "c:\program files\vmware\vmware workstation\vmware.exe" -xe:\vm\ untu.vmx Make it into bat or cmd, put it in the scheduled task, and attach a simple usage tutorial of instsrv. We are on the d drive Create an ipcpu.bat content: at 21:26 shutdown -s -t 200 and then add the service: (put instsrv.exe to C:\Program Files first, of course, other places are fine) C:\Program Files>instsrv .exe ipcpu “d:\ipcpu.bat” The service was s?ssfuly added! Make sure that you go into the Control Panel and use the Services applet to change the Account Name and Password that this newly installed service will use for its Security Context. We use services.msc to open the service management to see that it is closed by default, remember to open it! Remove the service: C:\Program Files>instsrv.exe ipcpu REMOVE

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325771279&siteId=291194637