Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekschrock/0a388058ee102f3ae2f59fd11fb079f1 to your computer and use it in GitHub Desktop.
Save derekschrock/0a388058ee102f3ae2f59fd11fb079f1 to your computer and use it in GitHub Desktop.
--- src/VBox/Main/src-client/ConsoleImpl.cpp.orig 2021-03-27 01:43:21 UTC
+++ src/VBox/Main/src-client/ConsoleImpl.cpp
@@ -8801,6 +8801,18 @@ DECLCALLBACK(void) Console::i_vmstateChangeCallback(PU
switch (enmState)
{
+ case VMSTATE_POWERING_ON:
+ {
+#ifdef VBOX_WITH_GUEST_PROPS
+ Bstr bstr;
+ that->mMachine->COMGETTER(Name)(bstr.asOutParam());
+ that->mMachine->SetGuestProperty(Bstr("/VirtualBox/VirtualMachine/Name").raw(),
+ bstr.raw(),
+ Bstr("TRANSIENT, RDONLYGUEST").raw());
+ that->mMachine->SaveSettings();
+#endif
+ break;
+ }
/*
* The VM has terminated
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment