Index: /trunk/src/VBox/Devices/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Devices/Makefile.kmk	(revision 8570)
+++ /trunk/src/VBox/Devices/Makefile.kmk	(revision 8571)
@@ -175,7 +175,4 @@
 ifeq ($(BUILD_TARGET),solaris)
  VBoxDD_LIBS           += adm
- ifdef VBOX_WITH_CROSSBOW
-  VBoxDD_LIBS          += dlpi
- endif
  ifdef VBOX_WITH_SUID_WRAPPER
   VBoxDD_LIBS          += secdb
@@ -619,4 +616,5 @@
 	Storage/DrvHostDVD.cpp
  ifdef VBOX_WITH_CROSSBOW
+  Drivers_SOURCES += Network/solaris/vbox-libdlpi.cpp
   Drivers_DEFS += VBOX_WITH_CROSSBOW
  endif
Index: /trunk/src/VBox/Devices/Network/DrvTAP.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DrvTAP.cpp	(revision 8570)
+++ /trunk/src/VBox/Devices/Network/DrvTAP.cpp	(revision 8571)
@@ -62,5 +62,5 @@
 # include <stdio.h>
 # ifdef VBOX_WITH_CROSSBOW
-#  include <libdlpi.h>
+#  include "solaris/vbox-libdlpi.h"
 # endif
 #else
@@ -277,5 +277,5 @@
 #ifdef VBOX_WITH_CROSSBOW
             cbRead = sizeof(achBuf);
-            rc = dlpi_recv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL);
+            rc = gLibDlpiRecv(pData->pDeviceHandle, NULL, NULL, achBuf, &cbRead, -1, NULL);
             rc = RT_LIKELY(rc == DLPI_SUCCESS) ? VINF_SUCCESS : SolarisDLPIErr2VBoxErr(rc);
 #else
@@ -515,5 +515,5 @@
      * Open & bind the NIC using the datalink provider routine.
      */
