Skip to content

macOS: option to open VM windows as tabs of the main window - #7859

Open
LayerTM wants to merge 1 commit into
utmapp:mainfrom
LayerTM:feature/vm-windows-as-tabs
Open

LayerTM wants to merge 1 commit into
utmapp:mainfrom
LayerTM:feature/vm-windows-as-tabs

Conversation

@LayerTM

@LayerTM LayerTM commented Sep 11, 2026

Copy link
Copy Markdown

Addresses #3812.

Many people run one or two VMs and would rather keep the VM screen inside UTM's main window than manage a separate window for each VM. macOS already provides this through native window tabbing, but UTM turns tabbing off app-wide (NSWindow.allowsAutomaticWindowTabbing = false in ContentView).

This adds a setting, Settings → Application → "Open virtual machine windows as tabs of the main window", off by default, so nothing changes for anyone who does not enable it.

When it is on:

  • a VM window opened from the library, or through AppleScript / utmctl start, is attached as a tab of the library window (addTabbedWindow(_:ordered:)), since both paths go through UTMData.run(vm:);
  • automatic window tabbing is no longer disabled at launch (read at launch, so this part takes effect after a relaunch);
  • if the library window is closed, the VM window opens on its own as it does today.

Changes are limited to three files: Platform/Shared/ContentView.swift (one line), Platform/macOS/SettingsView.swift (the toggle), Platform/macOS/UTMDataExtension.swift (the attach step).

Tested on macOS 26 (Apple silicon) with an unsigned build of this branch and a QEMU VM (aarch64, display on):

  • start from the library → the VM screen opens as a tab of the main window;
  • utmctl start <vm> with UTM already open → same, no separate window;
  • three starts in total (library button, AppleScript/utmctl twice), no crashes.

With the setting off, the attach step returns before doing anything and allowsAutomaticWindowTabbing is set to false exactly as before (read from the code; not separately exercised).

The new string is not localized yet.

Adds an "Open virtual machine windows as tabs of the main window" setting (off by default). When it is on, a VM window opened from the library or through scripting is attached as a tab of the library window instead of opening as a separate window, and automatic window tabbing is no longer disabled at launch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant