Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 90151)
@@ -651,4 +651,5 @@
 	src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.h \
 	src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.h \
+	src/wizards/editors/UIHostNameDomainEditor.h \
 	src/wizards/newcloudvm/UIWizardNewCloudVM.h \
 	src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h \
@@ -1148,4 +1149,5 @@
 	src/wizards/addcloudvm/UIWizardAddCloudVMPageBasic1.cpp \
 	src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp \
+	src/wizards/editors/UIHostNameDomainEditor.cpp \
 	src/wizards/newcloudvm/UIWizardNewCloudVM.cpp \
 	src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 90151)
@@ -984,5 +984,4 @@
         unattendedInstallData.m_strUserName = comUnattendedInstaller.GetUser();
         unattendedInstallData.m_strPassword = comUnattendedInstaller.GetPassword();
-        unattendedInstallData.m_strHostname = comUnattendedInstaller.GetHostname();
         unattendedInstallData.m_fInstallGuestAdditions = comUnattendedInstaller.GetInstallGuestAdditions();
         unattendedInstallData.m_strGuestAdditionsISOPath = comUnattendedInstaller.GetAdditionsIsoPath();
@@ -2656,5 +2655,5 @@
     comUnattendedInstaller.SetPassword(unattendedData.m_strPassword);
     checkUnattendedInstallError(comUnattendedInstaller);
-    comUnattendedInstaller.SetHostname(unattendedData.m_strHostname);
+    comUnattendedInstaller.SetHostname(unattendedData.m_strHostnameDomain);
     checkUnattendedInstallError(comUnattendedInstaller);
     comUnattendedInstaller.SetProductKey(unattendedData.m_strProductKey);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp	(revision 90151)
@@ -381,8 +381,4 @@
             this, &UIUserNamePasswordEditor::sltUserNameChanged);
 
-    /* Cache the original back color of the line edit to restore it correctly: */
-    if (m_pUserNameLineEdit)
-        m_orginalLineEditBaseColor = m_pUserNameLineEdit->palette().color(QPalette::Base);
-
     retranslateUi();
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h	(revision 90151)
@@ -88,5 +88,4 @@
     QLabel *m_pPasswordLabel;
     QLabel *m_pPasswordRepeatLabel;
-    QColor m_orginalLineEditBaseColor;
 
     bool m_fShowPlaceholderText;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.cpp	(revision 90151)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.cpp	(revision 90151)
