Skip to content

Comments

Support macOS guests#4595

Open
AkihiroSuda wants to merge 1 commit intolima-vm:masterfrom
AkihiroSuda:macos-guest
Open

Support macOS guests#4595
AkihiroSuda wants to merge 1 commit intolima-vm:masterfrom
AkihiroSuda:macos-guest

Conversation

@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Feb 16, 2026

Usage:

limactl create --video template:macos
limactl start macos
limactl shell macos

The password prompt is shown during creating an instance, so as to run chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/..., which is required for the lima-macos-init launch daemon to run.

The password for GUI login is randomly generated and stored in /Users/${USER}.guest/password in the VM.

Fix #3618

TODOs (in follow-up PRs):

  • Docs
  • Switch back the default shell to zsh
  • Graceful limactl stop (currently it has to be stopped from the guest)
  • Propagate additional cloud-init data
    • Hostname
    • Timezone
    • DNS
    • CA Certificates
  • Support non-plain mode
    • mounts
    • port forwards
  • Let limactl sudoers generate the entry for chowning files
    (chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/...)
  • Support headless mode (--video=false)
  • Support macOS in hack/update-template.sh

Depends on:

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the energy to do a proper review today, but here are some things I noticed. Only the "boot" thing is a problem.

Another suggestion: maybe add a helper for inst.Config.OS != nil && *inst.Config.OS == limatype.DARWIN because that is used a lot. On second thought, is the nil check necessary? Because FillDefault guarantees that it isn't nil. We don't do nil checks for other fields in the driver code (or shouldn't have to).

@jandubois
Copy link
Member

On second thought, is the nil check necessary?

I've wondered before why we use pointers for so many of the fields in LimaYAML.

For some, especially booleans, we want to be able to distinguish if the value was specified as the null value (i.e. false, 0, ""), or not provided at all. But for many values the null value is not a valid choice, so e.g. the OS could just be OS instead of *OS.

Or am I missing something?

@AkihiroSuda
Copy link
Member Author

On second thought, is the nil check necessary? Because FillDefault guarantees that it isn't nil. We don't do nil checks for other fields in the driver code (or shouldn't have to).

Removed the nil check

I've wondered before why we use pointers for so many of the fields in LimaYAML.

Probably we wanted to treat all the types in the consistent manner.
That may help simplifying FillDefault with reflection in future?

@AkihiroSuda AkihiroSuda force-pushed the macos-guest branch 7 times, most recently from 1dd42f7 to 6a73da2 Compare February 20, 2026 14:19
@AkihiroSuda
Copy link
Member Author

@jandubois

This comment was marked as off-topic.

Usage:
```
limactl create --video template:macos
limactl start macos
limactl shell macos
```

The password prompt is shown during creating an instance,
so as to run `chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/...`,
which is required for the `lima-macos-init` launch daemon to run.

The password for GUI login is randomly generated and
stored in `/Users/${USER}.guest/password` in the VM.

Fix issue 3618

TODOs (maybe in follow-up PRs):
- [X] Docs
- [X] Switch back the default shell to `zsh`
- [ ] Graceful `limactl stop` (currently it has to be stopped from the guest)
- [ ] Propagate additional cloud-init data
  - [X] Hostname
  - [X] Timezone
  - [X] DNS
  - [ ] CA Certificates
- [ ] Support non-plain mode
  - [ ] mounts
  - [ ] port forwards
- [ ] Let `limactl sudoers` generate the entry for chowning files
  (`chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/...`)
- [ ] Support headless mode (`--video=false`)
- [ ] Support macOS in `hack/update-template.sh`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VM drivers for supporting macOS guests (vz, host-user)

2 participants