Index: trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp	(revision 19512)
+++ trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp	(revision 19513)
@@ -31,6 +31,7 @@
 #include <Ntsecapi.h>
 #else
+# include <errno.h>
 # include <unistd.h>
-# include <errno.h>
+# include <utmp.h>
 #endif
 
@@ -106,5 +107,5 @@
     HMODULE hKernel32 = LoadLibrary(_T("kernel32"));
     if (NULL != hKernel32)
-    {    
+    {
         g_pfnWTSGetActiveConsoleSessionId = (fnWTSGetActiveConsoleSessionId)GetProcAddress(hKernel32, "WTSGetActiveConsoleSessionId");
         FreeLibrary(hKernel32);
@@ -114,5 +115,5 @@
     rc = VbglR3GuestPropConnect(&g_VMInfoGuestPropSvcClientID);
     if (!RT_SUCCESS(rc))
-    {    
+    {
         VBoxServiceError("Failed to connect to the guest property service! Error: %Rrc\n", rc);
     }
@@ -181,10 +182,10 @@
 
         char* pszTemp = NULL;
-    
+
         /* This function can report stale or orphaned interactive logon sessions of already logged
            off users (especially in Windows 2000). */
         r = ::LsaEnumerateLogonSessions(&ulCount, &pSessions);
         VBoxServiceVerbose(3, "Users: Found %ld users.\n", ulCount);
-    
+
         if (r != STATUS_SUCCESS)
         {
@@ -192,11 +193,11 @@
             return 1;
         }
-    
+
         PLUID pLuid = NULL;
         DWORD dwNumOfProcLUIDs = VboxServiceVMInfoWinGetLUIDsFromProcesses(&pLuid);
-    
+
         VBOXSERVICEVMINFOUSER userInfo;
         ZeroMemory (&userInfo, sizeof(VBOXSERVICEVMINFOUSER));
-    
+
         for (int i = 0; i<(int)ulCount; i++)
         {
@@ -205,5 +206,5 @@
                 if (uiUserCount > 0)
                     strcat (szUserList, ",");
-    
+
                 uiUserCount++;
 
@@ -213,5 +214,5 @@
             }
         }
-    
+
         if (NULL != pLuid)
             ::LocalFree (pLuid);
@@ -219,5 +220,25 @@
         ::LsaFreeReturnBuffer(pSessions);
 #else
-        /** @todo Nothing here yet - Implement other platforms here. */
+        utmp* ut_user;
+		rc = utmpname(UTMP_FILE);
+		if (rc != 0)
+		{
+			VBoxServiceError("Could not set  UTMP file! Error: %ld", errno);
+		}
+		setutent();
+		while ((ut_user=getutent()))
+		{
+			/* Make sure we don't add user names which are not
+			 * part of type USER_PROCESS and don't add same users twice. */
+			if (   (ut_user->ut_type == USER_PROCESS)
+				&& (strstr(szUserList, ut_user->ut_user) == NULL))
+			{
+				if (uiUserCount > 0)
+					strcat(szUserList, ",");
+				strcat(szUserList, ut_user->ut_user);
+				uiUserCount++;
+			}
+		}
+		endutent();
 #endif /* !RT_OS_WINDOWS */
 
@@ -246,15 +267,15 @@
             return -1;
         }
-    
+
         INTERFACE_INFO InterfaceList[20] = {0};
         unsigned long nBytesReturned = 0;
-        if (WSAIoctl(sd, 
-                     SIO_GET_INTERFACE_LIST, 
-                     0, 
-                     0, 
+        if (WSAIoctl(sd,
+                     SIO_GET_INTERFACE_LIST,
+                     0,
+                     0,
                      &InterfaceList,
-                     sizeof(InterfaceList), 
-                     &nBytesReturned, 
-                     0, 
+                     sizeof(InterfaceList),
+                     &nBytesReturned,
+                     0,
                      0) ==  SOCKET_ERROR)
         {
@@ -262,13 +283,13 @@
             return -1;
         }
-    
+
         char szPropPath [_MAX_PATH] = {0};
         char szTemp [_MAX_PATH] = {0};
         int nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO);
         int iCurIface = 0;
-    
+
         RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/Count");
         VboxServiceWritePropInt(g_VMInfoGuestPropSvcClientID, szPropPath, (nNumInterfaces > 1 ? nNumInterfaces-1 : 0));
-    
+
         /** @todo Use GetAdaptersInfo() and GetAdapterAddresses (IPv4 + IPv6) for more information. */
 
@@ -277,18 +298,18 @@
             if (InterfaceList[i].iiFlags & IFF_LOOPBACK)    /* Skip loopback device. */
                 continue;
-    
+
             sockaddr_in *pAddress;
             pAddress = (sockaddr_in *) & (InterfaceList[i].iiAddress);
             RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/IP", iCurIface);
             VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, szPropPath, inet_ntoa(pAddress->sin_addr));
-    
+
             pAddress = (sockaddr_in *) & (InterfaceList[i].iiBroadcastAddress);
             RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Broadcast", iCurIface);
             VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, szPropPath, inet_ntoa(pAddress->sin_addr));
-    
+
             pAddress = (sockaddr_in *) & (InterfaceList[i].iiNetmask);
             RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Netmask", iCurIface);
             VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, szPropPath, inet_ntoa(pAddress->sin_addr));
-    
+
             u_long nFlags = InterfaceList[i].iiFlags;
             if (nFlags & IFF_UP)
@@ -296,11 +317,11 @@
             else
                 RTStrPrintf(szTemp, sizeof(szTemp), "Down");
-    
+
             RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/Status", iCurIface);
             VboxServiceWriteProp(g_VMInfoGuestPropSvcClientID, szPropPath, szTemp);
-    
+
             iCurIface++;
         }
-    
+
         closesocket(sd);
 #endif /* !RT_OS_WINDOWS */