@@ -0,0 +1,166 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - UIHostNameDomainEditor class implementation.
+ */
+
+/*
+ * Copyright (C) 2006-2020 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Qt includes: */
+#include <QGridLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QRegularExpressionValidator>
+#include <QStyle>
+#include <QVBoxLayout>
+
+/* GUI includes: */
+#include "QILineEdit.h"
+#include "QIRichTextLabel.h"
+#include "QIToolButton.h"
+#include "UICommon.h"
+#include "UIIconPool.h"
+#include "UIHostNameDomainEditor.h"
+#include "UIWizardNewVM.h"
+
+
+
+UIHostNameDomainEditor::UIHostNameDomainEditor(QWidget *pParent /*  = 0 */)
+    : QIWithRetranslateUI<QWidget>(pParent)
+    , m_pHostnameLineEdit(0)
+    , m_pDomainLineEdit(0)
+    , m_pHostnameLabel(0)
+    , m_pDomainLabel(0)
+{
+    prepare();
+}
+
+QString UIHostNameDomainEditor::hostname() const
+{
+    if (m_pHostnameLineEdit)
+        return m_pHostnameLineEdit->text();
+    return QString();
+}
+
+bool UIHostNameDomainEditor::isComplete() const
+{
+    return m_pHostnameLineEdit && m_pHostnameLineEdit->hasAcceptableInput() &&
+        m_pDomainLineEdit && m_pDomainLineEdit->hasAcceptableInput();
+}
+
+void UIHostNameDomainEditor::setHostname(const QString &strHostname)
+{
+    if (m_pHostnameLineEdit)
+        m_pHostnameLineEdit->setText(strHostname);
+}
+
+QString UIHostNameDomainEditor::domain() const
+{
+    if (m_pDomainLineEdit)
+        return m_pDomainLineEdit->text();
+    return QString();
+}
+
+void UIHostNameDomainEditor::setDomain(const QString &strDomain)
+{
+    if (m_pDomainLineEdit)
+        m_pDomainLineEdit->setText(strDomain);
+}
+
+QString UIHostNameDomainEditor::hostnameDomain() const
+{
+    if (m_pHostnameLineEdit && m_pDomainLineEdit)
+        return QString("%1.%2").arg(m_pHostnameLineEdit->text()).arg(m_pDomainLineEdit->text());
+    return QString();
+}
+
+void UIHostNameDomainEditor::retranslateUi()
+{
+    QString strHostnameTooltip(tr("Type the hostname which will be used in attended install:"));
+    QString strDomainTooltip(tr("The domain name"));
+    if (m_pHostnameLabel)
+    {
+        m_pHostnameLabel->setText(tr("Hostna&me:"));
+        m_pHostnameLabel->setToolTip(strHostnameTooltip);
+    }
+    if (m_pHostnameLineEdit)
+        m_pHostnameLineEdit->setToolTip(strHostnameTooltip);
+    if (m_pDomainLabel)
+    {
+        m_pDomainLabel->setText(tr("&Domain"));
+        m_pDomainLabel->setToolTip(strDomainTooltip);
+    }
+    m_pDomainLineEdit->setToolTip(strDomainTooltip);
+}
+
+void UIHostNameDomainEditor::addLineEdit(int &iRow, QLabel *&pLabel, QILineEdit *&pLineEdit, QGridLayout *pLayout)
+{
+    AssertReturnVoid(pLayout);
+    if (pLabel || pLineEdit)
+        return;
+
+    pLabel = new QLabel;
+    AssertReturnVoid(pLabel);
+    pLabel->setAlignment(Qt::AlignRight);
+    pLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+
+    pLayout->addWidget(pLabel, iRow, 0, 1, 1);
+
+    pLineEdit = new QILineEdit;
+    AssertReturnVoid(pLineEdit);
+
+    pLayout->addWidget(pLineEdit, iRow, 1, 1, 3);
+    // QRegularExpression hostNameRegex("^[a-zA-Z0-9-.]{2,}\\.[a-zA-Z0-9-.]+$");^[a-zA-Z0-9-.]{2,}\.[a-zA-Z0-9-.]+$
+    /* Host name and domain should be strings of minimum length of 2 and composed of alpha numerics, '-', and '.': */
+    m_pHostnameLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression("^[a-zA-Z0-9-.]{2,}"), this));
+
+    pLabel->setBuddy(pLineEdit);
+    ++iRow;
+    return;
+}
+
+void UIHostNameDomainEditor::prepare()
+{
+    QGridLayout *pMainLayout = new QGridLayout;
+    pMainLayout->setContentsMargins(0, 0, 0, 0);
+    pMainLayout->setColumnStretch(0, 0);
+    pMainLayout->setColumnStretch(1, 1);
+    if (!pMainLayout)
+        return;
+    setLayout(pMainLayout);
+    int iRow = 0;
+    addLineEdit(iRow, m_pHostnameLabel, m_pHostnameLineEdit, pMainLayout);
+    addLineEdit(iRow, m_pDomainLabel, m_pDomainLineEdit, pMainLayout);
+
+    connect(m_pHostnameLineEdit, &QILineEdit::textChanged,
+            this, &UIHostNameDomainEditor::sltHostnameChanged);
+    connect(m_pDomainLineEdit, &QILineEdit::textChanged,
+            this, &UIHostNameDomainEditor::sltDomainChanged);
+
+
+    retranslateUi();
+}
+
+void UIHostNameDomainEditor::sltHostnameChanged()
+{
+    m_pHostnameLineEdit->mark(!m_pHostnameLineEdit->hasAcceptableInput(),
+                              tr("Hostname should be a string of length 2. Allowed characters are alphanumerics, '-', and '.'" ));
+    emit sigHostnameDomainChanged(hostnameDomain());
+}
+
+void UIHostNameDomainEditor::sltDomainChanged()
+{
+    m_pDomainLineEdit->mark(!m_pDomainLineEdit->hasAcceptableInput(),
+                              tr("Domain name should be a string of length 2. Allowed characters are alphanumerics, '-', and '.'" ));
+
+    emit sigHostnameDomainChanged(hostnameDomain());
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.h	(revision 90151)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostNameDomainEditor.h	(revision 90151)
@@ -0,0 +1,82 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - UIHostNameDomainEditor class declaration.
+ */
+
+/*
+ * Copyright (C) 2006-2020 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef FEQT_INCLUDED_SRC_widgets_UIHostNameDomainEditor_h
+#define FEQT_INCLUDED_SRC_widgets_UIHostNameDomainEditor_h
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+/* Qt includes: */
+#include <QIcon>
+#include <QWidget>
+
+/* Local includes: */
+#include "QIWithRetranslateUI.h"
+
+/* Forward declarations: */
+class QGridLayout;
+class QLabel;
+class QILineEdit;
+class UIPasswordLineEdit;
+
+class UIHostNameDomainEditor : public QIWithRetranslateUI<QWidget>
+{
+
+    Q_OBJECT;
+
+signals:
+
+    void sigHostnameDomainChanged(const QString &strHostNameDomain);
+
+public:
+
+    UIHostNameDomainEditor(QWidget *pParent = 0);
+
+    QString hostname() const;
+    void setHostname(const QString &strHostname);
+
+    QString domain() const;
+    void setDomain(const QString &strDomain);
+
+    QString hostnameDomain() const;
+
+    bool isComplete() const;
+
+protected:
+
+    void retranslateUi();
+
+private slots:
+
+    void sltHostnameChanged();
+    void sltDomainChanged();
+
+private:
+
+    void prepare();
+    void addLineEdit(int &iRow, QLabel *&pLabel, QILineEdit *&pLineEdit, QGridLayout *pLayout);
+
+    QILineEdit  *m_pHostnameLineEdit;
+    QILineEdit  *m_pDomainLineEdit;
+
+    QLabel *m_pHostnameLabel;
+    QLabel *m_pDomainLabel;
+
+};
+
+#endif /* !FEQT_INCLUDED_SRC_widgets_UIHostNameDomainEditor_h */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp	(revision 90151)
@@ -742,12 +742,12 @@
 }
 
