Index: /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui	(revision 6363)
+++ /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui	(revision 6364)
@@ -6,5 +6,5 @@
 
      Copyright (C) 2006-2007 innotek GmbH
-    
+
      This file is part of VirtualBox Open Source Edition (OSE), as
      available from http://www.virtualbox.org. This file is free software;
@@ -97,5 +97,24 @@
                             </property>
                         </widget>
-                        <widget class="QLineEdit" row="2" column="1">
+                        <widget class="QLabel" row="2" column="0">
+                            <property name="name">
+                                <cstring>txInternalNetwork_WIN</cstring>
+                            </property>
+                            <property name="sizePolicy">
+                                <sizepolicy>
+                                    <hsizetype>0</hsizetype>
+                                    <vsizetype>5</vsizetype>
+                                    <horstretch>0</horstretch>
+                                    <verstretch>0</verstretch>
+                                </sizepolicy>
+                            </property>
+                            <property name="text">
+                                <string>&amp;Network Name</string>
+                            </property>
+                            <property name="buddy" stdset="0">
+                                <cstring>cbInternalNetworkName_WIN</cstring>
+                            </property>
+                        </widget>
+                        <widget class="QLineEdit" row="3" column="1">
                             <property name="name">
                                 <cstring>leMACAddress</cstring>
@@ -127,5 +146,5 @@
                             </property>
                         </widget>
-                        <widget class="QToolButton" row="2" column="2">
+                        <widget class="QToolButton" row="3" column="2">
                             <property name="name">
                                 <cstring>pbGenerateMAC</cstring>
@@ -168,5 +187,5 @@
                             </property>
                         </widget>
-                        <widget class="QLabel" row="2" column="0">
+                        <widget class="QLabel" row="3" column="0">
                             <property name="name">
                                 <cstring>txMACAddress</cstring>
@@ -193,4 +212,24 @@
                             <property name="whatsThis" stdset="0">
                                 <string>Displays the name of the host interface selected for this adapter.</string>
+                            </property>
+                        </widget>
+                        <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
+                            <property name="name">
+                                <cstring>cbInternalNetworkName_WIN</cstring>
+                            </property>
+                            <property name="editable">
+                                <bool>true</bool>
+                            </property>
+                            <property name="insertionPolicy">
+                                <enum>NoInsertion</enum>
+                            </property>
+                            <property name="autoCompletion">
+                                <bool>true</bool>
+                            </property>
+                            <property name="duplicatesEnabled">
+                                <bool>false</bool>
+                            </property>
+                            <property name="whatsThis" stdset="0">
+                                <string>Displays the name of the internal network selected for this adapter.</string>
                             </property>
                         </widget>
@@ -528,4 +567,65 @@
             </vbox>
         </widget>
+        <widget class="QGroupBox">
+            <property name="name">
+                <cstring>grbIntNet</cstring>
+            </property>
+            <property name="title">
+                <string>Internal Network Settings</string>
+            </property>
+            <property name="flat">
+                <bool>false</bool>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>txInternalNetwork_X11</cstring>
+                    </property>
+                    <property name="text">
+                        <string>&amp;Network Name</string>
+                    </property>
+                    <property name="buddy" stdset="0">
+                        <cstring>cbInternalNetworkName_X11</cstring>
+                    </property>
+                </widget>
+                <widget class="QComboBox">
+                    <property name="name">
+                        <cstring>cbInternalNetworkName_X11</cstring>
+                    </property>
+                    <property name="editable">
+                        <bool>true</bool>
+                    </property>
+                    <property name="insertionPolicy">
+                        <enum>NoInsertion</enum>
+                    </property>
+                    <property name="autoCompletion">
+                        <bool>true</bool>
+                    </property>
+                    <property name="duplicatesEnabled">
+                        <bool>false</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <spacer>
+            <property name="name">
+                <cstring>spacer5</cstring>
+            </property>
+            <property name="orientation">
+                <enum>Vertical</enum>
+            </property>
+            <property name="sizeType">
+                <enum>Expanding</enum>
+            </property>
+            <property name="sizeHint">
+                <size>
+                    <width>0</width>
+                    <height>0</height>
+                </size>
+            </property>
+        </spacer>
     </vbox>
 </widget>
@@ -559,4 +659,5 @@
     <tabstop>cbNetworkAttachment</tabstop>
     <tabstop>cbHostInterfaceName</tabstop>
+    <tabstop>cbInternalNetworkName_WIN</tabstop>
     <tabstop>leMACAddress</tabstop>
 </tabstops>
@@ -583,6 +684,7 @@
 <functions>
     <function access="private" specifier="non virtual">init()</function>
