Index: /trunk/src/VBox/Storage/RAW.cpp
===================================================================
--- /trunk/src/VBox/Storage/RAW.cpp	(revision 58257)
+++ /trunk/src/VBox/Storage/RAW.cpp	(revision 58258)
@@ -639,8 +639,19 @@
     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
 
+    /* For sequential access do not allow to go back. */
+    if (   pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL
+        && uOffset < pImage->offAccess)
+    {
+        *pcbActuallyRead = 0;
+        return VERR_INVALID_PARAMETER;
+    }
+
     rc = vdIfIoIntFileReadUser(pImage->pIfIo, pImage->pStorage, uOffset,
                                pIoCtx, cbRead);
     if (RT_SUCCESS(rc))
+    {
         *pcbActuallyRead = cbRead;
+        pImage->offAccess = uOffset + cbRead;
+    }
 
     return rc;
@@ -655,4 +666,14 @@
     PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
 
+    /* For sequential access do not allow to go back. */
+    if (   pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL
+        && uOffset < pImage->offAccess)
+    {
+        *pcbWriteProcess = 0;
+        *pcbPostRead = 0;
+        *pcbPreRead  = 0;
+        return VERR_INVALID_PARAMETER;
+    }
+
     rc = vdIfIoIntFileWriteUser(pImage->pIfIo, pImage->pStorage, uOffset,
                                 pIoCtx, cbWrite, NULL, NULL);
@@ -662,4 +683,5 @@
         *pcbPostRead = 0;
         *pcbPreRead  = 0;
+        pImage->offAccess = uOffset + cbWrite;
     }
 
