@@ -197,30 +197,38 @@ public struct ContainerManager: Sendable {
197197 }
198198
199199 /// Create a new manager with the provided kernel, initfs mount, image store
200- /// and optional network implementation.
200+ /// and optional network implementation. This will use a Virtualization.framework
201+ /// backed VMM implicitly.
201202 public init (
202203 kernel: Kernel ,
203204 initfs: Mount ,
204205 imageStore: ImageStore ,
205- network: Network ? = nil
206+ network: Network ? = nil ,
207+ rosetta: Bool = false ,
208+ nestedVirtualization: Bool = false
206209 ) throws {
207210 self . imageStore = imageStore
208211 self . network = network
209212 try Self . createRootDirectory ( path: self . imageStore. path)
210213 self . vmm = VZVirtualMachineManager (
211214 kernel: kernel,
212215 initialFilesystem: initfs,
213- bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( )
216+ bootlog: imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( ) ,
217+ rosetta: rosetta,
218+ nestedVirtualization: nestedVirtualization
214219 )
215220 }
216221
217222 /// Create a new manager with the provided kernel, initfs mount, root state
218- /// directory and optional network implementation.
223+ /// directory and optional network implementation. This will use a Virtualization.framework
224+ /// backed VMM implicitly.
219225 public init (
220226 kernel: Kernel ,
221227 initfs: Mount ,
222228 root: URL ? = nil ,
223- network: Network ? = nil
229+ network: Network ? = nil ,
230+ rosetta: Bool = false ,
231+ nestedVirtualization: Bool = false
224232 ) throws {
225233 if let root {
226234 self . imageStore = try ImageStore ( path: root)
@@ -232,17 +240,22 @@ public struct ContainerManager: Sendable {
232240 self . vmm = VZVirtualMachineManager (
233241 kernel: kernel,
234242 initialFilesystem: initfs,
235- bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( )
243+ bootlog: imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( ) ,
244+ rosetta: rosetta,
245+ nestedVirtualization: nestedVirtualization
236246 )
237247 }
238248
239249 /// Create a new manager with the provided kernel, initfs reference, image store
240- /// and optional network implementation.
250+ /// and optional network implementation. This will use a Virtualization.framework
251+ /// backed VMM implicitly.
241252 public init (
242253 kernel: Kernel ,
243254 initfsReference: String ,
244255 imageStore: ImageStore ,
245- network: Network ? = nil
256+ network: Network ? = nil ,
257+ rosetta: Bool = false ,
258+ nestedVirtualization: Bool = false
246259 ) async throws {
247260 self . imageStore = imageStore
248261 self . network = network
@@ -269,16 +282,21 @@ public struct ContainerManager: Sendable {
269282 self . vmm = VZVirtualMachineManager (
270283 kernel: kernel,
271284 initialFilesystem: initfs,
272- bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( )
285+ bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( ) ,
286+ rosetta: rosetta,
287+ nestedVirtualization: nestedVirtualization
273288 )
274289 }
275290
276291 /// Create a new manager with the provided kernel and image reference for the initfs.
292+ /// This will use a Virtualization.framework backed VMM implicitly.
277293 public init (
278294 kernel: Kernel ,
279295 initfsReference: String ,
280296 root: URL ? = nil ,
281- network: Network ? = nil
297+ network: Network ? = nil ,
298+ rosetta: Bool = false ,
299+ nestedVirtualization: Bool = false
282300 ) async throws {
283301 if let root {
284302 self . imageStore = try ImageStore ( path: root)
@@ -309,7 +327,9 @@ public struct ContainerManager: Sendable {
309327 self . vmm = VZVirtualMachineManager (
310328 kernel: kernel,
311329 initialFilesystem: initfs,
312- bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( )
330+ bootlog: self . imageStore. path. appendingPathComponent ( " bootlog.log " ) . absolutePath ( ) ,
331+ rosetta: rosetta,
332+ nestedVirtualization: nestedVirtualization
313333 )
314334 }
315335
0 commit comments