-    <function returnType="bool">isPageValid( const QStringList &amp; )</function>
-    <function>loadList( const QStringList &amp;, const QString &amp; )</function>
+    <function returnType="int">checkPage( const QStringList &amp; )</function>
+    <function>loadInterfaceList( const QStringList &amp;, const QString &amp; )</function>
+    <function>loadNetworksList( const QStringList &amp; )</function>
     <function>getFromAdapter( const CNetworkAdapter &amp; )</function>
     <function>putBackToAdapter()</function>
Index: /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h	(revision 6363)
+++ /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMNetworkSettings.ui.h	(revision 6364)
@@ -50,4 +50,5 @@
     /* disable unused interface name UI */
     grbTAP->setHidden (true);
+    grbIntNet->setHidden (true);
     connect (grbEnabled, SIGNAL (toggled (bool)),
              this, SLOT (grbEnabledToggled (bool)));
@@ -56,4 +57,6 @@
     txHostInterface_WIN->setHidden (true);
     cbHostInterfaceName->setHidden (true);
+    txInternalNetwork_WIN->setHidden (true);
+    cbInternalNetworkName_WIN->setHidden (true);
     /* setup iconsets */
     pbTAPSetup->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",
@@ -73,20 +76,29 @@
 }
 
-bool VBoxVMNetworkSettings::isPageValid (const QStringList &aList)
-{
-#if defined Q_WS_WIN
+int VBoxVMNetworkSettings::checkPage (const QStringList &aList)
+{
     CEnums::NetworkAttachmentType type =
         vboxGlobal().toNetworkAttachmentType (cbNetworkAttachment->currentText());
-
-    return !(type == CEnums::HostInterfaceNetworkAttachment &&
-             isInterfaceInvalid (aList, cbHostInterfaceName->currentText()));
+#if defined Q_WS_WIN
+    if (type == CEnums::HostInterfaceNetworkAttachment &&
+        isInterfaceInvalid (aList, cbHostInterfaceName->currentText()))
+        return 1;
+    else if (type == CEnums::InternalNetworkAttachment &&
+             cbInternalNetworkName_WIN->currentText().isEmpty())
+        return 2;
+    else
+        return 0;
 #else
     NOREF (aList);
-    return true;
-#endif
-}
-
-void VBoxVMNetworkSettings::loadList (const QStringList &aList,
-                                      const QString &aNillItem)
+    if (type == CEnums::InternalNetworkAttachment &&
+        cbInternalNetworkName_X11->currentText().isEmpty())
+        return 2;
+    else
+        return 0;
+#endif
+}
+
+void VBoxVMNetworkSettings::loadInterfaceList (const QStringList &aList,
+                                               const QString &aNillItem)
 {
 #if defined Q_WS_WIN
@@ -112,4 +124,18 @@
     NOREF (aNillItem);
 #endif
+}
+
+void VBoxVMNetworkSettings::loadNetworksList (const QStringList &aList)
+{
+    QComboBox *cbNetworkName = 0;
+#if defined Q_WS_WIN
+    cbNetworkName = cbInternalNetworkName_WIN;
+#else
+    cbNetworkName = cbInternalNetworkName_X11;
+#endif
+    Assert (cbNetworkName);
+    cbNetworkName->clear();
+    cbNetworkName->clearEdit();
+    cbNetworkName->insertStringList (aList);
 }
 
@@ -144,6 +170,8 @@
     if (cbHostInterfaceName->currentItem() == -1)
         cbHostInterfaceName->setCurrentText (name);
+    cbInternalNetworkName_WIN->setCurrentText (adapter.GetInternalNetwork());
 #else
     leHostInterface->setText (adapter.GetHostInterface());
+    cbInternalNetworkName_X11->setCurrentText (adapter.GetInternalNetwork());
 #endif
 
@@ -201,4 +229,14 @@
 #endif
     }
+    else if (type == CEnums::InternalNetworkAttachment)
+    {
+#if defined Q_WS_WIN
+        if (!cbInternalNetworkName_WIN->currentText().isEmpty())
+            cadapter.SetInternalNetwork (cbInternalNetworkName_WIN->currentText());
+#else
+        if (!cbInternalNetworkName_X11->currentText().isEmpty())
+            cadapter.SetInternalNetwork (cbInternalNetworkName_X11->currentText());
+#endif
+    }
 }
 
@@ -230,9 +268,14 @@
     bool enableHostIf = vboxGlobal().toNetworkAttachmentType (aString) ==
                         CEnums::HostInterfaceNetworkAttachment;
+    bool enableIntNet = vboxGlobal().toNetworkAttachmentType (aString) ==
+                        CEnums::InternalNetworkAttachment;
 #if defined Q_WS_WIN
     txHostInterface_WIN->setEnabled (enableHostIf);
     cbHostInterfaceName->setEnabled (enableHostIf);
+    txInternalNetwork_WIN->setEnabled (enableIntNet);
+    cbInternalNetworkName_WIN->setEnabled (enableIntNet);
 #else
     grbTAP->setEnabled (enableHostIf);
