# Install and use macOS

macOS installs in a machine from Apple's newest restore image for your Mac, or from an IPSW file you already have.

## Install macOS

1. Choose **File > New Machine**.
2. Select **macOS from Apple**, then click **Continue**.
3. Enter a name, then a **Password** and **Verify** for the account.
4. Check **Language & Region**, which starts with your Mac's settings, and **Resources**. Then click **Create**.
5. Start the machine when creation finishes.

For macOS 27 or later, creation starts the machine once to set up the account and the guest agent. The account then signs in by itself. If the machine shows a locked screen, which macOS doesn't report, run `osmates vm sign-in mac --locked`.

To create a British English machine with a Dvorak keyboard in Terminal, with the password in `$PASSWORD`:

```sh
printf '%s\n' "$PASSWORD" | osmates vm create mac --image macos --password-stdin \
    --language en-US,en-GB --region GB --time-zone Europe/London --keyboard Dvorak
osmates vm start mac
```

Add `--ipsw` with the path of a restore image you have, and `--remote-login` to turn on Remote Login. To bring a machine from another app, see [Move a machine from another app](https://osmates.com/docs/import-machine#move-macos-from-another-app).

## Install an older macOS

Before macOS 27, you finish Setup Assistant and install the guest agent yourself.

1. Choose **File > New Machine**, select **macOS from an IPSW File**, then click **Continue**.
2. Choose the restore image, then click **Create**.
3. Start the machine and finish Setup Assistant.
4. In the guest, open `/Volumes/My Shared Files` and install `OSMates Agent.pkg`.

macOS 12 doesn't mount that folder. Copy `OSMates Agent.pkg` from `OSMates.app/Contents/Resources/MacGuestTools` into the guest instead, such as with AirDrop.

## Run two macOS machines at once

Apple allows two running macOS machines, counting every app on your Mac. A stopped machine with an open window doesn't count. A third start [waits or is refused](https://osmates.com/docs/power#start-a-machine).

## Let agents read the controls

1. In the machine, choose **Apple menu > System Settings**, then click **Privacy & Security** in the sidebar.
2. Click **Device Control and Data Access**, or **Accessibility** before macOS 27.
3. Turn on **OSMates Agent**.

Clones keep this permission, and AI agents can't turn it on for you.

## Use iCloud

Sign in to your Apple Account yourself, in the machine. iCloud works in machines installed from macOS 15 or later.

You sign in again when the machine gets a new identity:

- You clone it, or copy it to another Mac.
- You start it on another Mac from a [drive you can unplug](https://osmates.com/docs/volumes#move-a-machine).
- A second copy starts while one runs.

A machine starts only on a Mac that supports its hardware model.

A clone that [keeps the machine identifier](https://osmates.com/docs/macos-xcode#keep-the-machine-identifier) is a copy, so only one of them runs at a time. Apple explains its [iCloud rules for macOS machines](https://developer.apple.com/documentation/virtualization/using-icloud-with-macos-virtual-machines).

## Update macOS inside a machine

1. Start the machine.
2. Select it in the library, then choose **Machine > Update macOS**.
3. Check the update, then click **Update**. If you see a password field, enter the account's password.

OSMates first saves a `Before macOS <version>` snapshot, and installs nothing without it. The install takes 30 minutes or more. In Terminal, save the password with `osmates vm password mac`, then run `osmates vm update-macos mac`.

To undo the update, revert to that snapshot. To stay there, turn off automatic updates in the machine. If the screen stays black, see [macOS machine breaks after an update](https://osmates.com/docs/known-issues#macos-machine-breaks-after-an-update).

While Software Update offers an update, OSMates also saves the machine every 6 hours on the first day, then daily. A new major version installs only from System Settings in the machine.
