-
Notifications
You must be signed in to change notification settings - Fork 45
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
Software installed with user-script isn't available after boot #53
Comments
Hi @damacus ! Could you attach your script so I can see what it is doing? |
Hey! thanks for the response: Here's the script: # Install homebrew
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | sudo bash
# Install chef-client
curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current -P chef
command -v chef
command -v brew
chef --version |
Ah ha! The issue here is that the install script runs in the context of the host computer, not the target box. The commands you are running are installing homebrew and chef on the host computer, not into the box. The location of the box file system is provided as the first argument to the user script. But you still need to figure out how to tell the homebrew and chef installers to install to a non-running system, which they may not support. If you review the Homebrew site you can find manual installation instructions. If you adapt those in your user script, with all of the paths prefixed with “${1}/“, that might work better. I can try to put together a Homebrew example later this week if that would help. See #24 in the meantime for an example user-script that uses ${1}. |
@damacus I looked at the content of the install.sh script for Homebrew. I don't know how to replicate the part of the install.sh script that installs the command-line developer tools in a macinbox user script, but here is how I think you would install Homebrew, at least: #!/bin/sh
cd "${1}/usr/local"
mkdir Homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C Homebrew
ln -sf /usr/local/Homebrew/bin/brew "${1}/usr/local/bin/brew" You would still need to run I think the best use of a user script is to copy new files to the box and modify existing files. Executing installers is not really going to work, unless you can tell the installers which system volume to target. I have been searching for a good automated way to install Xcode or the command-line tools into a vagrant box for a very long time, and the best I've come up with is to install For your use case, you might want to consider putting the Homebrew and Chef installation into a vagrant provisioning step. That way the commands will run in the context of the box instead of the host. If your provider supports it (VMware and VirtualBox do, I think) you could then use the |
Ah! I thought the script would be copied to the box and run. My mistake when reading the docs! Yep, back to Vagrant package to get this one done. Thanks for your time! I'll report back if parallels works with this. VritualBox was being weirdly buggy with MacOS |
Hey!
thanks for creating this, it's been pretty awesome so far.
I'm using:
I'm checking the software is available using
command -v brew
and it succeeds. However, when doing a vagrant up of the machine, brew isn't actually on the machine 🤔The text was updated successfully, but these errors were encountered: