VirtualBox

Changeset 50051 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 10, 2014 1:23:37 PM (11 years ago)
Author:
vboxsync
Message:

VBoxService/GuestCtrl: Print some more help in case a guest session is unable to start. This most likely is the case when the specified guest user can't create/write the log file into the desired directory.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r49531 r50051  
    55
    66/*
    7  * Copyright (C) 2007-2012 Oracle Corporation
     7 * Copyright (C) 2007-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4242#include <iprt/buildconfig.h>
    4343#include <iprt/initterm.h>
     44#include <iprt/file.h>
    4445#ifdef DEBUG
    4546# include <iprt/memtracker.h>
     
    231232    char szError[RTPATH_MAX + 128] = "";
    232233    int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags, "all",
    233                            "VBOXSERVICE_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
     234#ifdef DEBUG
     235                           "VBOXSERVICE_LOG",
     236#else
     237                           "VBOXSERVICE_RELEASE_LOG",
     238#endif
     239                           RT_ELEMENTS(s_apszGroups), s_apszGroups,
    234240                           RTLOGDEST_STDOUT,
    235241                           VBoxServiceLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
     
    754760{
    755761    RTEXITCODE rcExit;
    756     bool fUserSession = false;
    757762
    758763    /*
     
    779784#endif
    780785
     786    bool fUserSession = false;
    781787#ifdef VBOX_WITH_GUEST_CONTROL
    782788    /*
     
    796802     */
    797803    if (fUserSession)
    798     {
    799         VBoxServiceVerbose(2, "Calling VbgR3InitUser()\n");
    800804        rc = VbglR3InitUser();
    801     }
    802805    else
    803     {
    804         VBoxServiceVerbose(2, "Calling VbgR3Init()\n");
    805806        rc = VbglR3Init();
    806     }
     807
    807808    if (RT_FAILURE(rc))
    808809    {
    809810        if (rc == VERR_ACCESS_DENIED)
    810811            return RTMsgErrorExit(RTEXITCODE_FAILURE, "Insufficient privileges to start %s! Please start with Administrator/root privileges!\n",
    811                                     g_pszProgName);
     812                                  g_pszProgName);
    812813        return RTMsgErrorExit(RTEXITCODE_FAILURE, "VbglR3Init failed with rc=%Rrc\n", rc);
    813814    }
     
    997998    rc = VBoxServiceLogCreate(strlen(g_szLogFile) ? g_szLogFile : NULL);
    998999    if (RT_FAILURE(rc))
    999         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create release log (%s, %Rrc)",
     1000        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create release log \"%s\", rc=%Rrc\n",
    10001001                              strlen(g_szLogFile) ? g_szLogFile : "<None>", rc);
    10011002
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r49349 r50051  
    66
    77/*
    8  * Copyright (C) 2013 Oracle Corporation
     8 * Copyright (C) 2013-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    12591259        if (!fProcessAlive)
    12601260        {
    1261             VBoxServiceVerbose(2, "Guest session ID=%RU32 process terminated with rc=%Rrc, reason=%ld, status=%d\n",
     1261            VBoxServiceVerbose(2, "Guest session process (ID=%RU32) terminated with rc=%Rrc, reason=%ld, status=%d\n",
    12621262                               uSessionID, rcWait,
    12631263                               ProcessStatus.enmReason, ProcessStatus.iStatus);
     1264            if (ProcessStatus.iStatus == RTEXITCODE_INIT)
     1265            {
     1266                VBoxServiceError("Guest session process (ID=%RU32) failed to initialize. Here some hints:\n",
     1267                                 uSessionID);
     1268                VBoxServiceError("- Is logging enabled and the output directory is read-only by the guest session user?\n");
     1269                /** @todo Add more here. */
     1270            }
    12641271        }
    12651272    }
     
    23512358    rc = GstCntlSessionInit(&g_Session, uSessionFlags);
    23522359    if (RT_FAILURE(rc))
    2353         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize session object, rc=%Rrc\n", rc);
     2360        return RTMsgErrorExit(RTEXITCODE_INIT, "Failed to initialize session object, rc=%Rrc\n", rc);
    23542361
    23552362    rc = VBoxServiceLogCreate(strlen(g_szLogFile) ? g_szLogFile : NULL);
    23562363    if (RT_FAILURE(rc))
    2357         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create release log (%s, %Rrc)",
     2364        return RTMsgErrorExit(RTEXITCODE_INIT, "Failed to create log file \"%s\", rc=%Rrc\n",
    23582365                              strlen(g_szLogFile) ? g_szLogFile : "<None>", rc);
    23592366
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette