Index: /trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 33783)
+++ /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 33784)
@@ -61,4 +61,7 @@
 #include "VMMDev.h"
 #include "package-generated.h"
+#ifdef VBOX_WITH_EXTPACK
+# include "ExtPackManagerImpl.h"
+#endif
 
 // generated header
@@ -455,4 +458,10 @@
     AssertComRCReturnRC(rc);
 
+#ifdef VBOX_WITH_EXTPACK
+    unconst(mptrExtPackManager).createObject();
+    rc = mptrExtPackManager->init(NULL, false); /* Drop zone handling is VBoxSVC only. */
+    AssertComRCReturnRC(rc);
+#endif
+
     /* Grab global and machine shared folder lists */
 
@@ -2075,9 +2084,16 @@
     alock.leave();
 
-    int vrc;
-    if (VMR3GetState(mpVM) == VMSTATE_CREATED)
-        vrc = VMR3PowerOn(mpVM); /* (PowerUpPaused) */
-    else
-        vrc = VMR3Resume(mpVM);
+#ifdef VBOX_WITH_EXTPACK
+    int vrc = mptrExtPackManager->callAllVmPowerOnHooks(this, mpVM); /** @todo called a few times too many... */
+#else
+    int vrc = VINF_SUCCESS;
+#endif
+    if (RT_SUCCESS(vrc))
+    {
+        if (VMR3GetState(mpVM) == VMSTATE_CREATED)
+            vrc = VMR3PowerOn(mpVM); /* (PowerUpPaused) */
+        else
+            vrc = VMR3Resume(mpVM);
+    }
 
     HRESULT rc = RT_SUCCESS(vrc) ? S_OK :
@@ -4505,8 +4521,8 @@
         int vrc2 = VMR3Resume(pVM);
         mVMStateChangeCallbackDisabled = false;
-        AssertRC(vrc2);
         if (RT_FAILURE(vrc2))
         {
             /* too bad, we failed. try to sync the console state with the VMM state */
+            AssertLogRelRC(vrc2);
             vmstateChangeCallback(pVM, VMSTATE_SUSPENDED, enmVMState, this);
         }
@@ -5628,4 +5644,7 @@
         alock.leave();
         vrc = VMR3PowerOff(mpVM);
+#ifdef VBOX_WITH_EXTPACK
+        mptrExtPackManager->callAllVmPowerOffHooks(this, mpVM);
+#endif
         alock.enter();
     }
@@ -7521,6 +7540,10 @@
                         {
                             /* Start/Resume the VM execution */
-                            vrc = VMR3Resume(pVM);
-                            AssertRC(vrc);
+#ifdef VBOX_WITH_EXTPACK
+                            vrc = console->mptrExtPackManager->callAllVmPowerOnHooks(console, pVM);
+#endif
+                            if (RT_SUCCESS(vrc))
+                                vrc = VMR3Resume(pVM);
+                            AssertLogRelRC(vrc);
                         }
                     }
@@ -7529,6 +7552,8 @@
                     if (RT_FAILURE(vrc))
                     {
-                        int vrc2 = VMR3PowerOff(pVM);
-                        AssertRC(vrc2);
+                        int vrc2 = VMR3PowerOff(pVM); AssertLogRelRC(vrc2);
+#ifdef VBOX_WITH_EXTPACK
+                        console->mptrExtPackManager->callAllVmPowerOffHooks(console, pVM);
+#endif
                     }
                 }
@@ -7542,6 +7567,8 @@
                     {
                         ErrorInfoKeeper eik;
-                        int vrc2 = VMR3PowerOff(pVM);
-                        AssertRC(vrc2);
+                        int vrc2 = VMR3PowerOff(pVM); AssertLogRelRC(vrc2);
+#ifdef VBOX_WITH_EXTPACK
+                        console->mptrExtPackManager->callAllVmPowerOffHooks(console, pVM);
+#endif
                     }
                 }
@@ -7574,6 +7601,15 @@
 
                             /* Power on the FT enabled VM. */
-                            vrc = FTMR3PowerOn(pVM, (task->mEnmFaultToleranceState == FaultToleranceState_Master) /* fMaster */, uInterval, pszAddress, uPort, pszPassword);
-                            AssertRC(vrc);
+#ifdef VBOX_WITH_EXTPACK
+                            vrc = console->mptrExtPackManager->callAllVmPowerOnHooks(console, pVM);
+#endif
+                            if (RT_SUCCESS(vrc))
+                                vrc = FTMR3PowerOn(pVM,
+                                                   task->mEnmFaultToleranceState == FaultToleranceState_Master /* fMaster */,
+                                                   uInterval,
+                                                   pszAddress,
+                                                   uPort,
+                                                   pszPassword);
+                            AssertLogRelRC(vrc);
                         }
                         task->mProgress->setCancelCallback(NULL, NULL);
@@ -7588,6 +7624,10 @@
                 {
                     /* Power on the VM (i.e. start executing) */
-                    vrc = VMR3PowerOn(pVM);
-                    AssertRC(vrc);
+#ifdef VBOX_WITH_EXTPACK
+                    vrc = console->mptrExtPackManager->callAllVmPowerOnHooks(console, pVM);
+#endif
+                    if (RT_SUCCESS(vrc))
+                        vrc = VMR3PowerOn(pVM);
+                    AssertLogRelRC(vrc);
                 }
 
