What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Put the virtual machine code in the native macOS host app and let Flutter control it through a platform channel. Apple’s Virtualization framework is native macOS functionality, so Dart cannot run VM operations directly. Flutter’s job is the interface: starting and stopping VMs, showing their status, and handling errors. Only if the guest’s screen has to sit inside your Flutter layout do you also need a native platform view, and that option has documented limits on macOS that are covered below.

What Virtualization.framework gives you

Apple describes Virtualization as a set of high-level APIs for creating and managing virtual machines on Apple silicon and Intel-based Mac computers. It runs macOS and Linux-based guests. You describe a guest with a VZVirtualMachineConfiguration and attach platform and device objects to it. To show the guest’s graphical output, Apple provides VZVirtualMachineView, a native view that displays and interacts with guest content.

The framework is only available to native code. Your Flutter app is a client of a native VM service, which means the Swift or Objective-C side of the app carries most of the risk: configuration errors, entitlement problems, and failed installs all surface there first.

Recommended architecture: a native service behind a channel

Flutter’s macOS platform-channel guide, Writing custom platform-specific code, shows how to add native code to MainFlutterWindow.swift. Its example creates a FlutterMethodChannel connected to the Flutter engine’s binary messenger. Build your VM logic as a small native service that the channel handler calls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create a native service class that owns the VM configuration, the install and boot steps, the current state (stopped, installing, starting, running, stopping, error), and the last error message.
  2. Register one channel in MainFlutterWindow.swift. Use a clear name such as vm/control so Dart and Swift agree on it.
  3. Expose explicit operations, for example createVM, installVM, startVM, stopVM, and getState. Return structured results, not free-form strings, so Dart can branch on them.
  4. Push state changes to Dart as well as answering requests. A VM that moves from installing to running on its own needs a way to tell the UI, and polling is the simplest fallback.
  5. Treat every call as asynchronous on the Dart side. Flutter’s channel messages are asynchronous and the guide notes platform-thread requirements, so do not write UI code that assumes a VM operation returns immediately.

A minimal Swift skeleton for the channel looks like this. The method names are placeholders for your own service:

import Cocoa
import FlutterMacOS

class MainFlutterWindow: NSWindow {
  override func awakeFromNib() {
    let flutterViewController = FlutterViewController()
    let windowFrame = self.frame
    self.contentViewController = flutterViewController
    self.setFrame(windowFrame, display: true)

    let channel = FlutterMethodChannel(
      name: "vm/control",
      binaryMessenger: flutterViewController.engine.binaryMessenger)

    channel.setMethodCallHandler { call, result in
      switch call.method {
      case "getState":
        result("stopped")
      case "startVM":
        // Forward to the native VM service; report errors as FlutterError.
        result(nil)
      default:
        result(FlutterMethodNotImplemented)
      }
    }

    RegisterGeneratedPlugins(registry: flutterViewController)
    super.awakeFromNib()
  }
}

Showing the guest display: two integration options

The most consequential decision is whether the guest screen must live inside your Flutter layout. There are two practical options.

Factor Channel control with a separate native VM window Channel control with an AppKit platform view
Best fit Apps that need lifecycle controls and status, with the guest display in its own window Apps that need the guest display inside a Flutter screen, panel, or split layout
Mouse and trackpad input Handled by the native window and Apple’s view Gesture support is not yet available on macOS, according to Flutter’s platform-view guide
Flutter layout features Not applicable; the window sits outside the Flutter layout Transforms, clips, and opacity can be applied from Dart, but overlays and clipping need testing against your Flutter version
Native complexity Lower: one native window and one channel Higher: the native view’s lifecycle must match Flutter’s view composition
macOS support status Standard native window, no platform-view caveat Flutter’s guide says macOS platform-view support is not fully functional

