Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeDarwinImage: allow not starting the macOS VM automatically #24

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

Luflosi
Copy link
Contributor

@Luflosi Luflosi commented Feb 27, 2024

On my laptop I want to just start the VM when I need it to conserve battery.

On my laptop I want to just start the VM when I need it to conserve battery.
@MatthewCroughan
Copy link
Owner

MatthewCroughan commented Feb 27, 2024

Maybe we can do it on VNC connection via TCP 5900 instead, like how CUPS does it. So the VM will only boot when TCP connections come in, or SSH on TCP 2222 https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/printing/cupsd.nix#L155-L163

@Luflosi Luflosi marked this pull request as draft February 27, 2024 15:49
@Luflosi
Copy link
Contributor Author

Luflosi commented Feb 27, 2024

That would be awesome but I don't think it's currently possible.
Socket activation works by making systemd listen on some socket and when it detects an incoming connection, systemd starts the corresponding service and passes the opened file descriptor to it. But QEMU does not seem to support using socket activation for VNC or hostfwd. I found -add-fd fd=fd,set=set[,opaque=opaque] which seemed promising but in the end I didn't manage to get anything working as I don't know how to pass something like /dev/fdset/2 to the vnc option. See Luflosi@1637090 for my latest attempt.

@Luflosi Luflosi marked this pull request as ready for review February 27, 2024 17:19
@MatthewCroughan MatthewCroughan merged commit b384ebc into MatthewCroughan:master Mar 6, 2024
2 checks passed
@Luflosi Luflosi deleted the disable-auto-start branch March 6, 2024 22:27
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.

2 participants