Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.cpp	(revision 90258)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.cpp	(revision 90259)
@@ -36,5 +36,4 @@
 #include "UIMediumSizeEditor.h"
 #include "UIMessageCenter.h"
-#include "UIWizardNewVD.h"
 #include "UIWizardNewVMDiskPageBasic.h"
 
@@ -42,4 +41,8 @@
 #include "CGuestOSType.h"
 #include "CSystemProperties.h"
+
+/* Other VBox includes: */
+#include <iprt/path.h>
+
 
 QString UIWizardNewVMDiskPage::defaultExtension(const CMediumFormat &mediumFormatRef)
@@ -107,4 +110,26 @@
         return QUuid();
     return uMediumId;
+}
+
+bool UIWizardNewVMDiskPage::checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize)
+{
+    /* If the hard disk is split into 2GB parts then no need to make further checks: */
+    if (uVariant & KMediumVariant_VmdkSplit2G)
+        return true;
+
+    RTFSTYPE enmType;
+    int rc = RTFsQueryType(QFileInfo(strMediumPath).absolutePath().toLatin1().constData(), &enmType);
+    if (RT_SUCCESS(rc))
+    {
+        if (enmType == RTFSTYPE_FAT)
+        {
+            /* Limit the medium size to 4GB. minus 128 MB for file overhead: */
+            qulonglong fatLimit = _4G - _128M;
+            if (uSize >= fatLimit)
+                return false;
+        }
+    }
+
+    return true;
 }
 
@@ -270,10 +295,10 @@
 
     if (m_pMediumSizeEditorLabel)
-        m_pMediumSizeEditorLabel->setText(UIWizardNewVD::tr("D&isk Size:"));
+        m_pMediumSizeEditorLabel->setText(UIWizardNewVM::tr("D&isk Size:"));
 
     if (m_pFixedCheckBox)
     {
-        m_pFixedCheckBox->setText(UIWizardNewVD::tr("Pre-allocate &Full Size"));
-        m_pFixedCheckBox->setToolTip(UIWizardNewVD::tr("<p>When checked, the virtual disk image will be fully allocated at "
+        m_pFixedCheckBox->setText(UIWizardNewVM::tr("Pre-allocate &Full Size"));
+        m_pFixedCheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked, the virtual disk image will be fully allocated at "
                                                        "VM creation time, rather than being allocated dynamically at VM run-time.</p>"));
     }
@@ -281,12 +306,12 @@
     /* Translate rich text labels: */
     if (m_pDescriptionLabel)
