From 837aa5eb8324054e2592a48cb5c88bd2fd37998c Mon Sep 17 00:00:00 2001 From: jwhur <57657645+JaewonHur@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:36:10 -0800 Subject: [PATCH] Fix the FS error when using Virtualization (#1041) - Fixes #614. - Use VZ cached mode instead of auto. Signed-off-by: jwhur --- Sources/ContainerResource/Container/Filesystem.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/ContainerResource/Container/Filesystem.swift b/Sources/ContainerResource/Container/Filesystem.swift index cd4e1905..7522a515 100644 --- a/Sources/ContainerResource/Container/Filesystem.swift +++ b/Sources/ContainerResource/Container/Filesystem.swift @@ -84,9 +84,13 @@ public struct Filesystem: Sendable, Codable { self.options = options } + // Defaulting to CachedMode = .on (i.e., cached mode) to fix Linux FS issue when using Virtualization + // * https://github.com/apple/container/issues/614 + // * https://github.com/utmapp/UTM/pull/5919 + /// A block based filesystem. public static func block( - format: String, source: String, destination: String, options: MountOptions, cache: CacheMode = .auto, + format: String, source: String, destination: String, options: MountOptions, cache: CacheMode = .on, sync: SyncMode = .fsync ) -> Filesystem { .init( @@ -100,7 +104,7 @@ public struct Filesystem: Sendable, Codable { /// A named volume filesystem. public static func volume( name: String, format: String, source: String, destination: String, options: MountOptions, - cache: CacheMode = .auto, sync: SyncMode = .fsync + cache: CacheMode = .on, sync: SyncMode = .fsync ) -> Filesystem { .init( type: .volume(name: name, format: format, cache: cache, sync: sync),