Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 76153)
+++ /trunk/include/VBox/err.h	(revision 76154)
@@ -1677,5 +1677,6 @@
 /** The size of the raw floppy image is too big (>2.88MB) */
 #define VERR_VD_RAW_SIZE_FLOPPY_TOO_BIG             (-3289)
-
+/** Reducing the size is not supported */
+#define VERR_VD_SHRINK_NOT_SUPPORTED                (-3290)
 /** @} */
 
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp	(revision 76153)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp	(revision 76154)
@@ -765,10 +765,10 @@
         if (FAILED(rc))
         {
-            if (rc == E_NOTIMPL)
+            if (!pProgress.isNull())
+                CHECK_PROGRESS_ERROR(pProgress, ("Failed to resize medium"));
+            else if (rc == E_NOTIMPL)
                 RTMsgError("Resize medium operation is not implemented!");
             else if (rc == VBOX_E_NOT_SUPPORTED)
                 RTMsgError("Resize medium operation for this format is not implemented yet!");
-            else if (!pProgress.isNull())
-                CHECK_PROGRESS_ERROR(pProgress, ("Failed to resize medium"));
             else
                 RTMsgError("Failed to resize medium!");
Index: /trunk/src/VBox/Main/src-server/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76153)
+++ /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 76154)
@@ -10012,4 +10012,8 @@
             if (RT_FAILURE(vrc))
             {
+                if (vrc == VERR_VD_SHRINK_NOT_SUPPORTED)
+                    throw setErrorBoth(VBOX_E_NOT_SUPPORTED, vrc,
+                                       tr("Shrinking is not yet supported for medium '%s'"),
+                                       location.c_str());
                 if (vrc == VERR_NOT_SUPPORTED)
                     throw setErrorBoth(VBOX_E_NOT_SUPPORTED, vrc,
Index: /trunk/src/VBox/Storage/VDI.cpp
===================================================================
--- /trunk/src/VBox/Storage/VDI.cpp	(revision 76153)
+++ /trunk/src/VBox/Storage/VDI.cpp	(revision 76154)
@@ -2527,7 +2527,8 @@
     /** @todo implement making the image smaller, it is the responsibility of
      * the user to know what he's doing. */
-    if (   cbSize < getImageDiskSize(&pImage->Header)
-        || GET_MAJOR_HEADER_VERSION(&pImage->Header) == 0
-        || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
+    if (cbSize < getImageDiskSize(&pImage->Header))
+        rc = VERR_VD_SHRINK_NOT_SUPPORTED;
+    else if (   GET_MAJOR_HEADER_VERSION(&pImage->Header) == 0
+             || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
         rc = VERR_NOT_SUPPORTED;
     else if (cbSize > getImageDiskSize(&pImage->Header))
Index: /trunk/src/VBox/Storage/VHD.cpp
===================================================================
--- /trunk/src/VBox/Storage/VHD.cpp	(revision 76153)
+++ /trunk/src/VBox/Storage/VHD.cpp	(revision 76154)
@@ -2546,6 +2546,7 @@
 
     /* Making the image smaller is not supported at the moment. */
-    if (   cbSize < pImage->cbSize
-        || pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
+    if (cbSize < pImage->cbSize)
+        rc = VERR_VD_SHRINK_NOT_SUPPORTED;
+    else if (pImage->uImageFlags & VD_IMAGE_FLAGS_FIXED)
         rc = VERR_NOT_SUPPORTED;
     else if (cbSize > pImage->cbSize)