-const QString &UIWizardNewVM::hostname() const
-{
-    return m_unattendedInstallData.m_strHostname;
-}
-
-void UIWizardNewVM::setHostname(const QString &strHostname)
-{
-    m_unattendedInstallData.m_strHostname = strHostname;
+const QString &UIWizardNewVM::hostnameDomain() const
+{
+    return m_unattendedInstallData.m_strHostnameDomain;
+}
+
+void UIWizardNewVM::setHostnameDomain(const QString &strHostnameDomain)
+{
+    m_unattendedInstallData.m_strHostnameDomain = strHostnameDomain;
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h	(revision 90151)
@@ -52,5 +52,5 @@
     QString m_strUserName;
     QString m_strPassword;
-    QString m_strHostname;
+    QString m_strHostnameDomain;
     QString m_strProductKey;
     bool m_fInstallGuestAdditions;
@@ -134,6 +134,6 @@
     void setGuestAdditionsISOPath(const QString &strGAISOPath);
 
-    const QString &hostname() const;
-    void setHostname(const QString &strHostname);
+    const QString &hostnameDomain() const;
+    void setHostnameDomain(const QString &strHostname);
 
     const QString &productKey() const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp	(revision 90151)
@@ -32,4 +32,5 @@
 #include "UIIconPool.h"
 #include "UIUserNamePasswordEditor.h"
+#include "UIHostNameDomainEditor.h"
 #include "UIWizardNewVMUnattendedPageBasic.h"
 #include "UIWizardNewVM.h"
@@ -61,6 +62,5 @@
     , m_pStartHeadlessCheckBox(0)
     , m_pUserNamePasswordEditor(0)
-    , m_pHostnameLineEdit(0)
-    , m_pHostnameLabel(0)
+    , m_pHostnameDomainEditor(0)
     , m_pGAISOPathLabel(0)
     , m_pGAISOFilePathSelector(0)
@@ -101,7 +101,7 @@
         connect(m_pGAInstallationISOContainer, &QGroupBox::toggled,
                 this, &UIWizardNewVMUnattendedPageBasic::sltInstallGACheckBoxToggle);
-    if (m_pHostnameLineEdit)
-        connect(m_pHostnameLineEdit, &QLineEdit::textChanged,
-                this, &UIWizardNewVMUnattendedPageBasic::sltHostnameChanged);
+    if (m_pHostnameDomainEditor)
+        connect(m_pHostnameDomainEditor, &UIHostNameDomainEditor::sigHostnameDomainChanged,
+                this, &UIWizardNewVMUnattendedPageBasic::sltHostnameDomainChanged);
     if (m_pProductKeyLineEdit)
         connect(m_pProductKeyLineEdit, &QLineEdit::textChanged,
@@ -120,7 +120,4 @@
                                             "hostname. Additionally you can enable guest additions install. "
                                             "For Microsoft Windows guests it is possible to provide a product key.</p>"));
-    if (m_pHostnameLabel)
-        m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostna&me:"));
-
     if (m_pGAISOPathLabel)
         m_pGAISOPathLabel->setText(UIWizardNewVM::tr("GA I&nstallation ISO:"));
@@ -166,9 +163,17 @@
         m_pUserNamePasswordEditor->blockSignals(false);
     }
-    if (m_pHostnameLineEdit && !m_userModifiedParameters.contains("Hostname"))
-    {
-        m_pHostnameLineEdit->blockSignals(true);
-        m_pHostnameLineEdit->setText(pWizard->hostname());
-        m_pHostnameLineEdit->blockSignals(false);
+    if (m_pHostnameDomainEditor)
+    {
+        m_pHostnameDomainEditor->blockSignals(true);
+
+        if (!m_userModifiedParameters.contains("HostnameDomain"))
+        {
+            m_pHostnameDomainEditor->setHostname(pWizard->machineBaseName());
+            m_pHostnameDomainEditor->setDomain("myguest.virtualbox.org");
+            /* Initialize unattended hostname here since we cannot get the efault value from CUnattended this early (unlike username etc): */
+            newVMWizardPropertySet(HostnameDomain, m_pHostnameDomainEditor->hostnameDomain());
+        }
+
+        m_pHostnameDomainEditor->blockSignals(false);
     }
     if (m_pGAInstallationISOContainer && !m_userModifiedParameters.contains("InstallGuestAdditions"))
@@ -196,4 +201,6 @@
     if (m_pUserNamePasswordEditor && !m_pUserNamePasswordEditor->isComplete())
         return false;
+    if (m_pHostnameDomainEditor && !m_pHostnameDomainEditor->isComplete())
+        return false;
     return true;
 }
@@ -245,8 +252,9 @@
 }
 
-void UIWizardNewVMUnattendedPageBasic::sltHostnameChanged(const QString &strHostname)
-{
-    newVMWizardPropertySet(Hostname, strHostname);
-    m_userModifiedParameters << "Hostname";
+void UIWizardNewVMUnattendedPageBasic::sltHostnameDomainChanged(const QString &strHostnameDomain)
+{
+    newVMWizardPropertySet(HostnameDomain, strHostnameDomain);
+    m_userModifiedParameters << "HostnameDomain";
+    emit completeChanged();
 }
 
@@ -304,22 +312,18 @@
     }
 
-    m_pHostnameLabel = new QLabel;
-    if (m_pHostnameLabel)
-    {
-        m_pHostnameLabel->setAlignment(Qt::AlignRight);
-        m_pHostnameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
-        pAdditionalOptionsContainerLayout->addWidget(m_pHostnameLabel, 1, 0);
-    }
-    m_pHostnameLineEdit = new QLineEdit;
-    if (m_pHostnameLineEdit)
-    {
-        if (m_pHostnameLabel)
-            m_pHostnameLabel->setBuddy(m_pHostnameLineEdit);
-        pAdditionalOptionsContainerLayout->addWidget(m_pHostnameLineEdit, 1, 1, 1, 2);
+    m_pHostnameDomainEditor = new UIHostNameDomainEditor;
+    if (m_pHostnameDomainEditor)
+    {
+        // if (m_pHostnameLabel)
+        //     m_pHostnameLabel->setBuddy(m_pHostnameLineEdit);
+        // QRegularExpression hostNameRegex("^[a-zA-Z0-9-.]{2,}\\.[a-zA-Z0-9-.]+$");^[a-zA-Z0-9-.]{2,}\.[a-zA-Z0-9-.]+$
+        // m_pHostnameLineEdit->setValidator(new QRegularExpressionValidator(hostNameRegex, this));
+        // m_pHostnameLineEdit->setInputMask("NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#");
+        pAdditionalOptionsContainerLayout->addWidget(m_pHostnameDomainEditor, 1, 0, 2, 3);
     }
 
     m_pStartHeadlessCheckBox = new QCheckBox;
     if (m_pStartHeadlessCheckBox)
-        pAdditionalOptionsContainerLayout->addWidget(m_pStartHeadlessCheckBox, 2, 1);
+        pAdditionalOptionsContainerLayout->addWidget(m_pStartHeadlessCheckBox, 3, 1);
 
     return m_pAdditionalOptionsContainer;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h	(revision 90150)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h	(revision 90151)
@@ -35,4 +35,5 @@
 class UIFilePathSelector;
 class UIUserNamePasswordEditor;
+class UIHostNameDomainEditor;
 struct UIUnattendedInstallData;
 
@@ -64,5 +65,5 @@
     void sltPasswordChanged(const QString &strPassword);
     void sltUserNameChanged(const QString &strUserName);
-    void sltHostnameChanged(const QString &strHostname);
+    void sltHostnameDomainChanged(const QString &strHostname);
     void sltProductKeyChanged(const QString &strProductKey);
     void sltStartHeadlessChanged(bool fStartHeadless);
@@ -93,6 +94,7 @@
         QCheckBox *m_pStartHeadlessCheckBox;
         UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
-        QLineEdit *m_pHostnameLineEdit;
-        QLabel    *m_pHostnameLabel;
+        UIHostNameDomainEditor *m_pHostnameDomainEditor;
+        // QLineEdit *m_pHostnameLineEdit;
+        // QLabel    *m_pHostnameLabel;
         QLabel    *m_pGAISOPathLabel;
         UIFilePathSelector *m_pGAISOFilePathSelector;
