├── .gitignore ├── README.md ├── builds ├── virtualbox │ └── .gitignore └── vmware │ └── .gitignore ├── omnios-r151010j.json ├── scripts ├── omnios │ ├── Omni.flp │ ├── eventhook │ └── postinstall.sh └── solaris │ ├── postinstall.sh │ └── vmtools.sh ├── solaris10.json ├── solaris11.json └── solaris11_2.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.iso 2 | *.box 3 | packer_cache 4 | packer.log 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Solaris packer files 2 | ============== 3 | 4 | Files used to build Solaris Base Box for use with vagrant 5 | 6 | See Blogpost http://www.resilvered.com/2014/02/solaris-vagrant-packer-and-base-box.html 7 | 8 | Requires 9 | ------- 10 | - Vargrant (1.5.1) 11 | - Packer (0.6.0) 12 | - Solaris 11_1 text installer 13 | - Solaris 11_2 text installer 14 | - Solaris 10 Update 11 DVD image 15 | 16 | To use these files 17 | ============= 18 | 19 | git clone git://github.com/BigAl/solaris-packer 20 | packer build -only=virtualbox-iso solaris11.json 21 | packer build -only=vmware-iso solaris11.json 22 | 23 | *Tested on Virtualbox 4.3.14* -------------------------------------------------------------------------------- /builds/virtualbox/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /builds/vmware/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /omnios-r151010j.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "boot_command": [ 5 | "", 6 | "1", 7 | "", 8 | "", 9 | "", 10 | "", 11 | "omnios-vagrant", 12 | "", 13 | "", 14 | "", 15 | "", 16 | "", 17 | "", 18 | "", 19 | "", 20 | "", 21 | "", 22 | "", 23 | "", 24 | "", 25 | "", 26 | "", 27 | "root", 28 | "passwd", 29 | "vagrant", 30 | "vagrant", 31 | "svcadm disable ssh", 32 | "ipadm create-if e1000g0", 33 | "ipadm create-addr -T dhcp e1000g0/v4", 34 | "useradd -m -k /etc/skel/ -b /export/home -s /usr/bin/bash vagrant", 35 | "passwd vagrant", 36 | "vagrant", 37 | "vagrant", 38 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 39 | "svcadm enable ssh" 40 | ], 41 | "boot_wait": "30s", 42 | "disk_size": 8192, 43 | "guest_os_type": "OpenSolaris_64", 44 | "iso_checksum": "bc3f4c0d29a5da75174de62da00294e5ef826b5e", 45 | "iso_checksum_type": "sha1", 46 | "iso_url": "http://omnios.omniti.com/media/OmniOS_Text_r151010j.iso", 47 | "output_directory": "packer-omnios-r151008j-virtualbox", 48 | "shutdown_command": "sudo /usr/sbin/init 5", 49 | "ssh_password": "vagrant", 50 | "ssh_port": 22, 51 | "ssh_username": "vagrant", 52 | "type": "virtualbox-iso", 53 | "vboxmanage": [ 54 | [ 55 | "modifyvm", 56 | "{{.Name}}", 57 | "--memory", 58 | "1024" 59 | ], 60 | [ 61 | "modifyvm", 62 | "{{.Name}}", 63 | "--cpus", 64 | "1" 65 | ] 66 | ], 67 | "virtualbox_version_file": ".vbox_version", 68 | "vm_name": "packer-omnios-r151010j" 69 | }, 70 | { 71 | "boot_command": [ 72 | "", 73 | "1", 74 | "", 75 | "", 76 | "", 77 | "", 78 | "", 79 | "", 80 | "omnios-vagrant", 81 | "", 82 | "", 83 | "", 84 | "", 85 | "", 86 | "", 87 | "", 88 | "", 89 | "", 90 | "", 91 | "", 92 | "", 93 | "", 94 | "", 95 | "", 96 | "root", 97 | "passwd", 98 | "vagrant", 99 | "vagrant", 100 | "svcadm disable ssh", 101 | "ipadm create-if e1000g0", 102 | "ipadm create-addr -T dhcp e1000g0/v4", 103 | "useradd -m -k /etc/skel/ -b /export/home -s /usr/bin/bash vagrant", 104 | "passwd vagrant", 105 | "vagrant", 106 | "vagrant", 107 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 108 | "svcadm enable ssh" 109 | ], 110 | "boot_wait": "30s", 111 | "disk_size": 8192, 112 | "floppy_files": [ 113 | "./scripts/omnios/Omni.flp" 114 | ], 115 | "guest_os_type": "solaris11-64", 116 | "iso_checksum": "bc3f4c0d29a5da75174de62da00294e5ef826b5e", 117 | "iso_checksum_type": "sha1", 118 | "iso_url": "http://omnios.omniti.com/media/OmniOS_Text_r151010j.iso", 119 | "output_directory": "packer-omnios-r151010j-vmware", 120 | "shutdown_command": "sudo /usr/sbin/init 5", 121 | "ssh_password": "vagrant", 122 | "ssh_port": 22, 123 | "ssh_username": "vagrant", 124 | "tools_upload_flavor": "solaris", 125 | "type": "vmware-iso", 126 | "vm_name": "packer-omnios-r151010j", 127 | "vmx_data": { 128 | "cpuid.coresPerSocket": "1", 129 | "memsize": "1024", 130 | "numvcpus": "1" 131 | } 132 | } 133 | ], 134 | "post-processors": [ 135 | { 136 | "compression_level": 9, 137 | "output": "./builds/{{.Provider}}/omnios-r151010j.box", 138 | "type": "vagrant" 139 | } 140 | ], 141 | "provisioners": [ 142 | { 143 | "type": "file", 144 | "source": "./scripts/omnios/eventhook", 145 | "destination": "/tmp/eventhook" 146 | }, 147 | { 148 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", 149 | "scripts": [ 150 | "scripts/solaris/vmtools.sh", 151 | "scripts/omnios/postinstall.sh" 152 | ], 153 | "type": "shell" 154 | } 155 | ] 156 | } 157 | -------------------------------------------------------------------------------- /scripts/omnios/Omni.flp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BigAl/solaris-packer/4179df87b4ef19ab498e15675f57d7e497163f32/scripts/omnios/Omni.flp -------------------------------------------------------------------------------- /scripts/omnios/eventhook: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | # 3 | 4 | PATH=/sbin:/usr/sbin:/usr/bin 5 | LOG=/var/log/dhcp-eventhook.log 6 | INTERFACE=$1 7 | ACTION=$2 8 | eventhook_comment="# Added by /etc/dhcp/eventhook" 9 | 10 | echo "`date`:$@" >> $LOG 11 | 12 | if [ "$ACTION" == "BOUND" -o "$ACTION" == "EXTEND" ]; then 13 | 14 | echo $eventhook_comment >> /tmp/resolv.conf.$$ 15 | domain=`dhcpinfo -i $INTERFACE DNSdmain` 16 | echo "DNS domain : $domain" >> $LOG 17 | if [ ! -z "$domain" ]; then 18 | echo "domain $domain" >> /tmp/resolv.conf.$$ 19 | fi 20 | dnsserv=`dhcpinfo -i $INTERFACE DNSserv` 21 | echo "DNS servers : $dnsserv">> $LOG 22 | if [ ! -z "$dnsserv" ]; then 23 | echo "nameserver $dnsserv" >> /tmp/resolv.conf.$$ 24 | fi 25 | mv /tmp/resolv.conf.$$ /etc/resolv.conf 26 | chmod 644 /etc/resolv.conf 27 | cp /etc/nsswitch.dns /etc/nsswitch.conf 28 | 29 | nis_domainname=`dhcpinfo -i $INTERFACE NISdmain` 30 | 31 | [ -z "$nis_domainname" ] && exit 0 32 | 33 | echo $nis_domainname > /etc/defaultdomain 34 | svcadm restart svc:/system/identity:domain 35 | 36 | # Temporarily enable NIS 37 | svcadm enable -t svc:/network/nis/client:default 38 | svcadm enable -t svc:/network/dns/client:default 39 | svcadm restart svc:/system/name-service-cache:default 40 | 41 | elif [ "$ACTION" == "DROP" -o "$ACTION" == "RELEASE" ]; then 42 | rm /etc/resolv.conf 43 | if [ -r /etc/resolv.conf-pre-eventhook ]; then 44 | echo "Restoring pre-eventhook resolv.conf" >> $LOG 45 | mv /etc/resolv.conf-pre-eventhook /etc/resolv.conf 46 | fi 47 | rm -f /var/yp/binding/$dh_domainname/ypservers 48 | rm -f /etc/defaultdomain 49 | svcadm restart svc:/system/identity:domain 50 | svcadm disable svc:/network/dns/client:default 51 | svcadm disable svc:/network/nis/client:default 52 | cp /etc/nsswitch.files /etc/nsswitch.conf 53 | # Avoid the pesky caching of previous stuff 54 | rm /etc/dhcp/${INTERFACE}.dhc 55 | fi 56 | -------------------------------------------------------------------------------- /scripts/omnios/postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Since onmiOS dhcp client seems to be a bit incomplete we need to setup DNS 4 | echo "Setting up DNS to work" 5 | mv /tmp/eventhook /etc/dhcp/eventhook 6 | chmod 755 /etc/dhcp/eventhook 7 | dnsserv=`/sbin/dhcpinfo DNSserv` 8 | echo "nameserver $dnsserv" > /etc/resolv.conf 9 | cp /etc/nsswitch.dns /etc/nsswitch.conf 10 | /usr/sbin/svcadm enable -t svc:/network/dns/client:default 11 | /usr/sbin/svcadm restart svc:/system/name-service-cache:default 12 | 13 | # setup the vagrant key 14 | # you can replace this key-pair with your own generated ssh key-pair 15 | echo "Setting the vagrant ssh pub key" 16 | mkdir /export/home/vagrant/.ssh 17 | chmod 700 /export/home/vagrant/.ssh 18 | chown vagrant:root /export/home/vagrant/.ssh 19 | touch /export/home/vagrant/.ssh/authorized_keys 20 | curl -sL http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub > \ 21 | /export/home/vagrant/.ssh/authorized_keys 22 | chmod 600 /export/home/vagrant/.ssh/authorized_keys 23 | chown vagrant:root /export/home/vagrant/.ssh/authorized_keys 24 | 25 | # formally add omniti-ms publisher 26 | echo "Adding omniti-ms publisher" 27 | pkg set-publisher -g http://pkg.omniti.com/omniti-ms/ ms.omniti.com 28 | 29 | # update grub menu to lower timeout and remove unnecessary second entry 30 | echo "Updating Grub boot menu" 31 | sed -i -e 's/^timeout.*$/timeout 5/' -e "/^title omniosvar/,`wc -l /rpool/boot/grub/menu.lst | awk '{ print $1 }'` d" /rpool/boot/grub/menu.lst 32 | 33 | echo "Clearing log files and zeroing disk, this might take a while" 34 | cp /dev/null /var/adm/messages 35 | cp /dev/null /var/log/syslog 36 | cp /dev/null /var/adm/wtmpx 37 | cp /dev/null /var/adm/utmpx 38 | dd if=/dev/zero of=/EMPTY bs=1024 39 | rm -f /EMPTY 40 | 41 | echo "Post-install done" 42 | -------------------------------------------------------------------------------- /scripts/solaris/postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # setup the vagrant key 4 | # you can replace this key-pair with your own generated ssh key-pair 5 | echo "Setting the vagrant ssh pub key" 6 | mkdir /export/home/vagrant/.ssh 7 | chmod 700 /export/home/vagrant/.ssh 8 | touch /export/home/vagrant/.ssh/authorized_keys 9 | if [ -f /usr/sfw/bin/wget ] ; then 10 | /usr/sfw/bin/wget --no-check-certificate http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub -O /export/home/vagrant/.ssh/authorized_keys 11 | else 12 | /usr/bin/wget --no-check-certificate http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub -O /export/home/vagrant/.ssh/authorized_keys 13 | fi 14 | chmod 600 /export/home/vagrant/.ssh/authorized_keys 15 | chown -R vagrant:staff /export/home/vagrant/.ssh 16 | 17 | echo "Disabling sendmail and asr-norify" 18 | # disable the very annoying sendmail 19 | /usr/sbin/svcadm disable sendmail 20 | /usr/sbin/svcadm disable asr-notify 21 | 22 | echo "Clearing log files and zeroing disk, this might take a while" 23 | cp /dev/null /var/adm/messages 24 | cp /dev/null /var/log/syslog 25 | cp /dev/null /var/adm/wtmpx 26 | cp /dev/null /var/adm/utmpx 27 | dd if=/dev/zero of=/EMPTY bs=1024 28 | rm -f /EMPTY 29 | 30 | echo "Post-install done" 31 | -------------------------------------------------------------------------------- /scripts/solaris/vmtools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $PACKER_BUILDER_TYPE = 'virtualbox-iso' ]; then 4 | echo "Installing VirtualBox Guest Additions" 5 | echo "mail=\ninstance=overwrite\npartial=quit" > /tmp/noask.admin 6 | echo "runlevel=nocheck\nidepend=quit\nrdepend=quit" >> /tmp/noask.admin 7 | echo "space=quit\nsetuid=nocheck\nconflict=nocheck" >> /tmp/noask.admin 8 | echo "action=nocheck\nbasedir=default" >> /tmp/noask.admin 9 | DEV=`/usr/sbin/lofiadm -a /export/home/vagrant/VBoxGuestAdditions.iso` 10 | /usr/sbin/mount -o ro -F hsfs $DEV /mnt 11 | /usr/sbin/pkgadd -a /tmp/noask.admin -G -d /mnt/VBoxSolarisAdditions.pkg all 12 | /usr/sbin/umount /mnt 13 | /usr/sbin/lofiadm -d $DEV 14 | rm -f VBoxGuestAdditions.iso 15 | fi 16 | 17 | if [ $PACKER_BUILDER_TYPE = 'vmware-iso' ]; then 18 | DEV=`/usr/sbin/lofiadm -a /export/home/vagrant/solaris.iso` 19 | mkdir /mnt2 20 | /usr/sbin/mount -o ro -F hsfs $DEV /mnt2 21 | mkdir /tmp/vmfusion-archive 22 | gunzip -c /mnt2/vmware-solaris-tools.tar.gz | (cd /tmp/vmfusion-archive ; tar xvf -) 23 | /tmp/vmfusion-archive/vmware-tools-distrib/vmware-install.pl --default 24 | /usr/sbin/umount /mnt2 25 | /usr/sbin/lofiadm -d $DEV 26 | rm -rf /tmp/vmfusion-archive 27 | rm -f solaris.iso 28 | fi 29 | -------------------------------------------------------------------------------- /solaris10.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "boot_command": [ 5 | "", 6 | "4", 7 | "", 8 | "", 9 | "0", 10 | "", 11 | "", 12 | "", 13 | "x", 14 | "", 15 | "", 16 | "", 17 | "", 18 | "", 19 | "x", 20 | "", 21 | "", 22 | "", 23 | "", 24 | "x", 25 | "", 26 | "x", 27 | "", 28 | "", 29 | "", 30 | "vagrant123", 31 | "vagrant123", 32 | "", 33 | "x", 34 | "", 35 | "x", 36 | "", 37 | "", 38 | "", 39 | "", 40 | "", 41 | "", 42 | "", 43 | "", 44 | "", 45 | "", 46 | "", 47 | "x", 48 | "", 49 | "x", 50 | "", 51 | "", 52 | "", 53 | "", 54 | "", 55 | "", 56 | "x", 57 | "", 58 | "", 59 | "x", 60 | "", 61 | "", 62 | "", 63 | "x", 64 | "", 65 | "", 66 | "", 67 | "", 68 | "", 69 | "", 70 | "", 71 | "", 72 | "", 73 | "x", 74 | "", 75 | "", 76 | "", 77 | "", 78 | "", 79 | "", 80 | "", 81 | "x", 82 | "x", 83 | "", 84 | "", 85 | "", 86 | "x", 87 | "", 88 | "", 89 | "", 90 | "", 91 | "", 92 | "", 93 | "", 94 | "", 95 | "", 96 | "", 97 | "", 98 | "", 99 | "x", 100 | "", 101 | "", 102 | "", 103 | "", 104 | "", 105 | "", 106 | "", 107 | "", 108 | "", 109 | "", 110 | "", 111 | "", 112 | "", 113 | "c", 114 | "c", 115 | "", 116 | "", 117 | "", 118 | "", 119 | "root", 120 | "vagrant123", 121 | "svcadm disable ssh", 122 | "useradd -m -k /etc/skel/ -d /export/home/vagrant -s /usr/bin/bash vagrant", 123 | "passwd vagrant", 124 | "1vagrant", 125 | "1vagrant", 126 | "echo 'Primary Administrator:suser:cmd:::*:uid=0;gid=0' >> /etc/security/exec_attr", 127 | "echo 'Primary Administrator:::Can perform all administrative tasks:auths=solaris.*,solaris.grant;help=RtPriAdmin.html' >> /etc/security/prof_attr", 128 | "usermod -P 'Primary Administrator' vagrant", 129 | "hostname vagrant-solaris", 130 | "hostname > /etc/hostname", 131 | "svcadm enable ssh" 132 | ], 133 | "boot_wait": "5s", 134 | "disk_size": 8192, 135 | "guest_os_type": "OpenSolaris_64", 136 | "iso_checksum": "c27e5fe2531826192f110e2d9f1f5d73015edac6", 137 | "iso_checksum_type": "sha1", 138 | "iso_url": "file:///ISO/Solaris/sol-10-u11-ga-x86-dvd.iso", 139 | "output_directory": "packer-solaris10-virtualbox", 140 | "shutdown_command": "pfexec /usr/sbin/init 5", 141 | "ssh_password": "1vagrant", 142 | "ssh_port": 22, 143 | "ssh_username": "vagrant", 144 | "type": "virtualbox-iso", 145 | "vboxmanage": [ 146 | [ 147 | "modifyvm", 148 | "{{.Name}}", 149 | "--memory", 150 | "1536" 151 | ], 152 | [ 153 | "modifyvm", 154 | "{{.Name}}", 155 | "--cpus", 156 | "1" 157 | ] 158 | ], 159 | "virtualbox_version_file": ".vbox_version", 160 | "vm_name": "packer-solaris-10" 161 | }, 162 | { 163 | "boot_command": [ 164 | "", 165 | "4", 166 | "", 167 | "", 168 | "0", 169 | "", 170 | "", 171 | "", 172 | "x", 173 | "", 174 | "", 175 | "", 176 | "", 177 | "", 178 | "x", 179 | "", 180 | "", 181 | "", 182 | "", 183 | "x", 184 | "", 185 | "x", 186 | "", 187 | "", 188 | "", 189 | "vagrant123", 190 | "vagrant123", 191 | "", 192 | "x", 193 | "", 194 | "x", 195 | "", 196 | "", 197 | "", 198 | "", 199 | "", 200 | "", 201 | "", 202 | "", 203 | "", 204 | "", 205 | "", 206 | "x", 207 | "", 208 | "x", 209 | "", 210 | "", 211 | "", 212 | "", 213 | "", 214 | "", 215 | "x", 216 | "", 217 | "", 218 | "x", 219 | "", 220 | "", 221 | "", 222 | "x", 223 | "", 224 | "", 225 | "", 226 | "", 227 | "", 228 | "", 229 | "", 230 | "", 231 | "", 232 | "x", 233 | "", 234 | "", 235 | "", 236 | "", 237 | "x", 238 | "x", 239 | "", 240 | "", 241 | "", 242 | "x", 243 | "x", 244 | "", 245 | "", 246 | "", 247 | "x", 248 | "", 249 | "", 250 | "", 251 | "", 252 | "", 253 | "", 254 | "", 255 | "", 256 | "", 257 | "", 258 | "", 259 | "", 260 | "x", 261 | "", 262 | "", 263 | "", 264 | "", 265 | "", 266 | "", 267 | "", 268 | "", 269 | "", 270 | "", 271 | "c", 272 | "c", 273 | "", 274 | "", 275 | "", 276 | "", 277 | "root", 278 | "vagrant123", 279 | "svcadm disable ssh", 280 | "useradd -m -k /etc/skel/ -d /export/home/vagrant -s /usr/bin/bash vagrant", 281 | "passwd vagrant", 282 | "1vagrant", 283 | "1vagrant", 284 | "echo 'Primary Administrator:suser:cmd:::*:uid=0;gid=0' >> /etc/security/exec_attr", 285 | "echo 'Primary Administrator:::Can perform all administrative tasks:auths=solaris.*,solaris.grant;help=RtPriAdmin.html' >> /etc/security/prof_attr", 286 | "usermod -P 'Primary Administrator' vagrant", 287 | "hostname vagrant-solaris", 288 | "hostname > /etc/hostname", 289 | "svcadm enable ssh" 290 | ], 291 | "boot_wait": "5s", 292 | "disk_size": 8192, 293 | "guest_os_type": "solaris10-64", 294 | "iso_checksum": "c27e5fe2531826192f110e2d9f1f5d73015edac6", 295 | "iso_checksum_type": "sha1", 296 | "iso_url": "file:///ISO/Solaris/sol-10-u11-ga-x86-dvd.iso", 297 | "output_directory": "packer-solaris10-vmware", 298 | "shutdown_command": "pfexec /usr/sbin/init 5", 299 | "ssh_password": "1vagrant", 300 | "ssh_port": 22, 301 | "ssh_username": "vagrant", 302 | "tools_upload_flavor": "solaris", 303 | "type": "vmware-iso", 304 | "vm_name": "packer-solaris10", 305 | "vmx_data": { 306 | "cpuid.coresPerSocket": "1", 307 | "memsize": "1536", 308 | "numvcpus": "1" 309 | } 310 | } 311 | ], 312 | "post-processors": [ 313 | { 314 | "compression_level": 9, 315 | "output": "./builds/{{.Provider}}/solaris10U11.box", 316 | "type": "vagrant" 317 | } 318 | ], 319 | "provisioners": [ 320 | { 321 | "execute_command": "chmod +x {{ .Path }}; export {{.Vars}} && cat {{.Path}} | pfexec su ", 322 | "scripts": [ 323 | "scripts/solaris/vmtools.sh", 324 | "scripts/solaris/postinstall.sh" 325 | ], 326 | "type": "shell" 327 | } 328 | ] 329 | } 330 | -------------------------------------------------------------------------------- /solaris11.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "boot_command": [ 5 | "27", 6 | "3", 7 | "", 8 | "1", 9 | "", 10 | "", 11 | "", 12 | "", 13 | "-vagrant", 14 | "", 15 | "", 16 | "", 17 | "", 18 | "", 19 | "", 20 | "", 21 | "vagrant123", 22 | "vagrant123", 23 | "vagrant", 24 | "vagrant", 25 | "1vagrant", 26 | "1vagrant", 27 | "", 28 | "", 29 | "", 30 | "", 31 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | "", 37 | "", 38 | "", 39 | "", 40 | "", 41 | "", 42 | "", 43 | "", 44 | "", 45 | "", 46 | "", 47 | "", 48 | "vagrant", 49 | "1vagrant", 50 | "sudo bash", 51 | "1vagrant", 52 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 53 | "/usr/gnu/bin/sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers", 54 | "exit" 55 | ], 56 | "boot_wait": "95s", 57 | "disk_size": 8192, 58 | "guest_os_type": "Solaris11_64", 59 | "iso_checksum": "1d0efbffe1b194959c1a3d3c8b8d801411c54278", 60 | "iso_checksum_type": "sha1", 61 | "iso_url": "file:///ISO/Oracle/sol-11_1-text-x86.iso", 62 | "output_directory": "packer-solaris11-virtualbox", 63 | "shutdown_command": "sudo /usr/sbin/init 5", 64 | "ssh_password": "1vagrant", 65 | "ssh_port": 22, 66 | "ssh_username": "vagrant", 67 | "type": "virtualbox-iso", 68 | "vboxmanage": [ 69 | [ 70 | "modifyvm", 71 | "{{.Name}}", 72 | "--memory", 73 | "1024" 74 | ], 75 | [ 76 | "modifyvm", 77 | "{{.Name}}", 78 | "--cpus", 79 | "1" 80 | ] 81 | ], 82 | "virtualbox_version_file": ".vbox_version", 83 | "vm_name": "packer-solaris-11" 84 | }, 85 | { 86 | "boot_command": [ 87 | "27", 88 | "3", 89 | "", 90 | "1", 91 | "", 92 | "", 93 | "", 94 | "", 95 | "-vagrant", 96 | "", 97 | "", 98 | "", 99 | "", 100 | "", 101 | "", 102 | "", 103 | "vagrant123", 104 | "vagrant123", 105 | "vagrant", 106 | "vagrant", 107 | "1vagrant", 108 | "1vagrant", 109 | "", 110 | "", 111 | "", 112 | "", 113 | "", 114 | "", 115 | "", 116 | "", 117 | "", 118 | "", 119 | "", 120 | "", 121 | "", 122 | "", 123 | "", 124 | "", 125 | "", 126 | "", 127 | "", 128 | "", 129 | "vagrant", 130 | "1vagrant", 131 | "sudo bash", 132 | "1vagrant", 133 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 134 | "/usr/gnu/bin/sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers", 135 | "exit" 136 | ], 137 | "boot_wait": "90s", 138 | "disk_size": 8192, 139 | "guest_os_type": "solaris11-64", 140 | "iso_checksum": "1d0efbffe1b194959c1a3d3c8b8d801411c54278", 141 | "iso_checksum_type": "sha1", 142 | "iso_url": "file:///ISO/Oracle/sol-11_1-text-x86.iso", 143 | "output_directory": "packer-solaris11-vmware", 144 | "shutdown_command": "sudo /usr/sbin/init 5", 145 | "ssh_password": "1vagrant", 146 | "ssh_port": 22, 147 | "ssh_username": "vagrant", 148 | "tools_upload_flavor": "solaris", 149 | "type": "vmware-iso", 150 | "vm_name": "packer-solaris11", 151 | "vmx_data": { 152 | "cpuid.coresPerSocket": "1", 153 | "memsize": "1024", 154 | "numvcpus": "1" 155 | } 156 | } 157 | ], 158 | "post-processors": [ 159 | { 160 | "compression_level": 9, 161 | "output": "./builds/{{.Provider}}/solaris11.box", 162 | "type": "vagrant" 163 | } 164 | ], 165 | "provisioners": [ 166 | { 167 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", 168 | "scripts": [ 169 | "scripts/solaris/vmtools.sh", 170 | "scripts/solaris/postinstall.sh" 171 | ], 172 | "type": "shell" 173 | } 174 | ] 175 | } 176 | -------------------------------------------------------------------------------- /solaris11_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "boot_command": [ 5 | "27", 6 | "3", 7 | "", 8 | "1", 9 | "", 10 | "", 11 | "", 12 | "", 13 | "", 14 | "-vagrant", 15 | "", 16 | "", 17 | "", 18 | "", 19 | "", 20 | "", 21 | "", 22 | "", 23 | "", 24 | "", 25 | "vagrant123", 26 | "vagrant123", 27 | "vagrant", 28 | "vagrant", 29 | "1vagrant", 30 | "1vagrant", 31 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | "", 37 | "", 38 | "", 39 | "", 40 | "", 41 | "", 42 | "", 43 | "", 44 | "", 45 | "", 46 | "", 47 | "", 48 | "", 49 | "", 50 | "vagrant", 51 | "1vagrant", 52 | "sudo bash", 53 | "1vagrant", 54 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 55 | "/usr/gnu/bin/sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers", 56 | "exit" 57 | ], 58 | "boot_wait": "105s", 59 | "disk_size": 8192, 60 | "guest_os_type": "Solaris11_64", 61 | "iso_checksum": "d543fddd2042a61387fb58b38c811a2f83d4e8cba8941ecf1450b343489c8108", 62 | "iso_checksum_type": "sha256", 63 | "iso_url": "file:///ISO/Oracle/sol-11_2-text-x86.iso", 64 | "output_directory": "packer-solaris11_2-virtualbox", 65 | "shutdown_command": "sudo /usr/sbin/init 5", 66 | "ssh_password": "1vagrant", 67 | "ssh_port": 22, 68 | "ssh_username": "vagrant", 69 | "type": "virtualbox-iso", 70 | "vboxmanage": [ 71 | [ 72 | "modifyvm", 73 | "{{.Name}}", 74 | "--memory", 75 | "1536" 76 | ], 77 | [ 78 | "modifyvm", 79 | "{{.Name}}", 80 | "--cpus", 81 | "1" 82 | ] 83 | ], 84 | "virtualbox_version_file": ".vbox_version", 85 | "vm_name": "packer-solaris-11_2" 86 | }, 87 | { 88 | "boot_command": [ 89 | "", 90 | "3", 91 | "", 92 | "1", 93 | "", 94 | "", 95 | "", 96 | "", 97 | "-vagrant", 98 | "", 99 | "", 100 | "", 101 | "", 102 | "", 103 | "", 104 | "", 105 | "", 106 | "", 107 | "", 108 | "vagrant123", 109 | "vagrant123", 110 | "vagrant", 111 | "vagrant", 112 | "1vagrant", 113 | "1vagrant", 114 | "", 115 | "", 116 | "", 117 | "", 118 | "", 119 | "", 120 | "", 121 | "", 122 | "", 123 | "", 124 | "", 125 | "", 126 | "", 127 | "", 128 | "", 129 | "", 130 | "", 131 | "", 132 | "", 133 | "", 134 | "vagrant", 135 | "1vagrant", 136 | "sudo bash", 137 | "1vagrant", 138 | "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers", 139 | "/usr/gnu/bin/sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers", 140 | "exit" 141 | ], 142 | "boot_wait": "105s", 143 | "disk_size": 8192, 144 | "guest_os_type": "solaris11-64", 145 | "iso_checksum": "d543fddd2042a61387fb58b38c811a2f83d4e8cba8941ecf1450b343489c8108", 146 | "iso_checksum_type": "sha256", 147 | "iso_url": "file:///ISO/Oracle/sol-11_2-text-x86.iso", 148 | "output_directory": "packer-solaris11_2-vmware", 149 | "shutdown_command": "sudo /usr/sbin/init 5", 150 | "ssh_password": "1vagrant", 151 | "ssh_port": 22, 152 | "ssh_username": "vagrant", 153 | "tools_upload_flavor": "solaris", 154 | "type": "vmware-iso", 155 | "vm_name": "packer-solaris11_2", 156 | "vmx_data": { 157 | "cpuid.coresPerSocket": "1", 158 | "memsize": "1536", 159 | "numvcpus": "1" 160 | } 161 | } 162 | ], 163 | "post-processors": [ 164 | { 165 | "compression_level": 9, 166 | "output": "./builds/{{.Provider}}/solaris11_2.box", 167 | "type": "vagrant" 168 | } 169 | ], 170 | "provisioners": [ 171 | { 172 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", 173 | "scripts": [ 174 | "scripts/solaris/vmtools.sh", 175 | "scripts/solaris/postinstall.sh" 176 | ], 177 | "type": "shell" 178 | } 179 | ] 180 | } 181 | --------------------------------------------------------------------------------