[SOLVED] Guest @ raw partition, host i/o cache forced anyway

Discussions related to using VirtualBox on Linux hosts.
Post Reply
roklebor
Posts: 2
Joined: 11. Jul 2014, 17:51

[SOLVED] Guest @ raw partition, host i/o cache forced anyway

Post by roklebor »

Hi,

I have a setup:
Host: Linux CentOS 6.5 32bit with kernel 2.6.32
Guest: Windows XP residing on a raw NTFS partition.

The raw partition is described this way in a vmdk file:

Code: Select all

# Extent description
RW 24 FLAT "ho106Win-pt.vmdk" 0
RW 1606480 ZERO
RW 803248 ZERO
RW 272623048 ZERO
RW 37543905 FLAT "/dev/disk/by-id/ata-TOSHIBA_MK1646GSX_38UTFDGCS" 275032800
RW 5103 ZERO
Everything works, but (when running on 2.6.32 kernel) I am forced to use host i/o cache, which I don't want to be used.
In the log file, this is shown:

Code: Select all

00:00:01.281281 Guest OS type: 'WindowsXP'
00:00:01.354605 File system of '/appStorage/VBox/apsHo106/Snapshots' (snapshots) is unknown
00:00:01.354645 File system of '/appStorage/VBox/apsHo106/ho106Win.vmdk' is ext4
Well, it is true that the tiny file "ho106Win-pt.vmdk" does reside on a ext4 partition, but the Guest OS itself does not, as it has a separate NTFS raw partition. Is it truly necessary to force the host i/o cache even just for accessing this tiny file holding first 24 sectors of an emulated harddisk? I believe that it is never written by nor VB nor the Guest OS.

I even tried copying this tiny 12KB file to another partition (formatted as FAT16) and editing it's reference in vmdk file, to point it to the copied file:

Code: Select all

RW 24 FLAT "/boot/vBox/ho106Win-pt.vmdk" 0
But VirtualBox seems to ignore the path component of this reference and only takes into account the file name, and look for it in the default storage directory for virtual machine definition files (Log contains exactly the same error including the path "/appStorage/VBox/apsHo106/ho106Win.vmdk", i.e ignoring my supplied full path to the file).

Is there a way to suppress activiation of host i/o cache (on my responsibility)?
Last edited by roklebor on 12. Jul 2014, 01:07, edited 1 time in total.
roklebor
Posts: 2
Joined: 11. Jul 2014, 17:51

Re: Guest @ raw partition, host i/o cache forced anyway.

Post by roklebor »

Oh !

Got it !

Not the 12 KB file containing first 24 sectors of an emulated hard disk, but the vmdk itselft must reside on a partition of type other than ext4 (say FAT, it is acceptable for VirtualBox). So moving this file elsewhere (to a FAT partition), and creating a symlink does the trick !

Code: Select all

root@aps:/appStorage/VBox/apsHo106 # l
total 52
drwx------ 2 root root  4096  14-07-11 19:45:32  Logs/
-rw------- 1 root root 15512  14-07-11 19:45:55  apsHo106.vbox
-rw------- 1 root root 15512  14-07-11 17:47:24  apsHo106.vbox-prev
-rwxr-xr-x 1 root root 12288  13-12-16 07:20:40  ho106Win-pt.vmdk
-rw------- 1 root root   781  14-07-11 19:43:23  ho106Win.vmdk
root@aps:/appStorage/VBox/apsHo106 # mv ho106Win.vmdk /boot/vBox/
root@aps:/appStorage/VBox/apsHo106 # ln -s /boot/vBox/ho106Win.vmdk 
root@aps:/appStorage/VBox/apsHo106 # l
total 48
drwx------ 2 root root  4096  14-07-11 19:45:32  Logs/
-rw------- 1 root root 15512  14-07-11 19:45:55  apsHo106.vbox
-rw------- 1 root root 15512  14-07-11 17:47:24  apsHo106.vbox-prev
-rwxr-xr-x 1 root root 12288  13-12-16 07:20:40  ho106Win-pt.vmdk
lrwxrwxrwx 1 root root    24  14-07-12 00:40:03  ho106Win.vmdk -> /boot/vBox/ho106Win.vmdk
And Voilá ! Everything works smoothly and no more warning about host i/o cache forced to ON.

I suggest this to be fixed in next releases. There is no reason to reproach the user if he does not store the Guest OS in an image file residing on an affected partition type, but in a separate raw partition. The vmdk itself truly should not restrict the user from turning host i/o cache off as it should only be read at start of a virtual machine and the ext4/xfs kernel bug therefore should not endanger a VM running from a raw partition imho.

Hope I am right and no data corruption will occur. Until now it runs smoothly (~1/2 hour).
Post Reply