-    int rc = dlpi_open(pData->pszDeviceName, &pData->pDeviceHandle, DLPI_RAW);
+    int rc = gLibDlpiOpen(pData->pszDeviceName, &pData->pDeviceHandle, DLPI_RAW);
     if (rc != DLPI_SUCCESS)
         return PDMDrvHlpVMSetError(pData->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
@@ -521,23 +521,23 @@
 
     dlpi_info_t vnicInfo;
-    rc = dlpi_info(pData->pDeviceHandle, &vnicInfo, 0);
+    rc = gLibDlpiInfo(pData->pDeviceHandle, &vnicInfo, 0);
     if (rc == DLPI_SUCCESS)
     {
         if (vnicInfo.di_mactype == DL_ETHER)
         {
-            rc = dlpi_bind(pData->pDeviceHandle, DLPI_ANY_SAP, NULL);
+            rc = gLibDlpiBind(pData->pDeviceHandle, DLPI_ANY_SAP, NULL);
             if (rc == DLPI_SUCCESS)
             {
-                rc = dlpi_set_physaddr(pData->pDeviceHandle, DL_CURR_PHYS_ADDR, &pData->MacAddress, ETHERADDRL);
+                rc = gLibDlpiSetPhysAddr(pData->pDeviceHandle, DL_CURR_PHYS_ADDR, &pData->MacAddress, ETHERADDRL);
                 if (rc == DLPI_SUCCESS)
                 {
-                    rc = dlpi_promiscon(pData->pDeviceHandle, DL_PROMISC_SAP);
+                    rc = gLibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_SAP);
                     if (rc == DLPI_SUCCESS)
                     {
                         /* Need to use DL_PROMIS_PHYS (not multicast) as we cannot be sure what the guest needs. */
-                        rc = dlpi_promiscon(pData->pDeviceHandle, DL_PROMISC_PHYS);
+                        rc = gLibDlpiPromiscon(pData->pDeviceHandle, DL_PROMISC_PHYS);
                         if (rc == DLPI_SUCCESS)
                         {
-                            pData->FileDevice = dlpi_fd(pData->pDeviceHandle);
+                            pData->FileDevice = gLibDlpiFd(pData->pDeviceHandle);
                             if (pData->FileDevice >= 0)
                             {
@@ -572,5 +572,5 @@
         rc = PDMDrvHlpVMSetError(pData->pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
                                          N_("Failed to obtain VNIC info"));
-    dlpi_close(pData->pDeviceHandle);
+    gLibDlpiClose(pData->pDeviceHandle);
     return rc;
 }
@@ -972,4 +972,9 @@
      */
 # ifdef VBOX_WITH_CROSSBOW
+    if (!gLibDlpiFound())
+    {
+        return PDMDrvHlpVMSetError(pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
+                                       N_("Failed to load library %s required for host interface networking."), LIB_DLPI);
+    }
     rc = SolarisOpenVNIC(pData);
 # else
Index: /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.cpp	(revision 8571)
+++ /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.cpp	(revision 8571)
@@ -0,0 +1,85 @@
+/** $Id$ */
+/** @file
+ * Dynamically load libdpli & symbols on Solaris hosts, Internal header.
+ */
+
+/*
+ * Copyright (C) 2008 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#include "vbox-libdlpi.h"
+
+#include <iprt/err.h>
+#include <iprt/ldr.h>
+
+/**
+ * Global pointer to the libdlpi module. This should only be set once all needed libraries
+ * and symbols have been successfully loaded.
+ */
+static RTLDRMOD ghLibDlpi = NULL;
+
+/**
+ * Whether we have tried to load libdlpi yet.  This flag should only be set
+ * to "true" after we have either loaded both libraries and all symbols which we need,
+ * or failed to load something and unloaded.
+ */
+static bool gCheckedForLibDlpi = false;
+
+/** 
+ * All the symbols we need from libdlpi.
+ */
+int (*gLibDlpiOpen)(const char *, dlpi_handle_t *, uint_t);
+void (*gLibDlpiClose)(dlpi_handle_t);
+int (*gLibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t);
+int (*gLibDlpiBind)(dlpi_handle_t, uint_t, uint_t *);
+int (*gLibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t);
+int (*gLibDlpiPromiscon)(dlpi_handle_t, uint_t);
+int (*gLibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *);
+int (*gLibDlpiFd)(dlpi_handle_t);
+
+bool gLibDlpiFound(void)
+{
+    RTLDRMOD hLibDlpi;
+
+    if (ghLibDlpi && gCheckedForLibDlpi == true)
+        return true;
+    if (gCheckedForLibDlpi == true)
+        return false;
+    if (!RT_SUCCESS(RTLdrLoad(LIB_DLPI, &hLibDlpi)))
+    {
+        return false;
+    }
+    if (   RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&gLibDlpiOpen))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&gLibDlpiClose))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_info", (void **)&gLibDlpiInfo))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_bind", (void **)&gLibDlpiBind))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_promiscon", (void **)&gLibDlpiPromiscon))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_set_physaddr", (void **)&gLibDlpiSetPhysAddr))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_recv", (void **)&gLibDlpiRecv))
+        && RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_fd", (void **)&gLibDlpiFd))
+       )
+    {
+        ghLibDlpi = hLibDlpi;
+        gCheckedForLibDlpi = true;
+        return true;
+    }
+    else
+    {
+        RTLdrClose(hLibDlpi);
+        gCheckedForLibDlpi = true;
+        return false;
+    }    
+}
+
Index: /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.h
===================================================================
--- /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.h	(revision 8571)
+++ /trunk/src/VBox/Devices/Network/solaris/vbox-libdlpi.h	(revision 8571)
@@ -0,0 +1,40 @@
+/** $Id$ */
+/** @file
+ * Dynamically load libdpli & symbols on Solaris hosts, Internal header.
+ */
+
+/*
+ * Copyright (C) 2008 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifndef ____H_VBOX_LIBDLPI
+#define ____H_VBOX_LIBDLPI
+
+#define LIB_DLPI "libdlpi.so"
+#include <libdlpi.h>
+
+extern int (*gLibDlpiOpen)(const char *, dlpi_handle_t *, uint_t);
+extern void (*gLibDlpiClose)(dlpi_handle_t);
+extern int (*gLibDlpiInfo)(dlpi_handle_t, dlpi_info_t *, uint_t);
+extern int (*gLibDlpiBind)(dlpi_handle_t, uint_t, uint_t *);
+extern int (*gLibDlpiSetPhysAddr)(dlpi_handle_t, uint_t, const void *, size_t);
+extern int (*gLibDlpiPromiscon)(dlpi_handle_t, uint_t);
+extern int (*gLibDlpiRecv)(dlpi_handle_t, void *, size_t *, void *, size_t *, int, dlpi_recvinfo_t *);
+extern int (*gLibDlpiFd)(dlpi_handle_t);
+
+extern bool gLibDlpiFound(void);
+
+#endif /* ____H_VBOX_LIBDLPI not defined */
+
