[vbox-dev] good way of detecting guest vm reboot?

Knut St. Osmundsen knut.osmundsen at oracle.com
Thu Jul 22 15:29:55 PDT 2010

Huihong Luo wrote:
> need to do some cleanup after a guest reboot, e.g., to close all taskbar
> buttons and system tray icons from that vm.
> One way is to detect the additions state from the vm, any other better
> way to detect a reboot?

Depends on where in the code you are.  If you program the main API, the
additions state change event is the best way to detect it I think.  On a
deeper level there are several ways to get a callback when the VM is
reset.  PDM Device & Drivers have pfnReset callback which gets worked
when the VM is reset or reboot.  On the VM level there one can register
a callback via VMR3AtStateRegister that gets called on every state
change and it would then be possible to take action when leaving any of

Hope this was of some help.


Kind regards / Mit freundlichen Gruessen / Vennlig hilsen,


ORACLE Deutschland B.V. & Co. KG  Knut St. Osmundsen
Werkstrasse 24                    Senior Staff Engineer, VirtualBox
71384 Weinstadt, Germany          mailto:bird at sun.com

Hauptverwaltung: Riesstr. 25, D-80992 Muenchen
Registergericht: Amtsgericht Muenchen, HRA 95603

Komplementaerin: ORACLE Deutschland Verwaltung B.V.
Rijnzathe 6, 3454PV De Meern, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschaeftsfuehrer: J. Kunz, M. van de Molen, A. van der Ven

More information about the vbox-dev mailing list