Index: trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 71049)
@@ -565,4 +565,5 @@
 	src/runtime/UIIndicatorsPool.cpp \
 	src/runtime/UIStatusBarEditorWindow.cpp \
+	src/runtime/information/guestctrl/UIInformationGuestSession.cpp \
 	src/selector/UIActionPoolSelector.cpp \
 	src/selector/UIDesktopPane.cpp \
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.cpp	(revision 71049)
@@ -32,5 +32,4 @@
 UIGuestControlConsole::UIGuestControlConsole(QWidget* parent /* = 0 */)
     :QPlainTextEdit(parent)
-    , m_uLineNumber(0)
     , m_strGreet("Welcome to 'Guest Control Console'. Type 'help' for help\n")
     , m_strPrompt("$>")
@@ -44,5 +43,4 @@
 void UIGuestControlConsole::reset()
 {
-    m_uLineNumber = 0;
     clear();
     startNextLine();
@@ -61,5 +59,5 @@
 void UIGuestControlConsole::putOutput(const QString &strOutput)
 {
-    if(strOutput.isNull() || strOutput.length() <= 0)
+    if (strOutput.isNull() || strOutput.length() <= 0)
         return;
 
@@ -72,5 +70,5 @@
     moveCursor(QTextCursor::End);
 
-    if(newLineNeeded)
+    if (newLineNeeded)
     {
         insertPlainText("\n");
@@ -98,5 +96,5 @@
         {
             QTextCursor cursor = textCursor();
-            if(cursor.positionInBlock() > m_strPrompt.length())
+            if (cursor.positionInBlock() > m_strPrompt.length())
                 cursor.deletePreviousChar();
             break;
@@ -105,5 +103,5 @@
         case Qt::Key_Right:
         {
-            if(textCursor().positionInBlock() > m_strPrompt.length())
+            if (textCursor().positionInBlock() > m_strPrompt.length())
                 QPlainTextEdit::keyPressEvent(pEvent);
             break;
@@ -113,8 +111,8 @@
         {
             QString strCommand(getCommandString());
-            if(!strCommand.isEmpty())
+            if (!strCommand.isEmpty())
             {
                 emit commandEntered(strCommand);
-                if(!m_tCommandHistory.contains(strCommand))
+                if (!m_tCommandHistory.contains(strCommand))
                     m_tCommandHistory.push_back(strCommand);
                 m_uCommandHistoryIndex = m_tCommandHistory.size()-1;
@@ -139,24 +137,21 @@
 }
 
-int UIGuestControlConsole::currentLineNumber() const
-{
-    return textCursor().blockNumber();
-}
-
-
 void UIGuestControlConsole::mousePressEvent(QMouseEvent *pEvent)
 {
-    Q_UNUSED(pEvent);
-    setFocus();
+    // Q_UNUSED(pEvent);
+    // setFocus();
+    QPlainTextEdit::mousePressEvent(pEvent);
 }
 
 void UIGuestControlConsole::mouseDoubleClickEvent(QMouseEvent *pEvent)
 {
-    Q_UNUSED(pEvent);
+    //Q_UNUSED(pEvent);
+    QPlainTextEdit::mouseDoubleClickEvent(pEvent);
 }
 
 void UIGuestControlConsole::contextMenuEvent(QContextMenuEvent *pEvent)
 {
-    Q_UNUSED(pEvent);
+    //Q_UNUSED(pEvent);
+    QPlainTextEdit::contextMenuEvent(pEvent);
 }
 
@@ -164,5 +159,5 @@
 {
     QTextDocument* pDocument = document();
-    if(!pDocument)
+    if (!pDocument)
         return QString();
     QTextBlock block = pDocument->lastBlock();//findBlockByLineNumber(pDocument->lineCount()-1);
@@ -170,5 +165,5 @@
         return QString();
     QString lineStr = block.text();
-    if(lineStr.isNull() || lineStr.length() <= 1)
+    if (lineStr.isNull() || lineStr.length() <= 1)
         return QString();
     /* Remove m_strPrompt from the line string: */
@@ -190,8 +185,8 @@
 QString UIGuestControlConsole::getNextCommandFromHistory(const QString &originalString /* = QString() */)
 {
-    if(m_tCommandHistory.empty())
+    if (m_tCommandHistory.empty())
         return originalString;
 
-    if(m_uCommandHistoryIndex == (unsigned)(m_tCommandHistory.size() - 1))
+    if (m_uCommandHistoryIndex == (unsigned)(m_tCommandHistory.size() - 1))
         m_uCommandHistoryIndex = 0;
     else
@@ -204,7 +199,7 @@
 QString UIGuestControlConsole::getPreviousCommandFromHistory(const QString &originalString /* = QString() */)
 {
-    if(m_tCommandHistory.empty())
+    if (m_tCommandHistory.empty())
         return originalString;
-    if(m_uCommandHistoryIndex == 0)
+    if (m_uCommandHistoryIndex == 0)
         m_uCommandHistoryIndex = m_tCommandHistory.size() - 1;
     else
@@ -213,10 +208,2 @@
     return m_tCommandHistory.at(m_uCommandHistoryIndex);
 }
-
-void UIGuestControlConsole::printCommandHistory() const
-{
-    for(int i = 0; i < m_tCommandHistory.size(); ++i)
-    {
-        printf("%d -- %s\n", i, m_tCommandHistory.at(i).toStdString().c_str());
-    }
-}
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlConsole.h	(revision 71049)
@@ -22,4 +22,5 @@
 # include <QPlainTextEdit>
 
+/** QPlainTextEdit extension to provide a simple terminal like widget. */
 class UIGuestControlConsole : public QPlainTextEdit
 {
@@ -28,5 +29,5 @@
 
 signals:
-
+    /* This is emitted when return key is pressed */
     void commandEntered(QString command);
 
@@ -34,4 +35,5 @@
 
     UIGuestControlConsole(QWidget* parent = 0);
+    /* @p strOutput is displayed in the console */
     void putOutput(const QString &strOutput);
 
@@ -47,21 +49,18 @@
 
 private:
+
     typedef QVector<QString> CommandHistory;
-    int      currentLineNumber() const;
-    void     reset();
-    void     startNextLine();
+    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());
-    void        printCommandHistory() const;
 
-    /** Stores the line number the edit cursor */
-    unsigned m_uLineNumber;
-    const QString m_strGreet;
-    const QString m_strPrompt;
+    const QString  m_strGreet;
+    const QString  m_strPrompt;
 
     /* A vector of entered commands */
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlInterface.cpp	(revision 71049)
@@ -58,11 +58,11 @@
 {
     QString errorString;
-    if(valueUnion.pDef)
-    {
-        if(valueUnion.pDef->pszLong)
-        {
-            errorString = QString(valueUnion.pDef->pszLong);
-        }
-    }
+    // if (valueUnion.pDef)
+    // {
+    //     if (valueUnion.pDef->pszLong)
+    //     {
+    //         errorString = QString(valueUnion.pDef->pszLong);
+    //     }
+    // }
 
     switch (getOptErrorCode)
@@ -115,5 +115,5 @@
                 "                                   [--ignore-operhaned-processes] [--profile]\n"
                 "                                   -- <program/arg0> [argument1] ... [argumentN]]\n"
-                "create                           [common-options]  [sessionname <name>]\n"
+                "create                           [common-options]  [--sessionname <name>]\n"
                 )
 {
@@ -246,4 +246,5 @@
     static const RTGETOPTDEF s_aOptions[] =
     {
+        GCTLCMD_COMMON_OPTION_DEFS()
         { "--sessionname",      GCTLCMD_COMMON_OPT_SESSION_NAME,  RTGETOPT_REQ_STRING  }
     };
@@ -361,5 +362,5 @@
     if (sessionVector.isEmpty())
         return false;
-    for(int  i = 0; i < sessionVector.size(); ++i)
+    for (int  i = 0; i < sessionVector.size(); ++i)
     {
         if (sessionVector.at(i).isOk() && sessionId == sessionVector.at(i).GetId())
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.cpp	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.cpp	(revision 71049)
@@ -30,5 +30,89 @@
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
 
-
+QString sessionStatusString(KGuestSessionStatus status)
+{
+    QString statusString;
+    switch (status)
+    {
+        case KGuestSessionStatus_Undefined:
+            statusString = "Undefined";
+            break;
+        case KGuestSessionStatus_Starting:
+            statusString = "Starting";
+            break;
+        case KGuestSessionStatus_Started:
+            statusString = "Started";
+            break;
+        case KGuestSessionStatus_Terminating:
+            statusString = "Terminating";
+            break;
+        case KGuestSessionStatus_Terminated:
+            statusString = "Terminated";
+            break;
+        case KGuestSessionStatus_TimedOutKilled:
+            statusString = "TimedOutKilled";
+            break;
+        case KGuestSessionStatus_TimedOutAbnormally:
+            statusString = "TimedOutAbnormally";
+            break;
+        case KGuestSessionStatus_Down:
+            statusString = "Down";
+            break;
+        case KGuestSessionStatus_Error:
+            statusString = "Error";
+            break;
+        default:
+            statusString = "Undefined";
+            break;
+    }
+    return statusString;
+}
+
+QString processStatusString(KProcessStatus status)
+{
+    QString statusString;
+    switch (status)
+    {
+        case KProcessStatus_Undefined:
+            statusString = "Undefined";
+            break;
+        case KProcessStatus_Starting:
+            statusString = "Starting";
+            break;
+        case KProcessStatus_Started:
+            statusString = "Started";
+            break;
+        case KProcessStatus_Paused:
+            statusString = "Terminating";
+            break;
+        case KProcessStatus_Terminating:
+            statusString = "Terminating";
+            break;
+        case KProcessStatus_TerminatedNormally:
+            statusString = "TerminatedNormally";
+            break;
+        case KProcessStatus_TerminatedSignal:
+            statusString = "TerminatedSignal";
+            break;
+        case KProcessStatus_TerminatedAbnormally:
+            statusString = "TerminatedAbnormally";
+            break;
+        case KProcessStatus_TimedOutKilled:
+            statusString = "TimedOutKilled";
+            break;
+        case KProcessStatus_TimedOutAbnormally:
+            statusString = "TimedOutAbnormally";
+            break;
+        case KProcessStatus_Down:
+            statusString = "Down";
+            break;
+        case KProcessStatus_Error:
+            statusString = "Error";
+            break;
+        default:
+            break;
+    }
+    return statusString;
+}
 /*********************************************************************************************************************************
 *   UIGuestControlTreeItem implementation.                                                                                       *
@@ -53,12 +137,13 @@
 void UIGuestControlTreeItem::prepare()
 {
+    prepareListener();
     prepareConnections();
-    prepareConnections();
+    setColumnText();
 }
 
 void UIGuestControlTreeItem::prepareListener(CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes)
 {
-    AssertWrapperOk(comEventSource);
-
+    if (!comEventSource.isOk())
+        return;
     /* Create event listener instance: */
     m_pQtListener.createObject();
@@ -69,5 +154,4 @@
     comEventSource.RegisterListener(m_comEventListener, eventTypes,
         gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE);
-    AssertWrapperOk(comEventSource);
 
     /* If event listener registered as passive one: */
@@ -81,5 +165,6 @@
 void UIGuestControlTreeItem::cleanupListener(CEventSource comEventSource)
 {
-    AssertWrapperOk(comEventSource);
+    if (!comEventSource.isOk())
+        return;
     /* If event listener registered as passive one: */
     if (gEDataManager->eventHandlingType() == EventHandlingType_Passive)
@@ -116,4 +201,5 @@
 {
     prepare();
+
 }
 
@@ -123,12 +209,17 @@
 }
 
+const CGuestSession& UIGuestSessionTreeItem::guestSession() const
+{
+    return m_comGuestSession;
+}
+
 void UIGuestSessionTreeItem::prepareConnections()
 {
     connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged,
-            this, &UIGuestSessionTreeItem::sltGuestSessionUpdated);
+            this, &UIGuestSessionTreeItem::sltGuestSessionUpdated, Qt::DirectConnection);
     connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestProcessRegistered,
-            this, &UIGuestSessionTreeItem::sltGuestProcessRegistered);
+            this, &UIGuestSessionTreeItem::sltGuestProcessRegistered, Qt::DirectConnection);
     connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestProcessUnregistered,
-            this, &UIGuestSessionTreeItem::sltGuestProcessUnregistered);
+            this, &UIGuestSessionTreeItem::sltGuestProcessUnregistered, Qt::DirectConnection);
 }
 
@@ -149,15 +240,41 @@
 void UIGuestSessionTreeItem::sltGuestSessionUpdated()
 {
+    setColumnText();
+    emit sigGuessSessionUpdated();
 }
 
 void UIGuestSessionTreeItem::sltGuestProcessRegistered(CGuestProcess guestProcess)
 {
-
+    if (!guestProcess.isOk())
+        return;
+    QStringList strList;
+    strList
+        << QString("PID: %1").arg(guestProcess.GetPID())
+        << QString("Process Name: %1").arg(guestProcess.GetName())
+        << QString("Process Status: %1").arg(processStatusString(guestProcess.GetStatus()));
+    /*UIGuestProcessTreeItem *newItem = */new UIGuestProcessTreeItem(this, guestProcess, strList);
 }
 
 void UIGuestSessionTreeItem::sltGuestProcessUnregistered(CGuestProcess guestProcess)
 {
-}
-
+    for (int i = 0; i < childCount(); ++i)
+    {
+        UIGuestProcessTreeItem* item = dynamic_cast<UIGuestProcessTreeItem*>(child(i));
+        if (item && item->guestProcess() == guestProcess)
+        {
+            delete item;
+            break;
+        }
+    }
+}
+
+void UIGuestSessionTreeItem::setColumnText()
+{
+    if (!m_comGuestSession.isOk())
+        return;
+    setText(0, QString("Session Id: %1").arg(m_comGuestSession.GetId()));
+    setText(1, QString("Session Name: %1").arg(m_comGuestSession.GetName()));
+    setText(2, QString("Session Status: %1").arg(sessionStatusString(m_comGuestSession.GetStatus())));
+}
 
 /*********************************************************************************************************************************
@@ -183,5 +300,5 @@
 {
     connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestProcessStateChanged,
-            this, &UIGuestProcessTreeItem::sltGuestProcessUpdated);
+            this, &UIGuestProcessTreeItem::sltGuestProcessUpdated, Qt::DirectConnection);
 }
 
@@ -208,3 +325,19 @@
 void UIGuestProcessTreeItem::sltGuestProcessUpdated()
 {
-}
+    setColumnText();
+}
+
+ void UIGuestProcessTreeItem::setColumnText()
+{
+    if (!m_comGuestProcess.isOk())
+        return;
+    setText(0, QString("PID: %1").arg(m_comGuestProcess.GetPID()));
+    setText(1, QString("Process Name: %1").arg(m_comGuestProcess.GetName()));
+    setText(2, QString("Process Status: %1").arg(processStatusString(m_comGuestProcess.GetStatus())));
+
+}
+
+const CGuestProcess& UIGuestProcessTreeItem::guestProcess() const
+{
+    return m_comGuestProcess;
+}
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.h	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlTreeItem.h	(revision 71049)
@@ -37,4 +37,6 @@
 signals:
 
+    void sigGuessSessionUpdated();
+
 public:
 
@@ -59,4 +61,5 @@
     virtual void prepareConnections() = 0;
     virtual void cleanupListener() = 0;
+    virtual void setColumnText() = 0;
 
     /** Holds the COM event listener instance. */
@@ -74,4 +77,5 @@
     UIGuestSessionTreeItem(UIGuestControlTreeItem *pTreeWidgetItem, CGuestSession& guestSession, const QStringList &strings = QStringList());
     virtual ~UIGuestSessionTreeItem();
+    const CGuestSession& guestSession() const;
 
 protected:
@@ -91,4 +95,5 @@
     virtual void prepareConnections() /* override */;
     virtual void cleanupListener()  /* override */;
+    virtual void setColumnText()  /* override */;
 
     CGuestSession m_comGuestSession;
@@ -104,4 +109,5 @@
     UIGuestProcessTreeItem(QITreeWidget *pTreeWidget, CGuestProcess& guestProcess, const QStringList &strings = QStringList());
     UIGuestProcessTreeItem(UIGuestControlTreeItem *pTreeWidgetItem, CGuestProcess& guestProcess, const QStringList &strings = QStringList());
+    const CGuestProcess& guestProcess() const;
     virtual ~UIGuestProcessTreeItem();
 
@@ -121,4 +127,5 @@
     virtual void prepareConnections() /* override */;
     virtual void cleanupListener()  /* override */;
+    virtual void setColumnText()  /* override */;
 
     CGuestProcess m_comGuestProcess;
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.cpp	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.cpp	(revision 71049)
@@ -22,6 +22,7 @@
 /* Qt includes: */
 # include <QApplication>
+# include <QSplitter>
 # include <QVBoxLayout>
-# include <QSplitter>
+
 
 /* GUI includes: */
@@ -32,5 +33,5 @@
 # include "UIGuestControlTreeItem.h"
 # include "UIInformationGuestSession.h"
-
+# include "UIVMInformationDialog.h"
 # include "VBoxGlobal.h"
 
@@ -40,4 +41,80 @@
 
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+class UIGuestControlTreeWidget : public QITreeWidget
+{
+
+    Q_OBJECT;
+
+signals:
+
+    void sigCloseSessionOrProcess();
+
+public:
+
+    UIGuestControlTreeWidget(QWidget *pParent = 0)
+        :QITreeWidget(pParent)
+    {
+        setSelectionMode(QAbstractItemView::SingleSelection);
+    }
+
+    UIGuestControlTreeItem *selectedItem()
+    {
+        QList<QTreeWidgetItem*> selectedList = selectedItems();
+        if (selectedList.isEmpty())
+            return 0;
+        UIGuestControlTreeItem *item =
+            dynamic_cast<UIGuestControlTreeItem*>(selectedList[0]);
+        /* Return the firstof the selected items */
+        return item;
+    }
+
+protected:
+
+    void contextMenuEvent(QContextMenuEvent *pEvent) /* override */
+    {
+        QList<QTreeWidgetItem *> selectedList = selectedItems();
+        if (selectedList.isEmpty())
+            return;
+        /* Always use the 0th item even if we have a multiple selection. */
+        UIGuestSessionTreeItem *sessionTreeItem = dynamic_cast<UIGuestSessionTreeItem*>(selectedList[0]);
+        /* Create a guest session related context menu */
+        if (sessionTreeItem)
+        {
+            QMenu *menu = new QMenu(this);
+            QAction *pAction = menu->addAction(UIVMInformationDialog::tr("Close Session"));
+
+            if (pAction)
+                connect(pAction, &QAction::triggered,
+                        this, &UIGuestControlTreeWidget::sigCloseSessionOrProcess);
+
+            menu->exec(pEvent->globalPos());
+
+            if (pAction)
+                disconnect(pAction, &QAction::triggered,
+                        this, &UIGuestControlTreeWidget::sigCloseSessionOrProcess);
+
+            delete menu;
+            return;
+        }
+        UIGuestProcessTreeItem *processTreeItem = dynamic_cast<UIGuestProcessTreeItem*>(selectedList[0]);
+        if (!processTreeItem)
+            return;
+        /* Create a guest process tree item */
+        QMenu *menu = new QMenu(this);
+        QAction *pAction = menu->addAction(UIVMInformationDialog::tr("Terminate Process"));
+        if (pAction)
+            connect(pAction, &QAction::triggered,
+                    this, &UIGuestControlTreeWidget::sigCloseSessionOrProcess);
+        menu->exec(pEvent->globalPos());
+
+        if (pAction)
+            disconnect(pAction, &QAction::triggered,
+                    this, &UIGuestControlTreeWidget::sigCloseSessionOrProcess);
+        delete menu;
+
+    }
+
+};
 
 UIInformationGuestSession::UIInformationGuestSession(QWidget *pParent, const CGuest &comGuest)
@@ -62,5 +139,5 @@
     /* Create layout: */
     m_pMainLayout = new QVBoxLayout(this);
-    if(!m_pMainLayout)
+    if (!m_pMainLayout)
         return;
 
@@ -70,5 +147,5 @@
     m_pSplitter = new QSplitter;
 
-    if(!m_pSplitter)
+    if (!m_pSplitter)
         return;
 
@@ -78,11 +155,13 @@
 
 
-    m_pTreeWidget = new QITreeWidget;
+    m_pTreeWidget = new UIGuestControlTreeWidget;
 
     if (m_pTreeWidget)
+    {
         m_pSplitter->addWidget(m_pTreeWidget);
-
+        m_pTreeWidget->setColumnCount(3);
+    }
     m_pConsole = new UIGuestControlConsole;
-    if(m_pConsole)
+    if (m_pConsole)
     {
         m_pSplitter->addWidget(m_pConsole);
@@ -108,9 +187,15 @@
 void UIInformationGuestSession::prepareConnections()
 {
+    qRegisterMetaType<QVector<int> >();
     connect(m_pControlInterface, &UIGuestControlInterface::sigOutputString,
             this, &UIInformationGuestSession::sltConsoleOutputReceived);
     connect(m_pConsole, &UIGuestControlConsole::commandEntered,
             this, &UIInformationGuestSession::sltConsoleCommandEntered);
-    if(m_pQtListener)
+
+    if (m_pTreeWidget)
+        connect(m_pTreeWidget, &UIGuestControlTreeWidget::sigCloseSessionOrProcess,
+                this, &UIInformationGuestSession::sltCloseSessionOrProcess);
+
+    if (m_pQtListener)
     {
         connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestSessionRegistered,
@@ -128,5 +213,5 @@
 void UIInformationGuestSession::sltConsoleCommandEntered(const QString &strCommand)
 {
-    if(m_pControlInterface)
+    if (m_pControlInterface)
     {
         m_pControlInterface->putCommand(strCommand);
@@ -136,8 +221,37 @@
 void UIInformationGuestSession::sltConsoleOutputReceived(const QString &strOutput)
 {
-    if(m_pConsole)
+    if (m_pConsole)
     {
         m_pConsole->putOutput(strOutput);
     }
+}
+
+void UIInformationGuestSession::sltCloseSessionOrProcess()
+{
+    if (!m_pTreeWidget)
+        return;
+    UIGuestControlTreeItem *selectedTreeItem =
+        m_pTreeWidget->selectedItem();
+    if (!selectedTreeItem)
+        return;
+    UIGuestProcessTreeItem *processTreeItem =
+        dynamic_cast<UIGuestProcessTreeItem*>(selectedTreeItem);
+    if (processTreeItem)
+    {
+        CGuestProcess guestProcess = processTreeItem->guestProcess();
+        if (guestProcess.isOk())
+        {
+            guestProcess.Terminate();
+        }
+        return;
+    }
+    UIGuestSessionTreeItem *sessionTreeItem =
+        dynamic_cast<UIGuestSessionTreeItem*>(selectedTreeItem);
+    if (!sessionTreeItem)
+        return;
+    CGuestSession guestSession = sessionTreeItem->guestSession();
+    if (!guestSession.isOk())
+        return;
+    guestSession.Close();
 }
 
@@ -198,8 +312,13 @@
         return;
 
-    new UIGuestSessionTreeItem(m_pTreeWidget, guestSession);
-    //printf("sltGuestSessionRegistered \n");
-    // addGuestSession(guestSession);
-    // emit sigGuestSessionUpdated();
+    UIGuestSessionTreeItem* sessionTreeItem = new UIGuestSessionTreeItem(m_pTreeWidget, guestSession);
+    connect(sessionTreeItem, &UIGuestSessionTreeItem::sigGuessSessionUpdated,
+            this, &UIInformationGuestSession::sltTreeItemUpdated);
+}
+
+void UIInformationGuestSession::sltTreeItemUpdated()
+{
+    if (m_pTreeWidget)
+        m_pTreeWidget->update();
 }
 
@@ -208,5 +327,23 @@
     if (!guestSession.isOk())
         return;
-    // removeGuestSession(guestSession);
-    // emit sigGuestSessionUpdated();
-}
+    if (!m_pTreeWidget)
+        return;
+
+    UIGuestSessionTreeItem *selectedItem = NULL;
+
+
+    for (int i = 0; i < m_pTreeWidget->topLevelItemCount(); ++i)
+    {
+        QTreeWidgetItem *item = m_pTreeWidget->topLevelItem( i );
+
+        UIGuestSessionTreeItem *treeItem = dynamic_cast<UIGuestSessionTreeItem*>(item);
+        if (treeItem && treeItem->guestSession() == guestSession)
+        {
+            selectedItem = treeItem;
+            break;
+        }
+    }
+    delete selectedItem;
+}
+
+#include "UIInformationGuestSession.moc"
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.h	(revision 71042)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.h	(revision 71049)
@@ -37,6 +37,5 @@
 class UIGuestControlInterface;
 class UIGuestSessionsEventHandler;
-
-
+class UIGuestControlTreeWidget;
 
 /** QWidget extension
@@ -45,6 +44,4 @@
 {
     Q_OBJECT;
-
-signals:
 
 public:
@@ -61,4 +58,7 @@
     void sltGuestSessionUnregistered(CGuestSession guestSession);
 
+    void sltTreeItemUpdated();
+    void sltCloseSessionOrProcess();
+
 private:
 
@@ -68,10 +68,10 @@
     void updateTreeWidget();
     void cleanupListener();
-    CGuest                   m_comGuest;
-    QVBoxLayout             *m_pMainLayout;
-    QSplitter               *m_pSplitter;
-    QITreeWidget            *m_pTreeWidget;
-    UIGuestControlConsole   *m_pConsole;
-    UIGuestControlInterface *m_pControlInterface;
+    CGuest                    m_comGuest;
+    QVBoxLayout              *m_pMainLayout;
+    QSplitter                *m_pSplitter;
+    UIGuestControlTreeWidget *m_pTreeWidget;
+    UIGuestControlConsole    *m_pConsole;
+    UIGuestControlInterface  *m_pControlInterface;
 
     /** Holds the Qt event listener instance. */
