Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55589)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 55590)
@@ -10783,5 +10783,5 @@
   <interface
     name="IGuestSession" extends="$unknown"
-    uuid="c899776d-41f7-7aee-7056-4bac979d58b7"
+    uuid="e1fa83fe-437d-3e3a-9278-4297f1ca95dd"
     wsmap="managed"
     >
@@ -11107,44 +11107,4 @@
       <param name="acl" type="wstring" dir="in">
         <desc>Actual ACL string to set. Must comply with the guest OS.</desc>
-      </param>
-    </method>
-
-<!-- r=bird: Remove this it duplicates the 'environment' attribute. -->
-    <method name="environmentClear">
-      <desc>
-        Clears (deletes) all session environment variables.
-
-        <result name="VBOX_E_IPRT_ERROR">
-<!-- r=bird: No, it won't return this result, because you're just doing .clear() on a vector. -->
-          Error while clearing the session environment variables.
-        </result>
-      </desc>
-    </method>
-
-    <method name="environmentGet">
-<!-- r=bird: Remove this because the interface isn't suitable for returning
-'unset' or empty values, and it can easily be misunderstood.  Besides there is
-hardly a usecase for it as long as it just works on environment changes and
-there is the 'environment' attribute. -->
-      <desc>
-        Gets the value of an environment variable scheduled to be set.
-
-        <result name="VBOX_E_IPRT_ERROR">
-<!-- r=bird: Would never return this, only invalid input or out of memory. -->
-          Error while getting the value of the session environment variable.
-        </result>
-      </desc>
-      <param name="name" type="wstring" dir="in">
-        <desc>Name of session environment variable to get the value for.</desc>
-      </param>
-      <param name="value" type="wstring" dir="return">
-        <desc>
-          Value of the session environment variable specified.  If this variable
-          does not exist an empty value will be returned.
-          <note>
-            An empty value will also be return for a variable with an value or
-            a unset-variable entry.
-          </note>
-        </desc>
       </param>
     </method>
Index: /trunk/src/VBox/Main/include/GuestSessionImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 55589)
+++ /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 55590)
@@ -312,7 +312,4 @@
     HRESULT directorySetACL(const com::Utf8Str &aPath,
                              const com::Utf8Str &aAcl);
-    HRESULT environmentClear();
-    HRESULT environmentGet(const com::Utf8Str &aName,
-                           com::Utf8Str &aValue);
     HRESULT environmentSet(const com::Utf8Str &aName,
                            const com::Utf8Str &aValue);
Index: /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 55589)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 55590)
@@ -2904,53 +2904,4 @@
 }
 
-/** @todo remove this it duplicates the 'environment' attribute.   */
-HRESULT GuestSession::environmentClear()
-{
-#ifndef VBOX_WITH_GUEST_CONTROL
-    ReturnComNotImplemented();
-#else
-    LogFlowThisFuncEnter();
-
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-
-    mData.mEnvironment.reset();
-
-    LogFlowThisFuncLeave();
-    return S_OK;
-#endif /* VBOX_WITH_GUEST_CONTROL */
-}
-
-/** @todo Remove this because the interface isn't suitable for returning 'unset'
- *        or empty values, and it can easily be misunderstood.  Besides there
- *        is hardly a usecase for it as long as it just works on
- *        environment changes and there is the 'environment' attribute. */
-HRESULT GuestSession::environmentGet(const com::Utf8Str &aName, com::Utf8Str &aValue)
-{
-#ifndef VBOX_WITH_GUEST_CONTROL
-    ReturnComNotImplemented();
-#else
-    LogFlowThisFuncEnter();
-
-    HRESULT hrc;
-    if (RT_LIKELY(aName.isNotEmpty()))
-    {
-        if (RT_LIKELY(strchr(aName.c_str(), '=') == NULL))
-        {
-            AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
-
-            mData.mEnvironment.getVariable(aName, &aValue);
-            hrc = S_OK;
-        }
-        else
-            hrc = setError(E_INVALIDARG, tr("The equal char is not allowed in environment variable names"));
-    }
-    else
-        hrc = setError(E_INVALIDARG, tr("No variable name specified"));
-
-    LogFlowThisFuncLeave();
-    return hrc;
-#endif /* VBOX_WITH_GUEST_CONTROL */
-}
-
 HRESULT GuestSession::environmentSet(const com::Utf8Str &aName, const com::Utf8Str &aValue)
 {
Index: /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
===================================================================
--- /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55589)
+++ /trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py	(revision 55590)
@@ -1134,7 +1134,7 @@
                 break;
             try:
-                for (_, aEnv) in enumerate(curTest.aEnv): # Enumerate only will work with a sequence (e.g > 1 entries).
+                for (_, aEnv) in enumerate(curTest.aEnv):
                     aElems = aEnv.split('=');
-                    strKey = '';
+                    strKey = '';  ## @todo s/Key/Var/g
                     strValue = '';
                     if len(aElems) > 0:
@@ -1142,5 +1142,5 @@
                     if len(aElems) == 2:
                         strValue = aElems[1];
-                    reporter.log2('Test #%d: Single key="%s", value="%s" (%d) ...' \
+                    reporter.log2('Test #%d: Single var="%s", value="%s" (%d) ...' \
                                   % (i, strKey, strValue, len(aElems)));
                     try:
@@ -1157,28 +1157,33 @@
                         else:
                             reporter.log('Test #%d: API reported an error (single), good' % (i,));
-                    reporter.log2('Getting key="%s" ...' % (strKey,));
-                    try:
-                        strValue2 = curGuestSession.environmentGet(strKey);
-                        if      strKey.isalnum() \
-                            and strValue != strValue2:
-                            reporter.error('Test #%d failed: Got environment variable "%s", expected "%s" (key: "%s")' \
-                                           % (i, strValue2, strValue, strKey));
-                            fRc = False;
-                            break;
-                        # Getting back an empty value when specifying an invalid key is fine.
-                        reporter.log2('Got key "%s=%s"' % (strKey, strValue2));
-                    except UnicodeDecodeError: # Might happen on unusal values, fine.
-                        if strValue != strValue2:
-                            reporter.error('Test #%d failed: Got (undecoded) environment variable "%s", ' \
-                                           'expected "%s" (key: "%s")' \
-                                           % (i, strValue2, strValue, strKey));
-                            fRc = False;
-                            break;
-                    except:
-                        if     strKey == "" \
-                            or not strKey.isalnum():
-                            reporter.log('Test #%d: API reported an error (invalid key "%s"), good' % (i, strKey));
-                        else:
-                            reporter.errorXcpt('Test #%d failed: Getting environment variable:' % (i));
+                    ## @todo environmentGet() has been removed in 5.0 because it's not up to the task of returning all the
+                    ## putenv strings forms and gives the impression that the envrionment is something it isn't. This test
+                    ## should be rewritten using the attribute.  What's more, there should be an Unset test here, shouldn't
+                    ## there?
+                    #
+                    #reporter.log2('Getting key="%s" ...' % (strKey,));
+                    #try:
+                    #    strValue2 = curGuestSession.environmentGet(strKey);
+                    #    if      strKey.isalnum() \
+                    #        and strValue != strValue2:
+                    #        reporter.error('Test #%d failed: Got environment value "%s", expected "%s" (var: "%s")' \
+                    #                       % (i, strValue2, strValue, strKey));
+                    #        fRc = False;
+                    #        break;
+                    #    # Getting back an empty value when specifying an invalid key is fine.
+                    #    reporter.log2('Got key "%s=%s"' % (strKey, strValue2));
+                    #except UnicodeDecodeError: # Might happen on unusal values, fine.
+                    #    if strValue != strValue2:
+                    #        reporter.error('Test #%d failed: Got (undecoded) environment variable "%s", ' \
+                    #                       'expected "%s" (var: "%s")' \
+                    #                       % (i, strValue2, strValue, strKey));
+                    #        fRc = False;
+                    #        break;
+                    #except:
+                    #    if     strKey == "" \
+                    #        or not strKey.isalnum():
+                    #        reporter.log('Test #%d: API reported an error (invalid key "%s"), good' % (i, strKey));
+                    #    else:
+                    #        reporter.errorXcpt('Test #%d failed: Getting environment variable:' % (i));
                 if fRc is False:
                     continue;
@@ -1209,5 +1214,6 @@
                     fRc = False;
                     break;
-                curGuestSession.environmentClear(); # No return (e.g. boolean) value available thru wrapper.
+
+                self.oTstDrv.oVBoxMgr.setArray(curGuestSession, 'environment', []);
                 curEnv = self.oTstDrv.oVBoxMgr.getArray(curGuestSession, 'environment');
                 if len(curEnv) is not 0:
