How to setup DPKG zone
Use zonecfg(1M) command to configure a new DPKG zone:
In this example we configured a shared IP-address, this means that the zone will share the IP stack with the host system. From time to time you may want to assign an exclusive IP-address.
In this case the net block could look like:
Like above we need to specify a link that will be used by the zone (vnic0). We mean that the nic is virtual (aka vnic) which has a parent interface, in this example it is a virtual switch (vsw0) or etherstub that is marked as global-nic. We can generate some MAC-address for the new NIC or leave this field empty, it will be filled automatically. Also we need to specify network properties (gateway, usualy it is IP-address in the host; netmask; ip is the address that will be assigned to the NIC inside the zone)
Also you can add a name server to the zone:
Install the zone:
And boot it:
Login to the zone for configuration:
The root's password by default is "123". You can do "zlogin <zonename>" to log in into the new zone and then you can change the root password by the command passwd.
Login by 'root' for next modifications:
You can add local 'admin' user with the same UID/GID from global zone.
You be able to login to your new zone by SSH from global zone or another comp by command:
Creating dpkg zone from zfs stream
use the zfs list command to find a dataset with your zone:
now using zfs get all you need to find the active be for this zone:
after finding the active dataset, you can create a snapshot:
now you need to prepare the dataset for copying the zone:
now you need to export the zone configuration to a file:
now let's change this configuration so that we can create a zone via zonecfg.
You must remove the following settings from the template:
- delete uuid because it is generated and registered in the zone configuration file when it starts (/etc/zones/name_zone.xml).
- delete mac address because it is generated and registered in the zone configuration file when it starts (/etc/zones/name_zone.xml).
- change name global vnic
- change ip address
- change zonepath
now use the zonecfg and zoneadm commands to create and start a zone: