bacongravy / macinbox

Puts macOS in a Vagrant box
Other
662 stars 45 forks source link

sample user-script.sh #31

Closed egandro closed 2 years ago

k-matoski commented 5 years ago

Can you tell how is the user script transferred to the box or this something that I need to do from within the user script?

egandro commented 5 years ago

--user-script PATH Path to user script

k-matoski commented 5 years ago

But I was asking whether the provided user script is copied to the box and run on the box. I was thinking of using this option to install Xcode Developer Tools on the box before it is packaged.

bacongravy commented 5 years ago

Hi @k-matoski, thank you for the question. The user script is not transferred to the box. The user script is run, in-place, on the host computer, not in the box guest VM. The first argument passed to the user script is the path to the mounted volume that will be used to generate the box.

The easiest way to accomplish what you're suggesting is to write a user script which simply copies "/Applications/Xcode.app" (from the host computer) to "$1/Applications/Xcode.app".

Another way to accomplish what you're suggesting would be to add a provisioning step to the Vagrantfile you use to boot your box. The provisioning step runs on the booted guest VM. A simple way to get the Xcode CLI tools installed on a box is to install Homebrew as part of a provisioning step. That's the method I usually use.

egandro commented 5 years ago

I do XCode installation in the Vagrantfile.

The script is only required for additional white listing Kext's

wrljet commented 2 years ago

I do XCode installation in the Vagrantfile.

Is this possible with no GUI, as it normally pops up to ask permission and to accept the license agreement?

egandro commented 2 years ago

This is outdated. Please use other tooling.