Index: /trunk/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp	(revision 16023)
+++ /trunk/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp	(revision 16024)
@@ -35,4 +35,6 @@
 #include <unistd.h>
 #include <errno.h>
+#include <dlfcn.h>
+#include <link.h>
 
 #include <iprt/string.h>
@@ -68,6 +70,36 @@
 
     int err = errno;
+
+    /*
+     * Fall back on the dynamic linker since /proc is optional.
+     */
+    void *hExe = dlopen(NULL, 0);
+    if (hExe)
+    {
+        struct link_map const *pLinkMap = 0;
+        if (dlinfo(hExe, RTLD_DI_LINKMAP, &pLinkMap) == 0)
+        {
+            const char *pszImageName = pLinkMap->l_name;
+            if (*pszImageName == '/') /* this may not always be absolute, despite the docs. :-( */
+            {
+                char *pszTmp = NULL;
+                int rc = rtPathFromNative(&pszTmp, pszImageName);
+                AssertMsgRCReturn(rc, ("rc=%Rrc pszImageName=\"%s\"\n", rc, pszImageName), rc);
+
+                size_t cch = strlen(pszTmp);
+                AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW);
+
+                memcpy(pszPath, pszTmp, cch + 1);
+                RTStrFree(pszTmp);
+
+                return VINF_SUCCESS;
+            }
+            /** @todo Try search the PATH for the file name or append the current
+             *        directory, which ever makes sense... */
+        }
+    }
+
     int rc = RTErrConvertFromErrno(err);
-    AssertMsgFailed(("rc=%Rrc err=%d cchLink=%d\n", rc, err, cchLink));
+    AssertMsgFailed(("rc=%Rrc err=%d cchLink=%d hExe=%p\n", rc, err, cchLink, hExe));
     return rc;
 }
