Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp	(revision 71144)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp	(revision 71145)
@@ -40,4 +40,15 @@
     setWordWrapMode(QTextOption::NoWrap);
     reset();
+
+    m_tabDictinary.insert("username", 0);
+    m_tabDictinary.insert("createsession", 0);
+    m_tabDictinary.insert("exe", 0);
+    m_tabDictinary.insert("sessionid", 0);
+    m_tabDictinary.insert("sessionname", 0);
+    m_tabDictinary.insert("timeout", 0);
+    m_tabDictinary.insert("password", 0);
+    m_tabDictinary.insert("start", 0);
+    m_tabDictinary.insert("ls", 0);
+    m_tabDictinary.insert("stat", 0);
 }
 
@@ -137,4 +148,7 @@
             break;
         }
+        case Qt::Key_Tab:
+            completeByTab();
+            break;
         default:
         {
@@ -225,2 +239,65 @@
     return m_tCommandHistory.at(m_uCommandHistoryIndex);
 }
+
+void UIGuestControlConsole::completeByTab()
+{
+    bool lastLine = blockCount() == (textCursor().blockNumber() +1);
+    if (!lastLine)
+        return;
+    /* Save whatever we have currently on this line: */
+    QString currentCommand = getCommandString();
+
+    QTextCursor cursor = textCursor();
+    /* Save the cursor's position within the line */
+    int cursorBlockPosition = cursor.positionInBlock();
+
+    /* Find out on which word the cursor is. This is the word we will
+       complete: */
+    cursor.select(QTextCursor::WordUnderCursor);
+    QString currentWord = cursor.selectedText();
+
+    const QList<QString> &matches = matchedWords(currentWord);
+    /* If there are no matches do nothing: */
+    if(matches.empty())
+        return;
+    /* if there are more than one match list them all and
+       reprint the line: */
+    if(matches.size() > 1)
+    {
+        moveCursor(QTextCursor::End);
+        QString strMatches;
+        for(int i = 0; i < matches.size(); ++i)
+        {
+            strMatches.append(matches.at(i));
+            strMatches.append(" ");
+        }
+        appendPlainText(strMatches);
+        insertPlainText(QString("\n").append(m_strPrompt));
+        insertPlainText(currentCommand);
+        /* Put the cursor in its previous position within the line: */
+        int blockPosition = textCursor().block().position();
+        QTextCursor nCursor = textCursor();
+        nCursor.setPosition(blockPosition + cursorBlockPosition);
+        setTextCursor(nCursor);
+        return;
+    }
+    /* if there is only one word just complete: */
+    /* some sanity checks */
+    if(matches.at(0).length() > currentWord.length())
+       insertPlainText(matches.at(0).right(matches.at(0).length() - currentWord.length()));
+}
+
+
+QList<QString> UIGuestControlConsole::matchedWords(const QString &strSearch) const
+{
+    QList<QString> list;
+    /* Go thru the map and find which of its elements start with @pstrSearch: */
+    for(TabDictionary::const_iterator iterator = m_tabDictinary.begin();
+        iterator != m_tabDictinary.end(); ++iterator)
+    {
+        const QString &strMap = iterator.key();
+        if(strMap.startsWith(strSearch))
+            list.push_back(strMap);
+    }
+    return list;
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h	(revision 71144)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h	(revision 71145)
@@ -51,17 +51,21 @@
 
     typedef QVector<QString> CommandHistory;
-    void        reset();
-    void        startNextLine();
+    typedef QMap<QString, int> TabDictionary;
+
+    void           reset();
+    void           startNextLine();
     /** Return the text of the curent line */
-    QString     getCommandString();
+    QString        getCommandString();
     /** Replaces the content of the last line with m_strPromt + @p stringNewContent */
-    void        replaceLineContent(const QString &stringNewContent);
+    void           replaceLineContent(const QString &stringNewContent);
     /** Get next/prev command from history. Return @p originalString if history is empty. */
-    QString     getNextCommandFromHistory(const QString &originalString = QString());
-    QString     getPreviousCommandFromHistory(const QString &originalString = QString());
-
+    QString        getNextCommandFromHistory(const QString &originalString = QString());
+    QString        getPreviousCommandFromHistory(const QString &originalString = QString());
+    void           completeByTab();
+    /* Return a list of words that start with @p strSearch */
+    QList<QString> matchedWords(const QString &strSearch) const;
     const QString  m_strGreet;
     const QString  m_strPrompt;
-
+    TabDictionary  m_tabDictinary;
     /* A vector of entered commands */
     CommandHistory m_tCommandHistory;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp	(revision 71144)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp	(revision 71145)
@@ -354,6 +354,4 @@
     {
 
-        // printf("/lk %d c:/users %d\n", m_comGuestSession.DirectoryExists("/lk", true),
-        //        m_comGuestSession.DirectoryExists("c:/users", true));
         QVector<KDirectoryOpenFlag> flag;
         flag.push_back(KDirectoryOpenFlag_None);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp	(revision 71144)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp	(revision 71145)
@@ -533,4 +533,9 @@
 void UIGuestControlInterface::putCommand(const QString &strCommand)
 {
+    if (!isGuestAdditionsAvaible())
+    {
+        emit sigOutputString("No guest addtions detected. Guest control needs guest additions");
+        return;
+    }
 
     char **argv;
@@ -651,5 +656,12 @@
     strInfo.append(QString("%1 \t").arg(fsObjectInfo.GetBirthTime()));
     strInfo.append(QString("%1 ").arg(fsObjectInfo.GetChangeTime()));
-
     return strInfo;
 }
+
+bool UIGuestControlInterface::isGuestAdditionsAvaible()
+{
+    if (!m_comGuest.isOk())
+        return false;
+    return m_comGuest.GetAdditionsStatus(m_comGuest.GetAdditionsRunLevel());
+
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.h	(revision 71144)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.h	(revision 71145)
@@ -80,8 +80,8 @@
 
     QString getFsObjInfoString(const CGuestFsObjInfo &fsObjectInfo) const;
-
+    bool    isGuestAdditionsAvaible();
     CGuest        m_comGuest;
     const QString m_strHelp;
-    QString  m_strStatus;
+    QString       m_strStatus;
     /* A map of function pointers to handleXXXX functions */
     QMap<QString, HandleFuncPtr> m_subCommandHandlers;