@@ -8078,7 +8118,6 @@
                         LogFlowFunc(("VMR3Resume (on failure)...\n"));
                         alock.leave();
-                        int vrc = VMR3Resume(that->mpVM);
+                        int vrc = VMR3Resume(that->mpVM); AssertLogRelRC(vrc);
                         alock.enter();
-                        AssertLogRelRC(vrc);
                         if (RT_FAILURE(vrc))
                             that->setMachineState(MachineState_Paused);
Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 33783)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 33784)
@@ -109,4 +109,7 @@
 #include "DHCPServerRunner.h"
 #include "BusAssignmentManager.h"
+#ifdef VBOX_WITH_EXTPACK
+# include "ExtPackManagerImpl.h"
+#endif
 
 #if defined(RT_OS_DARWIN)
@@ -2475,5 +2478,15 @@
 #undef H
 
-    /* Register VM state change handler */
+#ifdef VBOX_WITH_EXTPACK
+    /*
+     * Call the extension pack hooks if everything went well thus far.
+     */
+    if (RT_SUCCESS(rc))
+        rc = pConsole->mptrExtPackManager->callAllVmConfigureVmmHooks(pConsole, pVM);
+#endif
+
+    /*
+     * Register VM state change handler.
+     */
     int rc2 = VMR3AtStateRegister(pVM, Console::vmstateChangeCallback, pConsole);
     AssertRC(rc2);
@@ -2481,5 +2494,7 @@
         rc = rc2;
 
-    /* Register VM runtime error handler */
+    /*
+     * Register VM runtime error handler.
+     */
     rc2 = VMR3AtRuntimeErrorRegister(pVM, Console::setVMRuntimeErrorCallback, pConsole);
     AssertRC(rc2);
@@ -3793,5 +3808,5 @@
                     {
                         int winEr = GetLastError();
-                        LogRel(("Console::configConstructor: DeviceIoControl failed, err (0x%x), ignoring\n", winEr));
+                        LogRel(("Console::configNetwork: DeviceIoControl failed, err (0x%x), ignoring\n", winEr));
                         Assert(winEr == ERROR_INVALID_PARAMETER || winEr == ERROR_NOT_SUPPORTED || winEr == ERROR_BAD_COMMAND);
                     }
@@ -3810,5 +3825,5 @@
                 {
                     int winEr = GetLastError();
-                    AssertLogRelMsgFailed(("Console::configConstructor: CreateFile failed, err (0x%x), ignoring\n", winEr));
+                    AssertLogRelMsgFailed(("Console::configNetwork: CreateFile failed, err (0x%x), ignoring\n", winEr));
                 }
 
Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 33783)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 33784)
@@ -728,5 +728,5 @@
 # The VBoxExtPackHelperApp.
 #
-if 0 # def VBOX_WITH_EXTPACK
+ifeq ($(LOGNAME),bird) # def VBOX_WITH_EXTPACK
  PROGRAMS += VBoxExtPackHelperApp
  VBoxExtPackHelperApp_TEMPLATE = VBoxR3Static
Index: /trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp
===================================================================
--- /trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp	(revision 33783)
+++ /trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp	(revision 33784)
@@ -109,6 +109,6 @@
                                       "Usage: %s <command> [options]\n"
                                       "Commands:\n"
-                                      "    install --basepath <dir> --name <name> --tarball <tarball> --tarball-fd <fd>\n"
-                                      "    uninstall --basepath <dir> --name <name>\n"
+                                      "    install --base-dir <dir> --name <name> --tarball <tarball> --tarball-fd <fd>\n"
+                                      "    uninstall --base-dir <dir> --name <name>\n"
                                       , RTPathFilename(argv[0]));
                             rcExit = RTEXITCODE_SUCCESS;
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 33783)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 33784)
@@ -1282,4 +1282,9 @@
     if (SUCCEEDED(rc))
     {
+#ifdef VBOX_WITH_EXTPACK
+        /* call the extension pack hooks */
+        m->ptrExtPackManager->callAllVmCreatedHooks(machine);
+#endif
+
         /* set the return value */
         rc = machine.queryInterfaceTo(aMachine);
Index: /trunk/src/VBox/Main/include/ConsoleImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 33783)
+++ /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 33784)
@@ -38,4 +38,7 @@
 class VMMDev;
 class Progress;
+#ifdef VBOX_WITH_EXTPACK
+class ExtPackManager;
+#endif
 
 #include <VBox/RemoteDesktop/VRDE.h>
@@ -603,4 +606,7 @@
     const ComObjPtr<VRDEServerInfo> mVRDEServerInfo;
     const ComObjPtr<EventSource> mEventSource;
+#ifdef VBOX_WITH_EXTPACK
+    const ComObjPtr<ExtPackManager> mptrExtPackManager;
+#endif
 
     USBDeviceList mUSBDevices;
