Index: trunk/src/VBox/Main/darwin/NetIf-darwin.cpp
===================================================================
--- trunk/src/VBox/Main/darwin/NetIf-darwin.cpp	(revision 19432)
+++ trunk/src/VBox/Main/darwin/NetIf-darwin.cpp	(revision 19433)
@@ -340,7 +340,98 @@
 }
 
-int NetIfGetConfigByName(IN_BSTR aName, NETIFINFO *pInfo)
+int NetIfGetConfigByName(PNETIFINFO pInfo)
 {
-    return VERR_NOT_IMPLEMENTED;
+    int rc = VINF_SUCCESS;
+    size_t cbNeeded;
+    char *pBuf, *pNext;
+    int aiMib[6];
+    
+    aiMib[0] = CTL_NET;
+    aiMib[1] = PF_ROUTE;
+    aiMib[2] = 0;
+    aiMib[3] = 0;	/* address family */
+    aiMib[4] = NET_RT_IFLIST;
+    aiMib[5] = 0;
+
+    if (sysctl(aiMib, 6, NULL, &cbNeeded, NULL, 0) < 0)
+    {
+        Log(("NetIfList: Failed to get estimate for list size (errno=%d).\n", errno));
+        return RTErrConvertFromErrno(errno);
+    }
+    if ((pBuf = (char*)malloc(cbNeeded)) == NULL)
+        return VERR_NO_MEMORY;
+    if (sysctl(aiMib, 6, pBuf, &cbNeeded, NULL, 0) < 0)
+    {
+        free(pBuf);
+        Log(("NetIfList: Failed to retrieve interface table (errno=%d).\n", errno));
+        return RTErrConvertFromErrno(errno);
+    }
+
+    int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
+    if (sock < 0)
+    {
+        free(pBuf);
+        Log(("NetIfList: socket() -> %d\n", errno));
+        return RTErrConvertFromErrno(errno);
+    }
+
+    char *pEnd = pBuf + cbNeeded;
+    for (pNext = pBuf; pNext < pEnd;)
+    {
+        struct if_msghdr *pIfMsg = (struct if_msghdr *)pNext;
+
+        if (pIfMsg->ifm_type != RTM_IFINFO)
+        {
+            Log(("NetIfList: Got message %u while expecting %u.\n",
+                 pIfMsg->ifm_type, RTM_IFINFO));
+            rc = VERR_INTERNAL_ERROR;
+            break;
+        }
+        struct sockaddr_dl *pSdl = (struct sockaddr_dl *)(pIfMsg + 1);
+
+        bool fSkip = !!strcmp(pInfo->szShortName, pSdl->sdl_data);
+
+        pNext += pIfMsg->ifm_msglen;
+        while (pNext < pEnd)
+        {
+            struct ifa_msghdr *pIfAddrMsg = (struct ifa_msghdr *)pNext;
+
+            if (pIfAddrMsg->ifam_type != RTM_NEWADDR)
+                break;
+            if (!fSkip)
+                extractAddresses(pIfAddrMsg->ifam_addrs, (char *)(pIfAddrMsg + 1), pIfAddrMsg->ifam_msglen + (char *)pIfAddrMsg, pInfo);
+            pNext += pIfAddrMsg->ifam_msglen;
+        }
+
+        if (!fSkip && pSdl->sdl_type == IFT_ETHER)
+        {
+            size_t cbNameLen = pSdl->sdl_nlen + 1;
+            memcpy(pInfo->MACAddress.au8, LLADDR(pSdl), sizeof(pInfo->MACAddress.au8));
+            pInfo->enmMediumType = NETIF_T_ETHERNET;
+            /* Generate UUID from name and MAC address. */
+            RTUUID uuid;
+            RTUuidClear(&uuid);
+            memcpy(&uuid, pInfo->szShortName, RT_MIN(cbNameLen, sizeof(uuid)));
+            uuid.Gen.u8ClockSeqHiAndReserved = (uuid.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80;
+            uuid.Gen.u16TimeHiAndVersion = (uuid.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
+            memcpy(uuid.Gen.au8Node, pInfo->MACAddress.au8, sizeof(uuid.Gen.au8Node));
+            pInfo->Uuid = uuid;
+
+            struct ifreq IfReq;
+            strcpy(IfReq.ifr_name, pInfo->szShortName);
+            if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0)
+            {
+                Log(("NetIfList: ioctl(SIOCGIFFLAGS) -> %d\n", errno));
+                pInfo->enmStatus = NETIF_S_UNKNOWN;
+            }
+            else
+                pInfo->enmStatus = (IfReq.ifr_flags & IFF_UP) ? NETIF_S_UP : NETIF_S_DOWN;
+
+            return VINF_SUCCESS;
+        }
+    }
+    close(sock);
+    free(pBuf);
+    return rc;
 }
 
Index: trunk/src/VBox/Main/generic/NetIf-generic.cpp
===================================================================
--- trunk/src/VBox/Main/generic/NetIf-generic.cpp	(revision 19432)
+++ trunk/src/VBox/Main/generic/NetIf-generic.cpp	(revision 19433)
@@ -170,19 +170,28 @@
                         *pLast = 0;
 
-                    NETIFINFO Info;
-                    Bstr IfName(szBuf);
-                    rc = NetIfGetConfigByName(IfName, &Info);
-                    if (RT_FAILURE(rc))
-                    {
-                        progress->notifyComplete(E_FAIL, COM_IIDOF(IHostNetworkInterface), HostNetworkInterface::getComponentName(),
-                                                 "Failed to get config info for %s (as reported by '" VBOXNETADPCTL_NAME " add').\n", szBuf);
-                    }
+                    size_t cbNameLen = strlen(szBuf) + 1;
+                    PNETIFINFO pInfo = (PNETIFINFO)RTMemAllocZ(RT_OFFSETOF(NETIFINFO, szName[cbNameLen]));
+                    if (!pInfo)
+                        rc = VERR_NO_MEMORY;
                     else
                     {
-                        /* create a new uninitialized host interface object */
-                        ComObjPtr <HostNetworkInterface> iface;
-                        iface.createObject();
-                        iface->init(IfName, HostNetworkInterfaceType_HostOnly, &Info);
-                        iface.queryInterfaceTo (aHostNetworkInterface);
+                        strcpy(pInfo->szShortName, szBuf);
+                        strcpy(pInfo->szName, szBuf);
+                        rc = NetIfGetConfigByName(pInfo);
+                        if (RT_FAILURE(rc))
+                        {
+                            progress->notifyComplete(E_FAIL, COM_IIDOF(IHostNetworkInterface), HostNetworkInterface::getComponentName(),
+                                                     "Failed to get config info for %s (as reported by '" VBOXNETADPCTL_NAME " add').\n", szBuf);
+                        }
+                        else
+                        {
+                            Bstr IfName(szBuf);
+                            /* create a new uninitialized host interface object */
+                            ComObjPtr <HostNetworkInterface> iface;
+                            iface.createObject();
+                            iface->init(IfName, HostNetworkInterfaceType_HostOnly, pInfo);
+                            iface.queryInterfaceTo (aHostNetworkInterface);
+                        }
+                        RTMemFree(pInfo);
                     }
                 }
