Skip to content

vdm/vagrant-smartos-packager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vagrant-smartos-packager

Create Vagrant boxes of the latest SmartOS platform image.

This repository includes scripts to help create SmartOS Vagrant boxes. The box created will be a Vagrant-capable global zone, into which local zones can be installed with a TBD vagrant plugin for managing local zones.

Dependencies

  • VirtualBox

Usage

Download the latest SmartOS platform image and turn it into a VirtualBox VM.

./bin/mksmartvm

When the VM spins up in VirtualBox, use the default networking options. Set the root password to be vagrant.

Now log in via ssh:

ssh localhost -p 2222 -l root

Creating barebones global zone

curl -k https://raw.github.com/sax/vagrant-smartos-packager/master/bin/prepare_global_zone \
 | bash -s

This will install custom services that will load on boot, updating the image to ensure that users will persist between reboots. By default, everything except /usbkey and /zones and /opt/custom will reset between boots, so we have to do some tweaking.

Now run the following:

curl -k https://raw.github.com/sax/vagrant-smartos-packager/master/bin/prepare_gz_users \
 | bash -s

This will create a vagrant user. By default Vagrant expects the vagrant user and root to have the password set to vagrant.

Creating global zone with image imported

If you are creating a box with an image already imported, instead of the above instructions you can jump straight to:

curl -k https://raw.github.com/sax/vagrant-smartos-packager/master/bin/prepare_for_lz \
  | bash -s [image_uuid]

Installing sudo

If sudo will be required in the global zone, run the following command:

curl -k https://raw.github.com/sax/vagrant-smartos-packager/master/bin/install_sudo \
 | bash -s

Creating box

Now stop the VM, and run the following command to load it into Vagrant:

./bin/boxify

Vagrant configurations

synced folders

The SmartOS global zone mounts / as a ramdisk with a size of 262M. When using type rsync, to sync the local directory into the global zone, ensure that it is very lightweight.

In order to use 'rsync' with a larger directory, you'll need to disable the normal mountpoint and create a new one on a persisted disk.

config.vm.synced_folder ".", "/zones/vagrant", type: "rsync"
config.vm.synced_folder ".", "/vagrant", disabled: true

Synced folders of type nfs will work, pending a pull request on Vagrant.

Contributing

When making a pull request, make sure to /cc @sax in the description. Otherwise I don't seem to get notified.

About

Create vagrant boxes of SmartOS global zones

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%