UPDATE: this has been made slightly more official by way of turning it into a repo: https://github.com/sax/vagrant-smartos-packager
Notes:
- This will create files on the local disk
- You'll probably want to create and cd into a working directory before doing any of this
- This is very much a work in progress. This gist is to capture lots of tiny changes in code, without managing the horrible git history that would ensue in a real git repo. Once this works to completion, it's going into a github repo.
On local machine, download the latest SmartOS platform image and turn it into a virtualbox image:
curl -k https://gist.githubusercontent.com/sax/9138190/raw/mksmartvm | bash -s
When that spins up, set the network configuration and zone information as the defaults. When the prompt asks to create a root password, set it to vagrant
.
Now log in as root, and run the following:
curl -k https://gist.githubusercontent.com/sax/9138190/raw/prepare_global_zone
This will install a service that allows you to create and manage users in the global zone, with info persisted in /usbkey
. See the SmartOS wiki for more info.
Reboot the zone to ensure that the services added in the last step are loaded.
Now create a vagrant user:
curl -k https://gist.githubusercontent.com/sax/9138190/raw/prepare_gz_users
The vagrant user will be created with password vagrant
, root privileges (Primary Administrator) and a small profile with sudo
aliased to pfexec
.
Now shut down the VM using a graceful shutdown signal.
At this point you can package up the VM into a vagrant box.
vagrant package --base SmartOS-20140221T042147Z --output SmartOS-20140221T042147Z.box
vagrant box add SmartOS-20140221T042147Z SmartOS-20140221T042147Z.box
@bixu yeah. My understanding is that the host (OS X in this case) creates the share, then the guest (SmartOS GZ) mounts that share. Not sure why it needs to update /etc/exports.
There's also this: hashicorp/vagrant#2560, though my brain is running on empty. Need to get more sleep before diving deep into this.
Hmmmmmm this would be a great place to plug in autofs, if it works in the global zone and if I can hook it into vagrant.