cirruslabs / tart

macOS and Linux VMs on Apple Silicon to use in CI and other automations
https://tart.run
Other
3.76k stars 106 forks source link

Fix the filesystem corruption on Linux VMs #675

Closed amalchuk closed 9 months ago

amalchuk commented 9 months ago

Working on Linux virtual machine for a long-time causes to disk corruption:

bash: /usr/bin/ls: Input/output error

Same issues in another projects:

These changes:

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.

edigaryev commented 9 months ago

Hello Andrew 👋 Thanks for spotting the issue and providing a fix!

I've looked at the links you've provided, and it seems that the lima project got this fixed by just forcing the cached mode for the VirtIO disk.

It also looks like the NVMe device is actually slower than the VirtIO device, and glancing at the 172-page spec of NVM Express it should be more complex too (compare this to 16-pages of the VirtIO specification for block devices).

What do you think about skipping the NVMe part for now?

amalchuk commented 9 months ago

I think it's not just enough. The primary point of view is that virtio device is shutting down too, even with a disabled cache and full sync set:

What about the decreased performance of NVMe, I think we should choose stability over speed. For now, Linux VMs are always corrupting on the macOS 14 Sonoma hosts.

wpiekutowski commented 8 months ago

From my testing, and other users of UTM, .cached + virtio are stable and no corruption happens. No need to slow things down by additionally enabling NVMe. NVMe is mostly useful if you don't want to use .cached.