Index: trunk/src/VBox/Main/include/netif.h
===================================================================
--- trunk/src/VBox/Main/include/netif.h	(revision 19432)
+++ trunk/src/VBox/Main/include/netif.h	(revision 19433)
@@ -86,5 +86,5 @@
 int NetIfRemoveHostOnlyNetworkInterface (VirtualBox *pVbox, IN_GUID aId, IHostNetworkInterface **aHostNetworkInterface, IProgress **aProgress);
 int NetIfGetConfig(HostNetworkInterface * pIf, NETIFINFO *);
-int NetIfGetConfigByName(IN_BSTR aName, NETIFINFO *pInfo);
+int NetIfGetConfigByName(PNETIFINFO pInfo);
 int NetIfDhcpRediscover(VirtualBox *pVbox, HostNetworkInterface * pIf);
 
Index: trunk/src/VBox/Main/linux/NetIf-linux.cpp
===================================================================
--- trunk/src/VBox/Main/linux/NetIf-linux.cpp	(revision 19432)
+++ trunk/src/VBox/Main/linux/NetIf-linux.cpp	(revision 19433)
@@ -168,5 +168,5 @@
 }
 
-int NetIfGetConfigByName(IN_BSTR aName, NETIFINFO *pInfo)
+int NetIfGetConfigByName(PNETIFINFO pInfo)
 {
     int rc = VINF_SUCCESS;
@@ -174,5 +174,5 @@
     if (sock < 0)
         return VERR_NOT_IMPLEMENTED;
-    rc = getInterfaceInfo(sock, Utf8Str(aName).c_str(), pInfo);
+    rc = getInterfaceInfo(sock, pInfo->szShortName, pInfo);
     close(sock);
     return rc;
Index: trunk/src/VBox/Main/solaris/NetIf-solaris.cpp
===================================================================
--- trunk/src/VBox/Main/solaris/NetIf-solaris.cpp	(revision 19432)
+++ trunk/src/VBox/Main/solaris/NetIf-solaris.cpp	(revision 19433)
@@ -394,5 +394,5 @@
 #endif
 
-int NetIfGetConfigByName(IN_BSTR aName, NETIFINFO *pInfo)
+int NetIfGetConfigByName(PNETIFINFO pInfo)
 {
     return VERR_NOT_IMPLEMENTED;
Index: trunk/src/VBox/Main/win/NetIf-win.cpp
===================================================================
--- trunk/src/VBox/Main/win/NetIf-win.cpp	(revision 19432)
+++ trunk/src/VBox/Main/win/NetIf-win.cpp	(revision 19433)
@@ -1041,5 +1041,5 @@
 }
 
-int NetIfGetConfigByName(IN_BSTR /* aName */, NETIFINFO *)
+int NetIfGetConfigByName(PNETIFINFO)
 {
     return VERR_NOT_IMPLEMENTED;