For most tools that run a VM for development or testing, a separate native window is the lower-risk choice. An in-layout display is reasonable when interactive input is not essential, or when you can accept the documented gesture gap. Flutter’s Hosting native macOS views in your Flutter app with Platform Views guide says that on macOS the native NSView is appended to the view hierarchy through hybrid composition. Its introductory sentence describes the goal: “Platform views allow you to embed native views in a Flutter app, so you can apply transforms, clips, and opacity to the native view from Dart.” That capability is real, but the same guide says the macOS implementation is incomplete, so verify the exact behavior in the Flutter version you ship.

Guest setup: macOS and Linux follow different paths

Both guest types use the same configuration object, but the platform and boot objects differ. Plan them separately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

macOS guests on Apple silicon

Apple’s guide, Virtualize macOS on a Mac, describes the components needed for a bootable macOS VM:

  • VZMacPlatformConfiguration, which describes the Mac platform for the guest
  • A compatible restore image, which your app must obtain and validate before installation
  • VZMacOSInstaller, which installs macOS into the guest’s disk
  • Auxiliary storage, which the guest needs for its platform state
  • A macOS boot loader, which starts the installed guest

Expect installation to be the longest step. Your state machine should show progress and allow cancellation, and it should handle a failed or interrupted install by returning the VM to a state from which the user can retry.

Linux guests

For a Linux guest, Apple’s framework documentation describes a VZVirtualMachineConfiguration with a VZLinuxBootLoader that points to a kernel image. The configuration also adds devices such as sound and keyboard configurations. A Linux guest has no macOS restore step, so your create-and-boot path is shorter, but you must supply and manage the kernel and any initial ramdisk your guest needs.

Entitlements, sandboxing, and signing

Treat the entitlement as part of the build, not a final formality. Apple identifies com.apple.security.virtualization as a Boolean entitlement required to use the framework. Confirm its current requirements in Apple’s entitlement and virtualization documentation for the OS version and distribution route you target.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Flutter’s macOS apps are sandboxed by default. Its guide, Building macOS apps with Flutter, says capabilities are managed in the Runner entitlement files. Release builds can behave differently from debug and profile builds, so check the virtualization entitlement in the signed release build, not only in a debug run. Distribution outside the Mac App Store requires notarization and the Hardened Runtime.

  • Confirm the entitlement is present in the Runner entitlement file used by your release configuration.
  • Sign the app and run it outside Xcode’s debugger before you judge whether VM creation works.
  • Notarize builds intended for outside distribution and test the notarized app on a clean user account.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure points to check first

  • VM creation fails only in release builds: compare the entitlements between debug and release configurations. The sandboxed release app is the one users will run.
  • Dart calls stall or appear to hang: a call that starts a long VM operation should return early with a state update. Keep the install and boot work off Flutter’s assumption of an immediate reply.
  • Guest input does not work in an embedded view: this is the documented macOS platform-view gap. Move the display to a native window or verify gesture behavior in your target Flutter version.
  • macOS install never starts: check that the restore image is compatible with the host and that the platform configuration matches it.

Verify against current versions before shipping

Apple’s framework overview was captured by the search index roughly three months before this article was prepared, so confirm current framework availability on the Apple developer site before you commit to a minimum macOS version. Flutter’s platform-channel guide, as last updated on 2026-08-24, was written for Flutter 3.47.2, and its macOS building guide, last updated 2026-09-14, was written for Flutter 3.47. Newer Flutter releases may change the platform-view behavior described here, so test the embedded display path on the exact Flutter version you ship.

No published performance figures were found for VM startup time or resource use under these configurations. Measure those on your own hardware and guest images rather than relying on general estimates.

A Mac is the required host for this framework. Apple documents Virtualization.framework for Mac computers, and the framework’s requirements for specific chips, memory, or macOS versions are set by Apple’s current documentation rather than by this article.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the checklist below as a final pass before you ship:

  • The native VM service owns all configuration, installation, and state changes.
  • The Dart side only sends commands and renders state received over the channel.
  • The display path (separate window or platform view) is chosen and tested on the target Flutter version.
  • The virtualization entitlement is verified in a signed, notarized release build.
  • Macos and Linux guest setup paths each have their own install and boot tests.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.