Hi @All,
i have an Local VM that is installed as a Service.
So the VM starts with Windows and is alttime available.
Now i want to make a Script or something with wich i can shutdown the VM with one click.
I looked for VM PowerCLI but here, i think, i need a server (ESXi) and that doesnt work with a Local VM.
And vmware.exe -q PathToVM.vmx doesnt work with a Background Machine, also i dont know if this is a clean shutdown
Ideas how it is possible ?
Best Regards
Thomas
Ps. Sry for bad English
Version: Workstation 12 PRO 12.5.6
Instead of vmware.exe try to create a script with
vmrun.exe stop <path-to-vmx>
Hey,
thanks for your answer.
That dont Work:
Error: The virtual machine is not powered on: C:\VM\MyVM.vmx
Tried with a VM that runs in foreground, that works but not when the VM run in the Background....
Edit:
By the Way. After this manual i installed the VM as Service:
Deine Anleitung ist uralt.
Welche WS-version hast du ?
Die aktuellen Versionen haben ein feature namens shared VMs. Damit könntest du deine VM auch automatisch starten.
Wenn du deine VM die als Dienst läuft stoppen willst müsstest du auch mit demselben Account ein cmd ausführen.
Stimmt die ist alt ![]()
Meine Workstation ist die Version 12.5.6
Wie würde das ganze den via Shared VM's funktionieren ??
Menü > VM > Manage > Share
Probier mal die VM in eine shared VM umzuwandeln. (Keine Sorge - das lässt sich probemlos rückgängig machen)
Dann sehen wir weiter
Hey,
die Option kannte ich gar nicht :smileyblush:
Damit funktioniert das starten der VM mit dem Host auf jeden Fall problemlos.
Gibt es denn auch noch einen Weg die VM automatisch "sauber" herunterzufahren wenn der Host runterfährt ?
Host = Win10 Pro
VM = WinServer2016
Gruß
Thomas
Glaubt man der Propaganda so sollte das "eigentlich" funktionieren.
Meiner Erfahrung nach werden die VMs aber jedesmal hart abgeschaltet - deswegen sollten man sich keinesfalls darauf verlassen.
Ich würde dir dringend empfehlen dir hier für eine Lösung per "vmrun stop" aus zu tüfteln.
Ulli
Hi,
PMJI, while I can read German without much issues, I'll save you the trouble of me butchering your language and write in English instead.
As Ulli said, it was supposed to work, then it got confirmed that it works - except - for shared machines... umm.. right..
Now in the next Workstation this is claimed to be a new feature. OK.. well.. call me not convinced yet.
Anyways.. please have a look at the following post, the author of it has researched this particular topic and found ways to have the VM shut down properly.
VMWare Workstation 12.5 Auto Suspend of Guests when Windows Host Shuts Down
Note: I haven't tried this myself as my "always on VMs" run on vSphere, but it looks quite convincing.
--
Wil
Hey,
im surprised...
First the .bat File doesnt work with Shared-VM's.
But in my Tests i found out that my Shared VM automatically shutdown when i restart my PC.
Here you see the Eventlog without Task-Sheduler, any Scripts or something. Just restart the Host:
Information: "Das Betriebssystem wird zur Systemzeit 2017-09-20T05:57:52.641084100Z heruntergefahren."
I got no crtiical Log.
You guys think that it works too when Windows automatically restarts after installing updates ?
continuum,
ich hätte da mal noch eine Frage....
Folgendes Szenario:
Ich muss des öfteren mal neue Rechner installieren, dazu habe ich eine Referenz-Windows10-VM.
Wenn ich dann also ein neues W10 installieren muss, nehme ich einfach die Festplatte stecke sie in meine Dockingstation am PC und kopiere da den Inhalt der VM drauf.
Danach habe ich Plug-and-Play und alles ist fertig.
Jetzt würde ich die VM gerne automatisch aktuell halten. Heißt:
1) Der Host ist immer an. Hier sollte die VM einmal die Woche (Freitags) automatisch via Aufgabenplanung hochgefahren werden.
2) Die VM installiert sich alle Windows-Updates
3) Die VM wird Sonntags wieder herruntergefahren.
Die 2 bekomme ich noch selber hin.
Meine Probleme sehe ich hier:
1) Der Host ist gesperrt
2) Damit ich den Punkt 2 oben umsetzen kann, muss die VM sich mit einem Benutzer anmelden (Allerdings nicht im Gast-Windows eingestellt, sonst muss ich das immer abschalten wenn ich einen Rechner ausliefere)
3) Der Host ist natürlich Sonntags immer noch gesperrt.
4) Mit VMrun habe ich schon etwas rumgespielt, bekomme es aber nicht hin die -t ws-shared Befehle zu nutzen da ich mich immer an einem Server anmelden soll. Aber die VM liegt ja lokal....
Benötige ich für das vorhaben die VM überhaupt als SharedVM ? Dachte eventuell wegen des einloggens des Users.
Hoffe Du kannst mir da etwas helfen.
Gruß
Thomas
