Opened 6 years ago
Last modified 6 years ago
#18991 new defect
QCOW2: Compressed images
Reported by: | laenion | Owned by: | |
---|---|---|---|
Component: | virtual disk | Version: | VirtualBox 6.0.12 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | other |
Description
Adding a compressed QCOW2 image as a hard disk to VirtualBox will work, but actually reading from the disk will fail silently.
Expected behavior
If the QCOW2 image is using an unsupported feature, my expectation would have been that I get a corresponding information.
How to reproduce:
- Download any QCOW2 image from http://download.opensuse.org/tumbleweed/appliances/ (all of them seem to be using compression)
- Use this image as a boot disk for a virtual machine
- "FATAL: No bootable medium found! System halted."
- When using / viewing the image as a secondary disk it will show up as an empty disk filled with zeros.
- Writing to the disk (e.g. using
cfdisk
) will correctly prompt
- Writing to the disk (e.g. using
The I/O cache encountered an error while updating data in medium "ahci-0-2" (rc=VERR_NOT_SUPPORTED). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards.
Change History (2)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
The error is not ignored as you experienced when trying to write to a disk, it just is returned at an inconvenient time. The issue with the QCOW2 format is that compression is on a cluster level, with the flag indicating whether a cluster is compressed being stored in the last level of the two level cluster table (mapping virtual disk addresses to real file offsets). There is no flag in the QCOW2 header to indicate that the disk contains compressed clusters so the backend would have to traverse all entries of the cluster table to verify that there are no compressed clusters present. This can induce a lot of I/O for a huge image because the default cluster size for QCOW2 is 64K which would result in an unnecessary delay trying to open such images. The only "proper" solution to this I'm seeing currently is to implement actual support for compressed clusters but that is on hold due to the lack of man power and no demand from paying customers.
The error is correctly returned in https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Storage/QCOW.cpp#L887, but seems to be ignored.