Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 72918)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 72919)
@@ -673,11 +673,13 @@
 
     SHOW_STRING_PROP(      machine, Name,                       "name",                 "Name:");
-
+    SHOW_STRINGARRAY_PROP( machine, Groups,                     "groups",               "Groups:");
     Bstr osTypeId;
     CHECK_ERROR2I_RET(machine, COMGETTER(OSTypeId)(osTypeId.asOutParam()), hrcCheck);
     ComPtr<IGuestOSType> osType;
-    CHECK_ERROR2I_RET(pVirtualBox, GetGuestOSType(osTypeId.raw(), osType.asOutParam()), hrcCheck);
-    SHOW_STRINGARRAY_PROP( machine, Groups,                     "groups",               "Groups:");
-    SHOW_STRING_PROP(       osType, Description,                "ostype",               "Guest OS:");
+    pVirtualBox->GetGuestOSType(osTypeId.raw(), osType.asOutParam());
+    if (!osType.isNull())
+        SHOW_STRING_PROP(       osType, Description,                "ostype",               "Guest OS:");
+    else
+        SHOW_STRING_PROP(      machine, OSTypeId,                   "ostype",               "Guest OS:");
     SHOW_UUID_PROP(        machine, Id,                         "UUID",                 "UUID:");
     SHOW_STRING_PROP(      machine, SettingsFilePath,           "CfgFile",              "Config file:");
Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 72918)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 72919)
@@ -564,16 +564,5 @@
             case MODIFYVM_OSTYPE:
             {
-                ComPtr<IGuestOSType> guestOSType;
-                CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz).raw(),
-                                                          guestOSType.asOutParam()));
-                if (SUCCEEDED(rc) && guestOSType)
-                {
-                    CHECK_ERROR(sessionMachine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
-                }
-                else
-                {
-                    errorArgument("Invalid guest OS type '%s'", ValueUnion.psz);
-                    rc = E_FAIL;
-                }
+                CHECK_ERROR(sessionMachine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
                 break;
             }
Index: trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
===================================================================
--- trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 72918)
+++ trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 72919)
@@ -962,10 +962,13 @@
     if mach == None:
         return 0
-    vmos = ctx['vb'].getGuestOSType(mach.OSTypeId)
+    try:
+        vmos = ctx['vb'].getGuestOSType(mach.OSTypeId)
+    except:
+        vmos = None
     print(" One can use setvar <mach> <var> <value> to change variable, using name in [].")
     print("  Name [name]: %s" % (colVm(ctx, mach.name)))
     print("  Description [description]: %s" % (mach.description))
     print("  ID [n/a]: %s" % (mach.id))
-    print("  OS Type [via OSTypeId]: %s" % (vmos.description))
+    print("  OS Type [via OSTypeId]: %s" % (vmos.description if vmos is not None else mach.OSTypeId))
     print("  Firmware [firmwareType]: %s (%s)" % (asEnumElem(ctx, "FirmwareType", mach.firmwareType), mach.firmwareType))
     print()
Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 72918)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 72919)
@@ -2640,4 +2640,8 @@
         the guest OS this object describes.
 
+        While this function returns an error for unknown guest OS types, they
+        can be still used without serious problems (if one accepts the fact
+        that there is no default VM config information).
+
         <result name="E_INVALIDARG">
           @a id is not a valid Guest OS type.
@@ -5026,5 +5030,6 @@
         You may use <link to="IVirtualBox::getGuestOSType"/> to obtain
         an IGuestOSType object representing details about the given
-        Guest OS type.
+        Guest OS type. All Guest OS types are considered valid, even those
+        which are not known to <link to="IVirtualBox::getGuestOSType"/>.
         <note>
           This value may differ from the value returned by
Index: trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- trunk/src/VBox/Main/include/MachineImpl.h	(revision 72918)
+++ trunk/src/VBox/Main/include/MachineImpl.h	(revision 72919)
@@ -351,4 +351,5 @@
                  const Utf8Str &strName,
                  const StringsList &llGroups,
+                 const Utf8Str &strOsTypeId,
                  GuestOSType *aOsType,
                  const Guid &aId,
Index: trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 72919)
@@ -820,10 +820,14 @@
     }
 
-    ComPtr<IGuestOSType> guestOSType;
-    hrc = virtualBox->GetGuestOSType(osTypeId.raw(), guestOSType.asOutParam());             H();
-
-    Bstr guestTypeFamilyId;
-    hrc = guestOSType->COMGETTER(FamilyId)(guestTypeFamilyId.asOutParam());                 H();
-    BOOL fOsXGuest = guestTypeFamilyId == Bstr("MacOS");
+    ComPtr<IGuestOSType> pGuestOSType;
+    virtualBox->GetGuestOSType(osTypeId.raw(), pGuestOSType.asOutParam());
+
+    BOOL fOsXGuest = FALSE;
+    if (!pGuestOSType.isNull())
+    {
+        Bstr guestTypeFamilyId;
+        hrc = pGuestOSType->COMGETTER(FamilyId)(guestTypeFamilyId.asOutParam());            H();
+        fOsXGuest = guestTypeFamilyId == Bstr("MacOS");
+    }
 
     ULONG maxNetworkAdapters;
Index: trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 72919)
@@ -289,8 +289,8 @@
                                      vsysThis.strLicenseText);
 
-            /* Now that we know the OS type, get our internal defaults based on that. */
+            /* Now that we know the OS type, get our internal defaults based on
+             * that, if it is known (otherwise pGuestOSType will be NULL). */
             ComPtr<IGuestOSType> pGuestOSType;
-            rc = mVirtualBox->GetGuestOSType(Bstr(strOsTypeVBox).raw(), pGuestOSType.asOutParam());
-            if (FAILED(rc)) throw rc;
+            mVirtualBox->GetGuestOSType(Bstr(strOsTypeVBox).raw(), pGuestOSType.asOutParam());
 
             /* CPU count */
@@ -341,6 +341,11 @@
                 /* If the RAM of the OVF is zero, use our predefined values */
                 ULONG memSizeVBox2;
-                rc = pGuestOSType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
-                if (FAILED(rc)) throw rc;
+                if (!pGuestOSType.isNull())
+                {
+                    rc = pGuestOSType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
+                    if (FAILED(rc)) throw rc;
+                }
+                else
+                    memSizeVBox2 = 1024;
                 /* VBox stores that in MByte */
                 ullMemSizeVBox = (uint64_t)memSizeVBox2;
@@ -428,6 +433,17 @@
                 /* Get the default network adapter type for the selected guest OS */
                 NetworkAdapterType_T defaultAdapterVBox = NetworkAdapterType_Am79C970A;
-                rc = pGuestOSType->COMGETTER(AdapterType)(&defaultAdapterVBox);
-                if (FAILED(rc)) throw rc;
+                if (!pGuestOSType.isNull())
+                {
+                    rc = pGuestOSType->COMGETTER(AdapterType)(&defaultAdapterVBox);
+                    if (FAILED(rc)) throw rc;
+                }
+                else
+                {
+#ifdef VBOX_WITH_E1000
+                    defaultAdapterVBox = NetworkAdapterType_I82540EM;
+#else
+                    defaultAdapterVBox = NetworkAdapterType_Am79C973A;
+#endif
+                }
 
                 ovf::EthernetAdaptersList::const_iterator itEA;
Index: trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp	(revision 72919)
@@ -59,5 +59,5 @@
 void BIOSSettings::FinalRelease()
 {
-    uninit ();
+    uninit();
     BaseFinalRelease();
 }
@@ -562,15 +562,15 @@
 }
 
-void BIOSSettings::i_copyFrom (BIOSSettings *aThat)
-{
-    AssertReturnVoid (aThat != NULL);
+void BIOSSettings::i_copyFrom(BIOSSettings *aThat)
+{
+    AssertReturnVoid(aThat != NULL);
 
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturnVoid (autoCaller.rc());
+    AssertComRCReturnVoid(autoCaller.rc());
 
     /* sanity too */
-    AutoCaller thatCaller (aThat);
-    AssertComRCReturnVoid (thatCaller.rc());
+    AutoCaller thatCaller(aThat);
+    AssertComRCReturnVoid(thatCaller.rc());
 
     /* peer is not modified, lock it for reading (aThat is "master" so locked
@@ -583,16 +583,17 @@
 }
 
-void BIOSSettings::i_applyDefaults (GuestOSType *aOsType)
-{
-    AssertReturnVoid (aOsType != NULL);
-
+void BIOSSettings::i_applyDefaults(GuestOSType *aOsType)
+{
     /* sanity */
     AutoCaller autoCaller(this);
-    AssertComRCReturnVoid (autoCaller.rc());
+    AssertComRCReturnVoid(autoCaller.rc());
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
     /* Initialize default BIOS settings here */
-    m->bd->fIOAPICEnabled = aOsType->i_recommendedIOAPIC();
+    if (aOsType)
+        m->bd->fIOAPICEnabled = aOsType->i_recommendedIOAPIC();
+    else
+        m->bd->fIOAPICEnabled = true;
 }
 
Index: trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 72919)
@@ -278,4 +278,5 @@
  *  @param strName      name for the machine
  *  @param llGroups     list of groups for the machine
+ *  @param strOsType    OS Type string (stored as is if aOsType is NULL).
  *  @param aOsType      OS Type of this machine or NULL.
  *  @param aId          UUID for the new machine.
@@ -290,4 +291,5 @@
                       const Utf8Str &strName,
                       const StringsList &llGroups,
+                      const Utf8Str &strOsType,
                       GuestOSType *aOsType,
                       const Guid &aId,
@@ -343,7 +345,4 @@
             mUserData->s.strOsType = aOsType->i_id();
 
-            /* Apply BIOS defaults */
-            mBIOSSettings->i_applyDefaults(aOsType);
-
             /* Let the OS type select 64-bit ness. */
             mHWData->mLongMode = aOsType->i_is64Bit()
@@ -353,4 +352,17 @@
             mHWData->mX2APIC = aOsType->i_recommendedX2APIC();
         }
+        else if (!strOsType.isEmpty())
+        {
+            /* Store OS type */
+            mUserData->s.strOsType = strOsType;
+
+            /* No guest OS type object. Pick some plausible defaults which the
+             * host can handle. There's no way to know or validate anything. */
+            mHWData->mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
+            mHWData->mX2APIC = false;
+        }
+
+        /* Apply BIOS defaults */
+        mBIOSSettings->i_applyDefaults(aOsType);
 
         /* Apply network adapters defaults */
@@ -1087,15 +1099,13 @@
     /* look up the object by Id to check it is valid */
     ComObjPtr<GuestOSType> pGuestOSType;
-    HRESULT rc = mParent->i_findGuestOSType(aOSTypeId,
-                                            pGuestOSType);
-    if (FAILED(rc)) return rc;
+    mParent->i_findGuestOSType(aOSTypeId, pGuestOSType);
 
     /* when setting, always use the "etalon" value for consistency -- lookup
      * by ID is case-insensitive and the input value may have different case */
-    Utf8Str osTypeId = pGuestOSType->i_id();
+    Utf8Str osTypeId = !pGuestOSType.isNull() ? pGuestOSType->i_id() : aOSTypeId;
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    rc = i_checkStateDependency(MutableStateDep);
+    HRESULT rc = i_checkStateDependency(MutableStateDep);
     if (FAILED(rc)) return rc;
 
@@ -1288,5 +1298,9 @@
             HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType,
                                                       pGuestOSType);
-            AssertMsgReturn(SUCCEEDED(hrc2), ("Failed to get guest OS type. hrc2=%Rhrc\n", hrc2), hrc2);
+            if (FAILED(hrc2) || pGuestOSType.isNull())
+            {
+                *aParavirtProvider = ParavirtProvider_None;
+                break;
+            }
 
             Utf8Str guestTypeFamilyId = pGuestOSType->i_familyId();
@@ -2228,5 +2242,5 @@
                 HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType,
                                                           pGuestOSType);