+    grbIntNet->setEnabled (enableIntNet);
 #endif
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui	(revision 6363)
+++ /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui	(revision 6364)
@@ -6,5 +6,5 @@
 
      Copyright (C) 2006-2007 innotek GmbH
-    
+
      This file is part of VirtualBox Open Source Edition (OSE), as
      available from http://www.virtualbox.org. This file is free software;
@@ -3204,4 +3204,5 @@
     <variable access="private">CMachine cmachine;</variable>
     <variable access="private">QStringList mInterfaceList;</variable>
+    <variable access="private">QStringList mNetworksList;</variable>
     <variable access="private">QWidgetStack *wstUSBFilters;</variable>
     <variable access="private">bool mUSBFilterListModified;</variable>
@@ -3274,4 +3275,5 @@
     <function access="private" returnType="QString">getHdInfo( QGroupBox*, QUuid )</function>
     <function access="private">loadInterfacesList()</function>
+    <function access="private">loadNetworksList()</function>
 </functions>
 <pixmapinproject/>
Index: /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h	(revision 6363)
+++ /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h	(revision 6364)
@@ -878,4 +878,5 @@
 
     loadInterfacesList();
+    loadNetworksList();
 
     /*
@@ -1020,4 +1021,25 @@
 }
 
+void VBoxVMSettingsDlg::loadNetworksList()
+{
+    /* clear inner list */
+    mNetworksList.clear();
+    /* loading internal networks list */
+    CVirtualBox vbox = vboxGlobal().virtualBox();
+    ulong count = vbox.GetSystemProperties().GetNetworkAdapterCount();
+    CMachineEnumerator en = vbox.GetMachines().Enumerate();
+    while (en.HasMore())
+    {
+        CMachine machine = en.GetNext();
+        for (ulong slot = 0; slot < count; ++ slot)
+        {
+            CNetworkAdapter adapter = machine.GetNetworkAdapter (slot);
+            if (adapter.GetAttachmentType() == CEnums::InternalNetworkAttachment &&
+                !mNetworksList.contains (adapter.GetInternalNetwork()))
+                mNetworksList << adapter.GetInternalNetwork();
+        }
+    }
+}
+
 void VBoxVMSettingsDlg::hostInterfaceAdd()
 {
@@ -1143,5 +1165,5 @@
 #if defined Q_WS_WIN
     VBoxVMNetworkSettings *set = static_cast<VBoxVMNetworkSettings*> (aWidget);
-    set->loadList (mInterfaceList, mNoInterfaces);
+    set->loadInterfaceList (mInterfaceList, mNoInterfaces);
     set->revalidate();
 #endif
@@ -1495,4 +1517,5 @@
     {
         QWidget *tab = NULL;
+        int error = 0;
         for (int index = 0; index < tbwNetwork->count(); ++ index)
         {
@@ -1500,5 +1523,6 @@
             VBoxVMNetworkSettings *page =
                 static_cast <VBoxVMNetworkSettings *> (tab);
-            valid = page->isPageValid (mInterfaceList);
+            error = page->checkPage (mInterfaceList);
+            valid = !error;
             if (!valid) break;
         }
@@ -1506,5 +1530,7 @@
         {
             Assert (tab);
-            warningText = tr ("Incorrect host network interface is selected");
+            warningText = error == 1 ?
+                tr ("Incorrect host network interface is selected") : error == 2 ?
+                tr ("Internal network name should be defined") : QString::null;
             pageTitle += ": " + tbwNetwork->tabLabel (tab);
         }
@@ -2307,5 +2333,6 @@
 {
     VBoxVMNetworkSettings *page = new VBoxVMNetworkSettings();
-    page->loadList (mInterfaceList, mNoInterfaces);
+    page->loadInterfaceList (mInterfaceList, mNoInterfaces);
+    page->loadNetworksList (mNetworksList);
     page->getFromAdapter (aAdapter);
     QString pageTitle = QString (tr ("Adapter %1", "network"))
@@ -2319,4 +2346,12 @@
 
     /* setup validation */
+    QComboBox *cbNetworkName = 0;
+#ifdef Q_WS_WIN
+    cbNetworkName = page->cbInternalNetworkName_WIN;
+#else
+    cbNetworkName = page->cbInternalNetworkName_X11;
+#endif
+    Assert (cbNetworkName);
+
     QIWidgetValidator *wval =
         new QIWidgetValidator (QString ("%1: %2")
@@ -2325,4 +2360,8 @@
     connect (page->grbEnabled, SIGNAL (toggled (bool)), wval, SLOT (revalidate()));
     connect (page->cbNetworkAttachment, SIGNAL (activated (const QString &)),
+             wval, SLOT (revalidate()));
+    connect (cbNetworkName, SIGNAL (activated (const QString &)),
+             wval, SLOT (revalidate()));
+    connect (cbNetworkName, SIGNAL (textChanged (const QString &)),
              wval, SLOT (revalidate()));
     connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),
