Sunday, May 24, 2020

Starting VMware Services and starting and shutting down the guest operating system using Powershell for VMware Workstation

Start-Service "VMware Authorization Service"
Start-Service "VMware DHCP Service"
Start-Service "VMware NAT Service"
Start-Service "VMware USB Arbitration Service"
start-service "VMware Workstation Server"

#to stop the service which has dependent processes without confirmation

#stop-service "VMware Authorization Service" -Force

#to stop the service which has dependent processes with confirmation

#stop-service "VMware Authorization Service" -Force -confirm

#Now we will try to use vmrun executable to start our virtual machine

#the location of this variable is in C:\Program Files (x86)\VMware\VMware Workstation location

#let us add this path temporarily to our path variable

$env:Path += ";C:\Program Files (x86)\VMware\VMware Workstation"

#we should now access the vmrun command,let us see if vmrun command is working or not by trying #to start our virtual machine

vmrun -T ws start "D:\oracle virtual\DeveloperDaysVM2019-05-31_20.vmx"

#ok the virtual machine starts and I am able to access it remotely using putty

#so let us shutdown the guest softly

#vmrun -T ws stop "D:\oracle virtual\DeveloperDaysVM2019-05-31_20.vmx" soft

#for hard shutdown

#so let us shutdown the guest softly

#vmrun -T ws stop "D:\oracle virtual\DeveloperDaysVM2019-05-31_20.vmx" hard

No comments:

Post a Comment