Container machines are a new feature of the open-source Containerization framework and container CLI tool that provides a persistent, lightweight Linux environment running in its own VM on macOS, with automatic user mapping, shared filesystem, and seamless macOS integration. Unlike ephemeral containers, a container machine retains state between sessions and feels like a native extension of the Mac.
โข Cross-platform development without context switching: your username, working directory, and files are automatically mirrored from macOS into the Linux environment, so you can edit in Xcode and build/run on Linux in the same terminal session.
โข Persistent, project-scoped environments: each container machine retains installed toolchains and dependencies across stops and restarts, eliminating conflicting dependency headaches between projects.
โข Fast VM-backed isolation: sub-second start times with full VM-level security make container machines lightweight enough for everyday dev workflows, not just CI pipelines.
Shows the shell commands and Swift Package Manager workflow for compiling and running a Vapor server inside a container machine, demonstrating the automatic filesystem sharing and network access pattern described in the session.
import Foundation
// MARK: - Container Machine Workflow (Swift scripting / shell integration)
// This demonstrates how to drive the `container` CLI from Swift using Process,
// mirroring the workflow shown in the WWDC session.
func runShellCommand(_ args: [String]) throws -> String {
let process = Process()
process.executableURL = URL(fileURLWithPath: "/usr/bin/env")
process.arguments = args
let pipe = Pipe()
process.standardOutput = pipe
process.standardError = pipe
try process.run()
process.waitUntilExit()
let data = pipe.fileHandleForReading.readDataToEndOfFile()
return String(decoding: data, as: UTF8.self).trimmingCharacters(in: .whitespacesAndNewlines)
}
// 1. Create a container machine named "dev" using the alpine OCI image
do {
let createOutput = try runShellCommand([
"container", "machine", "create",
"--name", "dev",
"--default", // set as the default machine
"alpine" // any OCI-compatible image
])
print("Created machine:\n\(createOutput)")
} catch {
print("Create error: \(error)")
}
// 2. List all container machines (name, IP, resource info)
do {
let listOutput = try runShellCommand(["container", "machine", "list"])
print("Machines:\n\(listOutput)")
} catch {
print("List error: \(error)")
}
// 3. Run a one-shot command โ automatic user + cwd mirroring means
// whoami and pwd return the same values as on the Mac host.
do {
let whoami = try runShellCommand(["container", "machine", "run", "whoami"])
print("Linux whoami: \(whoami)") // e.g. "michael"
let uname = try runShellCommand(["container", "machine", "run", "uname"])
print("Linux uname: \(uname)") // "Linux"
} catch {
print("Run error: \(error)")
}
// 4. Build & run a Swift server package inside the machine.
// Because the Mac filesystem is automatically shared, no file copying needed.
do {
// swift build runs against the project in the shared working directory
let build = try runShellCommand([
"container", "machine", "run",
"swift", "build", "-c", "release"
])
print("Build output:\n\(build)")
// Vapor must bind to the machine's IP so Safari on the Mac can reach it
// The IP was captured from `container machine list` above
let serve = try runShellCommand([
"container", "machine", "run",
".build/release/App", "--hostname", "192.168.64.5", "--port", "8080"
])
print("Server: \(serve)")
} catch {
print("Build/run error: \(error)")
}iOS 27 adds sectioned queries, codable model attributes, ResultsObserver for non-SwiftUI change observation, and HistoryObserver for reacting to persistent history changes in SwiftData.
USDKit is a new first-party Swift framework introduced in iOS/macOS 27 that brings native USD scene creation, composition, modification, and export capabilities to Apple platform apps, with deep RealityKit and Spatial Preview integration.
LiveCommunicationKit is the modern replacement for CXProvider that delivers rich, native conversation UIs integrated with the Lock Screen, Dynamic Island, Phone app Recents, and Siri. It provides a unified lifecycle model for audio and video conversations with a single delegate-driven action pipeline.
Container machine is a CLI/framework feature, not a Swift API you call from an app target. The Containerization framework is open source (not a private Apple SDK), so you integrate it as a Swift package. Networking is isolated by default โ you must bind your server to the container machine's IP (not localhost) for the Mac host to reach it. The container tool must be installed separately from GitHub releases.
macOS on Apple Silicon or Intel Mac; requires the container tool downloaded from GitHub; no iOS/iPadOS support โ this is a macOS developer tooling feature only
The NowPlaying framework introduces a first-class Swift API for surfacing app media in system-wide now-playing surfaces โ Lock Screen, Control Center, Dynamic Island, StandBy, CarPlay, Apple Watch, and Apple TV โ via a declarative MediaSessionRepresentable protocol. It also supports remote media sessions (for controlling external speakers/TVs) and Media Sharing Extensions for routing media to third-party devices.