-        m_pDescriptionLabel->setText(UIWizardNewVD::tr("Please choose whether the new virtual hard disk file should grow as it is used "
+        m_pDescriptionLabel->setText(UIWizardNewVM::tr("Please choose whether the new virtual hard disk file should grow as it is used "
                                                        "(dynamically allocated) or if it should be created at its maximum size (fixed size)."));
     if (m_pDynamicLabel)
-        m_pDynamicLabel->setText(UIWizardNewVD::tr("<p>A <b>dynamically allocated</b> hard disk file will only use space "
+        m_pDynamicLabel->setText(UIWizardNewVM::tr("<p>A <b>dynamically allocated</b> hard disk file will only use space "
                                                    "on your physical hard disk as it fills up (up to a maximum <b>fixed size</b>), "
                                                    "although it will not shrink again automatically when space on it is freed.</p>"));
     if (m_pFixedLabel)
-        m_pFixedLabel->setText(UIWizardNewVD::tr("<p>A <b>fixed size</b> hard disk file may take longer to create on some "
+        m_pFixedLabel->setText(UIWizardNewVM::tr("<p>A <b>fixed size</b> hard disk file may take longer to create on some "
                                                  "systems but is often faster to use.</p>"));
 }
@@ -429,7 +454,7 @@
         }
         /* Check FAT size limitation of the host hard drive: */
-        fResult = UIWizardNewVDPageBaseSizeLocation::checkFATSizeLimitation(pWizard->mediumVariant(),
-                                                                            pWizard->mediumPath(),
-                                                                            pWizard->mediumSize());
+        fResult = UIWizardNewVMDiskPage::checkFATSizeLimitation(pWizard->mediumVariant(),
+                                                                strMediumPath,
+                                                                pWizard->mediumSize());
         if (!fResult)
         {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.h	(revision 90258)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPageBasic.h	(revision 90259)
@@ -61,4 +61,5 @@
                                 QWidget *pCaller);
     QString absoluteFilePath(const QString &strFileName, const QString &strPath);
+    bool checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp	(revision 90258)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp	(revision 90259)
@@ -47,5 +47,4 @@
 #include "UIWizardNewVMPageExpert.h"
 #include "UIWizardNewVMNameOSTypePageBasic.h"
-
 
 /* COM includes: */
@@ -596,5 +595,4 @@
     if (m_enmSelectedDiskSource == SelectedDiskSource_New)
     {
-
         qulonglong uSize = pWizard->mediumSize();
         if( uSize >= m_uMediumSizeMin && uSize <= m_uMediumSizeMax)
@@ -612,45 +610,42 @@
 bool UIWizardNewVMPageExpert::validatePage()
 {
+    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
+    AssertReturn(pWizard, false);
     bool fResult = true;
 
-    // if (selectedDiskSource() == SelectedDiskSource_New)
-    // {
-    //     /* Check if the path we will be using for hard drive creation exists: */
-    //     const QString strMediumPath(fieldImp("mediumPath").toString());
-    //     fResult = !QFileInfo(strMediumPath).exists();
-    //     if (!fResult)
-    //     {
-    //         msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
-    //         return fResult;
-    //     }
-    //     /* Check FAT size limitation of the host hard drive: */
-    //     fResult = UIWizardNewVDPageBaseSizeLocation::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(),
-    //                                                          fieldImp("mediumPath").toString(),
-    //                                                          fieldImp("mediumSize").toULongLong());
-    //     if (!fResult)
-    //     {
-    //         msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this);
-    //         return fResult;
-    //     }
-    // }
-
-    // startProcessing();
-    // UIWizardNewVM *pWizard = wizardImp();
-    // AssertReturn(pWizard, false);
-    // if (selectedDiskSource() == SelectedDiskSource_New)
-    // {
-    //     /* Try to create the hard drive:*/
-    //     fResult = pWizard->createVirtualDisk();
-    //     /*Don't show any error message here since UIWizardNewVM::createVirtualDisk already does so: */
-    //     if (!fResult)
-    //         return fResult;
-    // }
-
-    // fResult = pWizard->createVM();
-    // /* Try to delete the hard disk: */
-    // if (!fResult)
-    //     pWizard->deleteVirtualDisk();
-
-    // endProcessing();
+    if (m_enmSelectedDiskSource == SelectedDiskSource_New)
+    {
+        /* Check if the path we will be using for hard drive creation exists: */
+        const QString &strMediumPath = pWizard->mediumPath();
+        fResult = !QFileInfo(strMediumPath).exists();
+        if (!fResult)
+        {
+            msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
+            return fResult;
+        }
+        qulonglong uSize = pWizard->mediumSize();
+        qulonglong uVariant = pWizard->mediumVariant();
+        /* Check FAT size limitation of the host hard drive: */
+        fResult =  UIWizardNewVMDiskPage::checkFATSizeLimitation(uVariant, strMediumPath, uSize);
+        if (!fResult)
+        {
+            msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this);
+            return fResult;
+        }
+    }
+
+    if (m_enmSelectedDiskSource == SelectedDiskSource_New)
+    {
+        /* Try to create the hard drive:*/
+        fResult = pWizard->createVirtualDisk();
+        /*Don't show any error message here since UIWizardNewVM::createVirtualDisk already does so: */
+        if (!fResult)
+            return fResult;
+    }
+
+    fResult = pWizard->createVM();
+    /* Try to delete the hard disk: */
+    if (!fResult)
+        pWizard->deleteVirtualDisk();
 
     return fResult;
