Disk corruption on ARM64 (Apple Silicon) Linux VMs
Host environment
-
Operating system: macOS Sonoma 14.1.1
-
OS/kernel version: Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
-
Architecture: ARM / arm64 / aarch64
-
QEMU flavor: Bundled with UTM
-
QEMU version: 7.2.0
-
QEMU command line: -->
/Applications/UTM.app/Contents/XPCServices/QEMUHelper.xpc/Contents/MacOS/QEMULauncher.app/Contents/MacOS/QEMULauncher /Applications/UTM.app/Contents/Frameworks/qemu-aarch64-softmmu.framework/Versions/A/qemu-aarch64-softmmu -L /Applications/UTM.app/Contents/Resources/qemu -S -spice unix=on,addr=6162BDCB-6E6E-47BA-B9B0-E9B41C61AD1A.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=off -chardev spiceport,id=org.qemu.monitor.qmp,name=org.qemu.monitor.qmp.0 -mon chardev=org.qemu.monitor.qmp,mode=control -nodefaults -vga none -device virtio-net-pci,mac=FE:5E:2F:E6:3D:25,netdev=net0 -netdev vmnet-shared,id=net0 -device virtio-ramfb -cpu host -smp cpus=8,sockets=1,cores=8,threads=1 -machine virt -accel hvf -drive if=pflash,format=raw,unit=0,file.filename=/Applications/UTM.app/Contents/Resources/qemu/edk2-aarch64-code.fd,file.locking=off,readonly=on -drive if=pflash,unit=1,file=/Users/wd/Library/Containers/com.utmapp.UTM/Data/Documents/Ubuntu 22.04 BTRFS.utm/Data/efi_vars.fd -m 4096 -audiodev spice,id=audio0 -device intel-hda -device hda-duplex,audiodev=audio0 -device nec-usb-xhci,id=usb-bus -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device qemu-xhci,id=usb-controller-0 -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device virtio-blk-pci,drive=driveBD46A898-BDA7-4650-8E50-FCE8658C5E2C,bootindex=0 -drive if=none,media=disk,id=driveBD46A898-BDA7-4650-8E50-FCE8658C5E2C,file=/Users/wd/Library/Containers/com.utmapp.UTM/Data/Documents/Ubuntu 22.04 BTRFS.utm/Data/BD46A898-BDA7-4650-8E50-FCE8658C5E2C.qcow2,discard=unmap,detect-zeroes=unmap -device virtio-serial -device virtserialport,chardev=org.qemu.guest_agent,name=org.qemu.guest_agent.0 -chardev spiceport,id=org.qemu.guest_agent,name=org.qemu.guest_agent.0 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -name Ubuntu 2204 BTRFS -uuid 6162BDCB-6E6E-47BA-B9B0-E9B41C61AD1A -device virtio-rng-pci
## Emulated/Virtualized environment
- Operating system: Linux (any flavor). In this particular case, Ubuntu 22.04 with HWE kernel
- OS/kernel version: <!-- For POSIX guests, use `uname -a`. -->
- Architecture: arm / arm64/ aarch64
## Description of problem
aarch64 Linux VMs will encounter disk corruption if they're set up with a filesystem that will notice it when it happens, e.g. BTRFS. This seems to be across the board with products, including Apple Hypervisor Framework, or just QEMU, so it very well might be an aarch64 Linux bug.
## Steps to reproduce
1. Install an aarch64 Linux VM using BTRFS as the root filesystem. ZFS might recognize silent corruption readily as well.
2. Run `stress-ng --iomix 4`
3. Check your `dmesg` and/or `btrfs check --force <device>` to check for filesystem corruption.
## Additional information
This is discussed in two other tickets, but I'm hoping to get more attention to the problem here.
[https://github.com/lima-vm/lima/issues/1957](https://github.com/lima-vm/lima/issues/1957)
[](https://github.com/utmapp/UTM/issues/4840)
![Screenshot_2023-11-22_at_10.20.23_AM](/uploads/ae8ed51c7adb59933c4f7f9673dddd3d/Screenshot_2023-11-22_at_10.20.23_AM.png)
![Screenshot_2023-11-22_at_10.20.23_AM](https://i.imgur.com/HwqrFQE.png)
I can't seem to figure out how to upload images, but you can probably get to the image that I'm trying to share somehow...
<!--
The line below ensures that proper tags are added to the issue.
Please do not remove it.
-->