Apple’s open-source `container` project has documented a machine mode for developers who need a persistent Linux environment on a Mac rather than a short-lived container organized around one application. The tool uses lightweight virtual machines, is written in Swift and is optimized for Apple silicon.
A container machine can be created from a standard Open Container Initiative image, allowing teams to build and share its starting environment through familiar image workflows. Unlike an application container that normally starts a single process, the machine boots the image’s `/sbin/init`. That permits long-running services and applications managed by a Linux process supervisor.
The host integration is designed to make the boundary less intrusive during everyday development. A machine maps the macOS user name and home directory into Linux automatically, giving both systems access to repositories and configuration files. Developers can continue editing with macOS tools while compiling or running the project inside the Linux environment. The home mount can be configured for read-write access, read-only access or no sharing, depending on the desired isolation.
The main `container machine run` command starts a stopped machine when necessary and then either executes a command or opens an interactive shell. The Linux account matches the host account by default. A user can designate one machine as the default to avoid repeatedly passing its name, and the longer `machine` command also has the shorter `m` alias.
Configuration changes are stored on disk and apply after the next stop-and-start cycle. Memory is initially set to half of the Mac’s host memory, though it can be adjusted. The documentation also describes nested virtualization, subject to host and guest requirements, which could support development tasks that themselves depend on virtualization.
Any Linux image containing an init system can serve as a base. Apple’s example builds an Ubuntu 24.04 image with systemd and common command-line tools. On first boot, a built-in setup script normally provisions the mapped user. Image authors can replace that behavior with an executable script at `/etc/machine/create-user.sh`, which runs once as root with relevant variables supplied to it.
The feature sits between conventional containers and a manually managed general-purpose virtual machine. Its persistence and init support favor complete development environments, while OCI packaging and automatic host sharing reduce setup work. The supplied documentation does not provide performance benchmarks or compare isolation guarantees with other Mac virtualization products, so those questions require separate testing. Compatibility will also depend on the Linux image, init system and host resources, details teams should validate against their own development workloads.
![Steve Jobs and Macintosh computer, January 1984, by Bernard Gotfryd. The image on the computer screen is 髪梳ける女 (A Woman Combing Her Hair) [ media ], by Hashiguchi Goyo (d. 1921).…](/media/articles/commons-0b9f87c8f97c.avif)

