timsutton / osx-vm-templates

macOS templates for Packer and VeeWee.
MIT License
1.12k stars 248 forks source link

Enable ARDAgent via prepare_iso.sh #29

Closed danieljimenez closed 9 years ago

danieljimenez commented 9 years ago

Not sure if it's possible, but it would be great if ARD could be turned on similar to screen sharing when building the new DMG.

The command I run after OS X boot is:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers

Alternatively enabling just regular screen sharing would work too, but RDP is better.

timsutton commented 9 years ago

I could see doing this. I'd like to know if this can be done easily in the initial install process, to minimize anything that has to run on the first boot. Since ARD has its own system of privileges, etc. it might be less trivial.

In my environment (where we deploy OS X client systems) we restrict ARD access to our maintenance (admin) user. It would probably make sense to do the same here, to give access to the user that's passed to the create script.

danieljimenez commented 9 years ago

+1 to only enabling for the passed in user. I know you can create a pkg file using the Remote Desktop app, not sure how to get that installed with prepare_iso.sh though.

asimpletune commented 9 years ago

+1 for this, although I don't know if it needs to be handled when building the new install dmg. It's possible it could be taken care of at the configuration level, by setting the appropriate calls for launchd.

timsutton commented 9 years ago

An initial attempt I made recently is up here, if anyone would like to test:

https://github.com/timsutton/osx-vm-templates/tree/enable-ard

It seems incomplete because the GUI doesn't seem to fully reflect the status. If it works across at least the most current OS versions then I'd be happy using this method - otherwise the alternative is to add an additional script that calls the kickstart script.

danieljimenez commented 9 years ago

Worked like a charm here!

timsutton commented 9 years ago

Thanks for confirming. This may be a work-in-progress if people who want it have issues, but it's now merged.