Index: /trunk/include/iprt/err.h
===================================================================
--- /trunk/include/iprt/err.h	(revision 54969)
+++ /trunk/include/iprt/err.h	(revision 54970)
@@ -1017,20 +1017,23 @@
 /** Not all requests could be submitted due to resource shortage. */
 #define VERR_FILE_AIO_INSUFFICIENT_RESSOURCES (-137)
+/** There are not enough events available on the host to create the I/O context.
+ * This exact meaning is host platform dependent. */
+#define VERR_FILE_AIO_INSUFFICIENT_EVENTS   (-138)
 /** Device or resource is busy. */
-#define VERR_RESOURCE_BUSY                  (-138)
+#define VERR_RESOURCE_BUSY                  (-139)
 /** A file operation was attempted on a non-file object. */
-#define VERR_NOT_A_FILE                     (-139)
+#define VERR_NOT_A_FILE                     (-140)
 /** A non-file operation was attempted on a file object. */
-#define VERR_IS_A_FILE                      (-140)
+#define VERR_IS_A_FILE                      (-141)
 /** Unexpected filesystem object type. */
-#define VERR_UNEXPECTED_FS_OBJ_TYPE         (-141)
+#define VERR_UNEXPECTED_FS_OBJ_TYPE         (-142)
 /** A path does not start with a root specification. */
-#define VERR_PATH_DOES_NOT_START_WITH_ROOT  (-142)
+#define VERR_PATH_DOES_NOT_START_WITH_ROOT  (-143)
 /** A path is relative, expected an absolute path. */
-#define VERR_PATH_IS_RELATIVE               (-143)
+#define VERR_PATH_IS_RELATIVE               (-144)
 /** A path is not relative (start with root), expected an relative path. */
-#define VERR_PATH_IS_NOT_RELATIVE           (-144)
+#define VERR_PATH_IS_NOT_RELATIVE           (-145)
 /** Zero length path. */
-#define VERR_PATH_ZERO_LENGTH               (-145)
+#define VERR_PATH_ZERO_LENGTH               (-146)
 /** @} */
 
Index: /trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp	(revision 54969)
+++ /trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp	(revision 54970)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -231,5 +231,10 @@
     int rc = syscall(__NR_io_setup, cEvents, pAioContext);
     if (RT_UNLIKELY(rc == -1))
-        return RTErrConvertFromErrno(errno);
+    {
+        if (errno == EAGAIN)
+            return VERR_FILE_AIO_INSUFFICIENT_EVENTS;
+        else
+            return RTErrConvertFromErrno(errno);
+    }
 
     return VINF_SUCCESS;
Index: /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 54969)
+++ /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 54970)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2013 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -590,22 +590,4 @@
 }
 
-/**
- * Get the size of the given file.
- * Works for block devices too.
- *
- * @returns VBox status code.
- * @param   hFile    The file handle.
- * @param   pcbSize  Where to store the size of the file on success.
- */
-static int pdmacFileEpNativeGetSize(RTFILE hFile, uint64_t *pcbSize)
-{
-    uint64_t cbFile;
-    int rc = RTFileGetSize(hFile, &cbFile);
-    if (RT_SUCCESS(rc))
-        *pcbSize = cbFile;
-
-    return rc;
-}
-
 #ifdef VBOX_WITH_DEBUGGER
 
@@ -964,5 +946,5 @@
             uint64_t cbSize;
 
-            rc = pdmacFileEpNativeGetSize(hFile, &cbSize);
+            rc = RTFileGetSize(hFile, &cbSize);
 
             if (RT_SUCCESS(rc) && ((cbSize % 512) == 0))
@@ -1022,5 +1004,5 @@
         pEpFile->fFlags = fFileFlags;
 
-        rc = pdmacFileEpNativeGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
+        rc = RTFileGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
         if (RT_SUCCESS(rc))
         {
@@ -1084,4 +1066,24 @@
                         }
                     }
+                }
+                else if (rc == VERR_FILE_AIO_INSUFFICIENT_EVENTS)
+                {
+                    PUVM pUVM = VMR3GetUVM(pEpClassFile->Core.pVM);
+#if defined(RT_OS_LINUX)
+                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
+                                      N_("Failed to create I/O manager for VM due to insufficient resources on the host. "
+                                         "Either increase the amount of allowed events in /proc/sys/fs/aio-max-nr or enable "
+                                         "the host I/O cache"));
+#else
+                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
+                                      N_("Failed to create I/O manager for VM due to insufficient resources on the host. "
+                                         "Enable the host I/O cache"));
+#endif
+                }
+                else
+                {
+                    PUVM pUVM = VMR3GetUVM(pEpClassFile->Core.pVM);
+                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
+                                      N_("Failed to create I/O manager for VM due to an unknown error"));
                 }
             }
Index: /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp	(revision 54969)
+++ /trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp	(revision 54970)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2013 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -33,5 +33,5 @@
 #define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD   1000
 /** Maximum number of requests a manager will handle. */
-#define PDMACEPFILEMGR_REQS_STEP            512
+#define PDMACEPFILEMGR_REQS_STEP              64
 
 
