+++
title = "sysidcfg replacement on omnios"
date = "2013-07-17T22:19:44+00:00"
author = "Gibheer"
draft = false
+++

A very nice feature on Solaris was the possibility to initialize new zones with a sysidcfg file. This does not exist on omnios. With kayak, omnitis deployment server, a way to run postboot scripts was created. The way is the file `/.initialboot`.
This is just a shell script which gets executed on the first boot and gets removed afterwards. Nothing much but already very useful to make the initial setup for dns and the ip.

A little example. I have a zone foo1 with a vnic barnic1. I want to setup dns and dhcp for the interface. The zone is installed in `/zones/foo1/` so we have to root file system mounted as `/zones/foo1/root`.

We create the `/.initialboot` file (which ends up as `/zones/foo1/root/.initialboot` with the following content

    ipadm create-if foonic1
    cp /etc/nsswitch.dns /etc/nsswitch.conf
    ipadm create-addr -T dhcp foonic1/ipv4
    echo "nameserver 192.168.56.1" >> /etc/resolv.conf

Now boot the zone and after 5minutes or so everything is setup and ready to go. Makes it really easy.
