Comments (5)
Hi @damacus ! Could you attach your script so I can see what it is doing?
from macinbox.
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
from macinbox.
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}.
from macinbox.
@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 brew update --force
in the box after booting it to complete the installation.
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 Xcode.app
onto the host computer and then ditto
it into the box using a user script.
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 vagrant package
command to repackage the running machine into a new box.
from macinbox.
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
from macinbox.
Related Issues (20)
- VMware Tools not installed properly in Catalina box HOT 10
- The link to the Catalina installer said that it didn't exist in the App Store. HOT 1
- Virtualbox 6.1.3 fails to boot Catalina 10.15.2 HOT 14
- 'invalid byte sequence in US-ASCII' HOT 5
- Box created with Parallels Desktop 15.1.2 fails to boot HOT 2
- ENOENT errors when creating files HOT 9
- Catalina 10.15.4 issue - machine fails to boot with startup error HOT 2
- /vagrant doesn't exist, read-only? HOT 7
- Allow to specify VRAM amount HOT 2
- Allow to set box version HOT 4
- the vm(format .pvm) created using macinbox boot more slowly than created using parallels HOT 2
- Any way to get sound working in VirtualBox VM? HOT 2
- virtualbox: Mojave box does not boot on 2020 Macbook HOT 6
- Name VHD/VDMK files based on name of box HOT 2
- Compatibility with Big Sur HOT 13
- Catalina installer download: Update not found
- Catalina: /usr/sbin/diskutil failed with non-zero exit code: 1 HOT 3
- Install Xcode HOT 1
- Shrinking the virtual disk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macinbox.