<?oxy_comment_start author="Mhari Duncan" timestamp="20241210T152506+0000" comment="kespenla: This is not a true "known issue", it is documenting that sluggish I/O on the host can cause I/O timeouts in the VM which may have usability problems. This is quite old (but stll true) information. Likely not as frequently seen as when this was originally written 15+ years ago."?>Guest Shows IDE/SATA Errors for File-Based Images on Slow Host File System<?oxy_comment_end?>

Occasionally, some host file systems provide very poor writing performance and as a consequence cause the guest to time out IDE/SATA commands. This is normal behavior and should normally cause no real problems, as the guest should repeat commands that have timed out. However, guests such as some Linux versions have severe problems if a write to an image file takes longer than about 15 seconds. Some file systems however require more than a minute to complete a single write, if the host cache contains a large amount of data that needs to be written.

The symptom for this problem is that the guest can no longer access its files during large write or copying operations, usually leading to an immediate hang of the guest.

In order to work around this problem, the true fix is to use a faster file system that does not exhibit such unacceptable write performance, it is possible to flush the image file after a certain amount of data has been written. This interval is normally infinite, but can be configured individually for each disk of a VM.

For IDE disks use the following command:

VBoxManage setextradata VM-name
"VBoxInternal/Devices/piix3ide/0/LUN#[x]/Config/FlushInterval" [b]

For SATA disks use the following command:

VBoxManage setextradata VM-name
"VBoxInternal/Devices/ahci/0/LUN#[x]/Config/FlushInterval" [b]

[x] specifies the disk. For IDE, 0 represents device 0 on the primary channel, 1 represents device 1 on the primary channel, 2 represents device 0 on the secondary channel, and 3 represents device 1 on the secondary channel. For SATA, use values between 0 and 29. This configuration option applies to disks only. Do not use this option for CD or DVD drives.

The unit of the interval ([b]) is the number of bytes written since the last flush. The value for it must be selected so that the occasional long write delays do not occur. Since the proper flush interval depends on the performance of the host and the host filesystem, finding the optimal value that makes the problem disappear requires some experimentation. Values between 1000000 and 10000000 (1 to 10 megabytes) are a good starting point. Decreasing the interval both decreases the probability of the problem and the write performance of the guest. Setting the value unnecessarily low will cost performance without providing any benefits. An interval of 1 will cause a flush for each write operation and should solve the problem in any case, but has a severe write performance penalty.

Providing a value of 0 for [b] is treated as an infinite flush interval, effectively disabling this workaround. Removing the extra data key by specifying no value for [b] has the same effect.