VirtualBox

Changeset 105833 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 22, 2024 8:15:17 PM (3 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10511, bugref:10384. Check if by unattended install detected OS type is supported by the host architecture. If not make sure VM creation is not possible, with sufficient warning to user in basic wizard mode.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r105584 r105833  
    742742}
    743743
     744bool UIWizardNewVM::isGuestOSTypeSupported(const QString &strGuestOSTypeId) const
     745{
     746    if (strGuestOSTypeId.isEmpty())
     747        return true;
     748    return gpGlobalSession->guestOSTypeManager().isGuestOSTypeIDSupported(strGuestOSTypeId);
     749}
     750
    744751void UIWizardNewVM::setDetectedWindowsImageNamesAndIndices(const QVector<QString> &names, const QVector<ulong> &ids)
    745752{
     
    801808    if (!isUnattendedInstallSupported())
    802809        return false;
     810    if (!isGuestOSTypeSupported(detectedOSTypeId()))
     811        return false;
    803812    return true;
    804813}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r105584 r105833  
    158158        bool emptyDiskRecommended() const;
    159159        void setEmptyDiskRecommended(bool fEmptyDiskRecommended);
     160
     161        bool isGuestOSTypeSupported(const QString &strGuestOSTypeId) const;
    160162
    161163        void setDetectedWindowsImageNamesAndIndices(const QVector<QString> &names, const QVector<ulong> &ids);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp

    r105521 r105833  
    474474    }
    475475    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
    476     if (pWizard && pWizard->installGuestAdditions() && m_pGAInstallationISOContainer)
    477         m_pGAInstallationISOContainer->mark();
     476    if (pWizard)
     477    {
     478        if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     479            m_pNameAndSystemEditor->markImageEditor(true, UIWizardNewVM::tr("ISO file is for an unsupported guest OS type"), "");
     480        if (pWizard->installGuestAdditions() && m_pGAInstallationISOContainer)
     481            m_pGAInstallationISOContainer->mark();
     482    }
    478483    if (isUnattendedEnabled())
    479484        m_pAdditionalOptionsContainer->mark();
     
    631636        }
    632637    }
    633 
     638    /* Don't allow VM creation if detect OS type id (from selected ISO) is unsupported: */
     639    if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     640        fIsComplete = false;
    634641    if (pWizard->diskSource() == SelectedDiskSource_Existing && gpMediumEnumerator->medium(m_pDiskSelector->id()).isNull())
    635642    {
     
    990997        return;
    991998    }
    992 
     999    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
     1000    if (pWizard)
     1001    {
     1002        if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     1003        {
     1004            m_pSkipUnattendedCheckBox->setEnabled(false);
     1005            return;
     1006        }
     1007    }
    9931008    m_pSkipUnattendedCheckBox->setEnabled(UIWizardNewVMNameOSTypeCommon::checkISOFile(m_pNameAndSystemEditor));
    9941009}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp

    r105642 r105833  
    353353bool UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(UINameAndSystemEditor *pNameAndSystemEditor, QString strDetectedOSType)
    354354{
     355    if (!gpGlobalSession->guestOSTypeManager().isGuestOSTypeIDSupported(strDetectedOSType))
     356        return false;
    355357    AssertReturn(pNameAndSystemEditor, false);
    356358    if (!strDetectedOSType.isEmpty())
     
    520522    if (m_pNameAndSystemEditor->name().isEmpty())
    521523        return false;
     524    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
     525    if (pWizard)
     526    {
     527        if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     528            return false;
     529    }
    522530    return UIWizardNewVMNameOSTypeCommon::checkISOFile(m_pNameAndSystemEditor);
    523531}
     
    590598     * - Unattended cannot determine OS type from the ISO,
    591599     * - Unattended can determine the OS type from the ISO but cannot install it,
     600     * - Unattended detects OS type from ISO but this OS type arch. is not supported, page validation will fail,
    592601     * - User has disabled unattended explicitly,
    593602     * - Unattended install will kick off.
     
    607616                                           .arg(UIWizardNewVM::tr("This OS type cannot be installed unattendedly. "
    608617                                                                  "The install needs to be started manually."));
     618        else if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     619            strMessage =  UIWizardNewVM::tr("Detected OS type: %1. %2")
     620                                           .arg(strType)
     621                                           .arg(UIWizardNewVM::tr("This OS type is not supported by your host. "
     622                                                                  "You need to either deselect ISO image or pick another one to continue."));
    609623        else if (pWizard->skipUnattendedInstall())
    610624            strMessage = UIWizardNewVM::tr("You have selected to skip unattended guest OS install, "
     
    767781                                                UIWizardNewVM::tr("Invalid file path or unreadable file"),
    768782                                                UIWizardNewVM::tr("File path is valid"));
     783        UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
     784        if (pWizard)
     785        {
     786            if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     787                m_pNameAndSystemEditor->markImageEditor(true, UIWizardNewVM::tr("ISO file is for an unsupported guest OS type"), "");
     788        }
    769789    }
    770790}
     
    784804        return;
    785805    }
    786 
     806    UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>();
     807    if (pWizard)
     808    {
     809        if (!pWizard->isGuestOSTypeSupported(pWizard->detectedOSTypeId()))
     810        {
     811            m_pSkipUnattendedCheckBox->setEnabled(false);
     812            return;
     813        }
     814    }
    787815    m_pSkipUnattendedCheckBox->setEnabled(UIWizardNewVMNameOSTypeCommon::checkISOFile(m_pNameAndSystemEditor));
    788816}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette