Index: trunk/src/VBox/Main/HardDisk2Impl.cpp
===================================================================
--- trunk/src/VBox/Main/HardDisk2Impl.cpp	(revision 14223)
+++ trunk/src/VBox/Main/HardDisk2Impl.cpp	(revision 14224)
@@ -472,6 +472,7 @@
                          const BSTR aLocation)
 {
-    AssertReturn (aVirtualBox, E_INVALIDARG);
-    AssertReturn (aLocation, E_INVALIDARG);
+    AssertReturn (aVirtualBox != NULL, E_INVALIDARG);
+    AssertReturn (aLocation != NULL, E_INVALIDARG);
+    AssertReturn (aFormat != NULL && *aFormat != '\0', E_INVALIDARG);
 
     /* Enclose the state transition NotReady->InInit->Ready */
Index: trunk/src/VBox/Main/SystemPropertiesImpl.cpp
===================================================================
--- trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 14223)
+++ trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 14224)
@@ -75,4 +75,6 @@
     setDefaultMachineFolder (NULL);
     setDefaultHardDiskFolder (NULL);
+    setDefaultHardDiskFormat (NULL);
+
     setRemoteDisplayAuthLibrary (NULL);
 
@@ -362,4 +364,34 @@
 }
 
+STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat) (BSTR *aDefaultHardDiskFormat)
+{
+    if (!aDefaultHardDiskFormat)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReadLock alock (this);
+
+    mDefaultHardDiskFormat.cloneTo (aDefaultHardDiskFormat);
+
+    return S_OK;
+}
+
+STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat) (INPTR BSTR aDefaultHardDiskFormat)
+{
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    /* VirtualBox::saveSettings() needs a write lock */
+    AutoMultiWriteLock2 alock (mParent, this);
+
+    HRESULT rc = setDefaultHardDiskFormat (aDefaultHardDiskFormat);
+    if (SUCCEEDED (rc))
+        rc = mParent->saveSettings();
+
+    return rc;
+}
+
 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
 {
@@ -508,4 +540,8 @@
     bstr = properties.stringValue ("defaultHardDiskFolder");
     rc = setDefaultHardDiskFolder (bstr);
+    CheckComRCReturnRC (rc);
+
+    bstr = properties.stringValue ("defaultHardDiskFormat");
+    rc = setDefaultHardDiskFormat (bstr);
     CheckComRCReturnRC (rc);
 
@@ -549,4 +585,7 @@
     if (mDefaultHardDiskFolder)
         properties.setValue <Bstr> ("defaultHardDiskFolder", mDefaultHardDiskFolder);
+
+    if (mDefaultHardDiskFormat)
+        properties.setValue <Bstr> ("defaultHardDiskFormat", mDefaultHardDiskFormat);
 
     if (mRemoteDisplayAuthLibrary)
@@ -610,13 +649,20 @@
 }
 
+HRESULT SystemProperties::setDefaultHardDiskFormat (const BSTR aFormat)
+{
+    if (aFormat && *aFormat)
+        mDefaultHardDiskFormat = aFormat;
+    else
+        mDefaultHardDiskFormat = "VDI";
+
+    return S_OK;
+}
+
 HRESULT SystemProperties::setRemoteDisplayAuthLibrary (const BSTR aPath)
 {
-    Utf8Str path;
     if (aPath && *aPath)
-        path = aPath;
+        mRemoteDisplayAuthLibrary = aPath;
     else
-        path = "VRDPAuth";
-
-    mRemoteDisplayAuthLibrary = path;
+        mRemoteDisplayAuthLibrary = "VRDPAuth";
 
     return S_OK;
@@ -625,12 +671,9 @@
 HRESULT SystemProperties::setWebServiceAuthLibrary (const BSTR aPath)
 {
-    Utf8Str path;
     if (aPath && *aPath)
-        path = aPath;
+        mWebServiceAuthLibrary = aPath;
     else
-        path = "VRDPAuth";
-
-    mWebServiceAuthLibrary = path;
-
-    return S_OK;
-}
+        mWebServiceAuthLibrary = "VRDPAuth";
+
+    return S_OK;
+}
Index: trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 14223)
+++ trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 14224)
@@ -1060,9 +1060,16 @@
     /* we don't access non-const data members so no need to lock */
 
+    Bstr format = aFormat;
+    if (format.isEmpty())
+    {
+        AutoReadLock propsLock (systemProperties());
+        format = systemProperties()->defaultHardDiskFormat();
+    }
+
     HRESULT rc = E_FAIL;
 
     ComObjPtr <HardDisk2> hardDisk;
     hardDisk.createObject();
-    rc = hardDisk->init (this, aFormat, aLocation);
+    rc = hardDisk->init (this, format, aLocation);
 
     if (SUCCEEDED (rc))
Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 14223)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 14224)
@@ -1386,7 +1386,10 @@
         the <link to="#hardDisks2"/> array. See IHardDisk2 for more details.
 
-        The list of all <link to="IHardDisk2::format">storage formats</link>
-        supported by this VirtualBox installation can be obtained using
-        <link to="ISystemProperties::hardDiskFormats"/>.
+        The list of all storage formats supported by this VirtualBox
+        installation can be obtained using
+        <link to="ISystemProperties::hardDiskFormats"/>. If the @a format
+        attribute is empty or <tt>null</tt> then the default storage format
+        specified by <link to="ISystemProperties::defaultHardDiskFormat"/> will
+        be used for creating a storage unit of the hard disk.
 
         Note that the format of the location string is storage format specific.
@@ -1396,5 +1399,5 @@
       <param name="format" type="wstring" dir="in">
         <desc>
-          Storage format to use for the new hard disk.
+          Idetifier of the torage format to use for the new hard disk.
         </desc>
       </param>
@@ -5269,5 +5272,5 @@
      name="ISystemProperties"
      extends="$unknown"
-     uuid="c7c060a9-91af-4e74-9188-a6b15a725e49"
+     uuid="604afeba-5963-4d12-a577-902ffb96352a"
      wsmap="managed"
      >
@@ -5415,4 +5418,39 @@
         <see>
           <link to="IHardDiskFormat"/>,
+        </see>
+      </desc>
+    </attribute>
+
+    <attribute name="defaultHardDiskFormat" type="wstring">
+      <desc>
+        Identifier of the default hard disk format used by VirtualBox.
+
+        The hard disk format set by this attribute is used by VirtualBox
+        when the hard disk format was not specified explicitly. One example is
+        <link to="IVirtualBox::createHardDisk2()"/> with the <tt>null</tt>
+        format argument. A more complex example is implicit creation of
+        differencing hard disks when taking a snapshot of a virtual machine:
+        this operation will try to use a format of the parent hard disk first
+        and if this format does not support differencing hard disks the default
+        format specified by this argument will be used.
+
+        The list of supported hard disk formats may be obtained by the
+        <link  to="#defaultHardDiskFormats"/> call. Note that the default
+        hard disk format must have a capability to create differencing hard
+        disks; otherwise opeartions that create hard disks implicitly may fail
+        unexpectedly.
+
+        The initial value of this property is <tt>VDI</tt> in the current
+        version of the VirtualBox product, but may change in the future.
+
+        <note>
+          Setting this property to <tt>null</tt> will restore the
+          initial value.
+        </note>
+
+        <see>
+          <link to="#hardDiskFormats"/>,
+          <link to="IHardDiskFormat:id"/>,
+          <link to="IVirtualBox::createHardDisk2()"/>
         </see>
       </desc>
Index: trunk/src/VBox/Main/include/SystemPropertiesImpl.h
===================================================================
--- trunk/src/VBox/Main/include/SystemPropertiesImpl.h	(revision 14223)
+++ trunk/src/VBox/Main/include/SystemPropertiesImpl.h	(revision 14224)
@@ -80,4 +80,6 @@
     STDMETHOD(COMSETTER(DefaultHardDiskFolder)) (INPTR BSTR aDefaultHardDiskFolder);
     STDMETHOD(COMGETTER(HardDiskFormats)) (ComSafeArrayOut (IHardDiskFormat *, aHardDiskFormats));
+    STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFolder);
+    STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (INPTR BSTR aDefaultHardDiskFolder);
     STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary);
     STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (INPTR BSTR aRemoteDisplayAuthLibrary);
@@ -103,4 +105,7 @@
     const Bstr &defaultHardDiskFolderFull() const { return mDefaultHardDiskFolderFull; }
 
+    /** Default hard disk format. Not thread safe (use object lock). */
+    const Bstr &defaultHardDiskFormat() const { return mDefaultHardDiskFormat; }
+
     // for VirtualBoxSupportErrorInfoImpl
     static const wchar_t *getComponentName() { return L"SystemProperties"; }
@@ -112,4 +117,6 @@
     HRESULT setDefaultMachineFolder (const BSTR aPath);
     HRESULT setDefaultHardDiskFolder (const BSTR aPath);
+    HRESULT setDefaultHardDiskFormat (const BSTR aFormat);
+
     HRESULT setRemoteDisplayAuthLibrary (const BSTR aPath);
     HRESULT setWebServiceAuthLibrary (const BSTR aPath);
@@ -121,4 +128,5 @@
     Bstr mDefaultHardDiskFolder;
     Bstr mDefaultHardDiskFolderFull;
+    Bstr mDefaultHardDiskFormat;
 
     HardDiskFormatList mHardDiskFormats;
Index: trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
===================================================================
--- trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 14223)
+++ trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 14224)
@@ -305,4 +305,5 @@
   <xsd:attribute name="defaultMachineFolder" type="TLocalFile"/>
   <xsd:attribute name="defaultHardDiskFolder" type="TLocalFile"/>
+  <xsd:attribute name="defaultHardDiskFormat" type="TNonEmptyString"/>
   <xsd:attribute name="remoteDisplayAuthLibrary" type="TLocalFile"/>
   <xsd:attribute name="webServiceAuthLibrary" type="TLocalFile"/>
