VMWARE-HOSTD Auto start and stop for VMware Virtual machine Services

Source: Internet
Author: User
Tags windows net

Installing the Virtual Machine Task Manager will cause Vmware-hostd.exe to take up 80 ports, causing XAMPP to open, so you want to turn off VMware, the solution is as follows: Start-run--services.msc, find the service that starts with the VM, change to Manual, and stop the service. Here's how to: http://bbs.cfanclub.net/thread-497122-1-1.html When you want to use VM virtual machinesVMware Authorization service must be turned on. VMware DHCP Service, VMware NAT Service is network-related. You cannot use the network without turning on the virtual machine. The VMware Agent Service and the VMware USB Arbitration Service are set to manual and generally do not need to be started when using virtual machines. There are also 2 network connectionsVMware Network Adapter VMnet1, vmware network Adapter VMnet8
These two are not available if you don't use a virtual machine. It will be opened and banned together with those services.
Start the STOP service statement net start/stop \ "service name \" (PS: Fill in service name   Not display name This is a mistake)

(\ "\" This quote is best taken, in order to avoid unnecessary trouble.)
which means the simple code is
start
    1. @echo off
    2. ECHO is enabling the service ...
    3. net start \ "Vmauthdservice\"
    4. net start \ "Vmnetdhcp\"
    5. net start \ "VMware NAT service\"
    6. ECHO is enabling network connections ...
    7. netsh interface set interface \ "VMware Network Adapter vmnet1\" Enable
    8. netsh interface set interface \ "VMware Network Adapter vmnet8\" Enable
    9. Echo Network connects VMware Networks Adapter VMnet1, vmware network Adapter VMnet8 boot success ...
    10. Pause
Copy Codeprohibited by
    1. @echo off
    2. ECHO is disabling the service service ...
    3. net stop \ "Vmauthdservice\"
    4. net stop \ "Vmnetdhcp\"
    5. net stop \ "VMware NAT service\"
    6. ECHO is disabling network connections ...
    7. netsh interface set interface \ "VMware Network Adapter vmnet1\" Disable
    8. netsh interface set interface \ "VMware Network Adapter vmnet8\" Disable
    9. Echo Network connection VMware Networks Adapter VMnet1, VMware network Adapter VMnet8 disabled success ...
    10. Pause
Copy CodeEcho's back is what you want to say ... That's all.
In short, the code is so simple.
This solves these problems with two simple batch files.
(PS: If the Win7 system is running, please right-select Run as Administrator otherwise error 5 will appear!) )
If you have trouble, you can make these two synthetic one.
Here's what I'm using now.
  1. @echo off
  2. for/f \ "Skip=3 tokens=4\"%%i in (& #39, sc query \ "vmauthdservice\" & #39;) do set \ "Zt=%%i\" &goto:next
  3. : Next
  4. if/i \ "%zt%\" ==\ "running\" (
  5. Echo Service VMware Authorization Service is running
  6. ) Else (
  7. Echo Service VMware Authorization service is stopped
  8. )
  9. for/f \ "Skip=3 tokens=4\"%%i in (& #39, sc query \ "vmnetdhcp\" & #39;) do set \ "Zt=%%i\" &goto:next
  10. : Next
  11. if/i \ "%zt%\" ==\ "running\" (
  12. Echo Service VMware DHCP Service is running
  13. ) Else (
  14. Echo Service VMware DHCP service is stopped
  15. )
  16. for/f \ "Skip=3 tokens=4\"%%i in (& #39, sc query \ "VMware NAT service\" & #39;) do set \ "Zt=%%i\" &goto:next
  17. : Next
  18. if/i \ "%zt%\" ==\ "running\" (
  19. Echo Service VMware NAT Service is running
  20. ) Else (
  21. Echo Service VMware NAT service is stopped
  22. )
  23. Pause
  24. Echo 1: Enable VM Virtual machine service (VMware Authorization Service, VMware DHCP Service, VMware NAT Service), and network connectivity (VMware
  25. Adapter VMnet1, VMware Network Adapter VMnet8)
  26. Echo 2: Disable VM virtual machine service (VMware Authorization Service, VMware DHCP Service, VMware NAT Service), and network connectivity (VMware
  27. Adapter VMnet1, VMware Network Adapter VMnet8)
  28. choice/c:12/m \ "Depending on the options please select ... \"
  29. if errorlevel 2 goto
  30. if errorlevel 1 goto one
  31. : one
  32. ECHO is enabling the service ...
  33. net start \ "Vmauthdservice\"
  34. net start \ "Vmnetdhcp\"
  35. net start \ "VMware NAT service\"
  36. ECHO is enabling network connections ...
  37. netsh interface set interface \ "VMware Network Adapter vmnet1\" Enable
  38. netsh interface set interface \ "VMware Network Adapter vmnet8\" Enable
  39. Echo Network connects VMware Networks Adapter VMnet1, vmware network Adapter VMnet8 boot success ...
  40. Echo Press any key to exit ...
  41. Pause>nul
  42. Exit
  43. : both
  44. ECHO is disabling the service service ...
  45. net stop \ "Vmauthdservice\"
  46. net stop \ "Vmnetdhcp\"
  47. net stop \ "VMware NAT service\"
  48. ECHO is disabling network connections ...
  49. netsh interface set interface \ "VMware Network Adapter vmnet1\" Disable
  50. netsh interface set interface \ "VMware Network Adapter vmnet8\" Disable
  51. Echo Network connection VMware Networks Adapter VMnet1, VMware network Adapter VMnet8 disabled success ...
  52. Echo Press any key to exit ...
  53. Pause>nul
  54. Exit
Copy CodeAdding a detection service is a simple statement to open.
If you don't love what you write, you can copy the code directly into Notepad. Change the file name to VMware Virtual Machine service, network connection. BAT is OK. ======================================================================================= now a possible majority of VMware virtual machines or the use of NAT network mode , this method needs to start two services: Vmnat and VMDHCP. If you let them as automatic service, boot up on the start of personal comparison does not like. So try to get the service to start when using the virtual machine, and stop when you exit. The Windows Net start/stop command can start the stop service. So I wrote a bat script to do this:
Vmstart.bat:
------------------
net start "VMware DHCP Service"
net start "VMware NAT Service"

Vmplayer

net stop "VMware DHCP Service"
net stop "VMware NAT Service"
-------------------
* * Remember to change those two services (Vmnat and VMDHCP) to manual, you can disable the Vmauth this. **
* * I use the vmplayer, you use VMware Station to change to VMware. * * This way, execute this bat to start the service, run the virtual machine, and then wait for the virtual machine to exit, then stop the service. The price is that there is a cmd.exe waiting for the virtual machine to exit, unseen, and not affect anything. But in the execution of bat will appear a cmd black box, want to not let appear, so I wrote a few lines of Win32 program call ShellExecute () Execute bat, and pass the Sw_hide parameter, you can not display the black frame. Later on the internet it was easier to find others using VBScript:
Runbat.vbs:
----------------------
Dim wsh
If WScript.Arguments.Count <> 1 Then
MsgBox "No bat! specified for execution"
Wscript.Quit (-1)
End If
Set Wsh=wscript.createobject ("Wscript.Shell")
Wsh. Run wscript.arguments (0), Sw_hide, FALSE
----------------------, put these two files in the Vmplayer/vmware station directory below, create a shortcut, write:
Runbat.vbs Vmstart.bat This is enough, but you can also change the icon of the shortcut to the icon of the virtual machine. Start the virtual machine later to open this shortcut on the line. Although trouble, but once and for all things to do:) p.s. You can also use this method to start the service on other software. P.S. Using Vmplayer is free and does not require a registration code, but Vmplayer cannot create and modify virtual machines. P.S. The new Vmplayer 2 and the VMware Station V6 large volume, found mainly inside the Linux.iso a lot, is the vmware-tools of Linux guest. The previous use of VMware V5 found that Debian and Ubuntu seems to be installed Vmware-tools compile errors, suggesting that the version does not match something. With this version of the good. And with VMware v5.x my XP often waits a long time to log in, with these new versions seems to be fine. P.S. Vmware-tools: Install the same linux-headers as the uname-r version, I was first dist-upgrade to have a match. It also seems to make include/linux/version.h generate this file. P.S the VMware Station V6 Vmware.exe to the Vmplayer directory, you can run Vmware.exe to build and modify the virtual machine, but not run, anyway we usually use vmplayer run. P.s. Again. I often open a virtual machine and log in to the virtual machine with putty because I don't have X window. (Set UTF-8 encoding, putty can also display and input kanji in the console.) It is recommended to use the fixed sys font. I want to hide the virtual machine to the tray, which is said to have this function on the VMware Station V6, but Vmplayer has no:(. Consider Powermenu this little software. But one more burden ...

VMWARE-HOSTD Auto start and stop for VMware Virtual machine Services

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.