-                if (SUCCEEDED(hrc2))
+                if (SUCCEEDED(hrc2) && !pGuestOSType.isNull())
                 {
                     if (pGuestOSType->i_is64Bit())
@@ -8830,8 +8844,7 @@
     // look up the object by Id to check it is valid
     ComObjPtr<GuestOSType> pGuestOSType;
-    HRESULT rc = mParent->i_findGuestOSType(mUserData->s.strOsType,
-                                            pGuestOSType);
-    if (FAILED(rc)) return rc;
-    mUserData->s.strOsType = pGuestOSType->i_id();
+    mParent->i_findGuestOSType(mUserData->s.strOsType, pGuestOSType);
+    if (!pGuestOSType.isNull())
+        mUserData->s.strOsType = pGuestOSType->i_id();
 
     // stateFile (optional)
@@ -8851,5 +8864,5 @@
 
     // snapshot folder needs special processing so set it again
-    rc = COMSETTER(SnapshotFolder)(Bstr(config.machineUserData.strSnapshotFolder).raw());
+    HRESULT rc = COMSETTER(SnapshotFolder)(Bstr(config.machineUserData.strSnapshotFolder).raw());
     if (FAILED(rc)) return rc;
 
@@ -9032,8 +9045,5 @@
     {
         ComObjPtr<GuestOSType> pGuestOSType;
-        rc = mParent->i_findGuestOSType(Bstr(mUserData->s.strOsType).raw(),
-                                        pGuestOSType);
-        if (FAILED(rc))
-            return rc;
+        mParent->i_findGuestOSType(mUserData->s.strOsType, pGuestOSType);
 
         /* The hardware version attribute (optional). */
Index: trunk/src/VBox/Main/src-server/NATEngineImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/NATEngineImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/NATEngineImpl.cpp	(revision 72919)
@@ -20,5 +20,4 @@
 #include "Logging.h"
 #include "MachineImpl.h"
-#include "GuestOSTypeImpl.h"
 
 #include <iprt/string.h>
Index: trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp	(revision 72919)
@@ -1233,7 +1233,16 @@
 #endif // VBOX_WITH_E1000
 
-    NetworkAdapterType_T defaultType = NetworkAdapterType_Am79C973;
+    NetworkAdapterType_T defaultType;
     if (aOsType)
         defaultType = aOsType->i_networkAdapterType();
+    else
+    {
+#ifdef VBOX_WITH_E1000
+        defaultType = NetworkAdapterType_I82540EM;
+#else
+        defaultType = NetworkAdapterType_Am79C973A;
+#endif
+    }
+
 
     /* Set default network adapter for this OS type */
Index: trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 72919)
@@ -1037,5 +1037,8 @@
         HRESULT hrc = mParent->GetGuestOSType(bstrGuestOsTypeId.raw(), ptrGuestOSType.asOutParam());
         if (SUCCEEDED(hrc))
-            hrc = ptrGuestOSType->COMGETTER(RecommendedDVDStorageBus)(&enmRecommendedStorageBus);
+        {
+            if (!ptrGuestOSType.isNull())
+                hrc = ptrGuestOSType->COMGETTER(RecommendedDVDStorageBus)(&enmRecommendedStorageBus);
+        }
         if (FAILED(hrc))
             return hrc;
@@ -2337,5 +2340,6 @@
     {
         BOOL fIs64Bit = FALSE;
-        hrc = pGuestOSType->COMGETTER(Is64Bit)(&fIs64Bit);
+        if (!pGuestOSType.isNull())
+            hrc = pGuestOSType->COMGETTER(Is64Bit)(&fIs64Bit);
         if (SUCCEEDED(hrc))
             return fIs64Bit != FALSE;
Index: trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 72918)
+++ trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 72919)
@@ -1517,5 +1517,4 @@
     LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n",
                      aSettingsFile.c_str(), aName.c_str(), aOsTypeId.c_str(), aFlags.c_str()));
-    /** @todo tighten checks on aId? */
 
     StringsList llGroups;
@@ -1596,14 +1595,12 @@
     ComObjPtr<GuestOSType> osType;
     if (!aOsTypeId.isEmpty())
-    {
-        rc = i_findGuestOSType(aOsTypeId, osType);
-        if (FAILED(rc)) return rc;
-    }
+        i_findGuestOSType(aOsTypeId, osType);
 
     /* initialize the machine object */
     rc = machine->init(this,
                        strSettingsFile,
-                       Utf8Str(aName),
+                       aName,
                        llGroups,
+                       aOsTypeId,
                        osType,
                        id,
