{"id":1398,"date":"2022-05-10T14:11:07","date_gmt":"2022-05-10T14:11:07","guid":{"rendered":"\/blog\/?p=1398"},"modified":"2022-05-10T14:11:07","modified_gmt":"2022-05-10T14:11:07","slug":"solaris-zone-cheat-sheet","status":"publish","type":"post","link":"\/blog\/index.php\/solaris-zone-cheat-sheet\/","title":{"rendered":"Solaris zone cheat sheet"},"content":{"rendered":"\n<p><strong>Zone States<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Configured<\/td><td>Configuration has been completed and storage has been committed. Additional configuration is still required.<\/td><\/tr><tr><td>Incomplete<\/td><td>Zone is in this state when it is being installed or uninstalled.<\/td><\/tr><tr><td>Installed<\/td><td>The zone has a confirmed configuration,&nbsp;<em>zoneadm<\/em>&nbsp;is used to verify the configuration, Solaris packages have been installed, even through it has been installed, it still has no virtual platform associated with it.<\/td><\/tr><tr><td>Ready (active)<\/td><td>Zone&#8217;s virtual platform is established. The kernel creates the&nbsp;<em>zsched<\/em>&nbsp;process, the network interfaces are plumbed and filesystems mounted. The system also assigns a zone ID at this state, but no processes are associated with this zone.<\/td><\/tr><tr><td>Running (active)<\/td><td>A zone enters this state when the first user process is created. This is the normal state for an operational zone.<\/td><\/tr><tr><td>Shutting down + Down (active)<\/td><td>Normal state when a zone is being shutdown.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Files and Directories<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>zone config file<\/td><td>\/etc\/zones<\/td><\/tr><tr><td>zone index<\/td><td>\/etc\/zones\/index<br><br>Note: used by \/lib\/svc\/method\/svc-zones to start and stop zones<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Cheat sheet<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Creating a zone<\/td><td>zonecfg -z &lt;zone&gt;see&nbsp;<a href=\"http:\/\/www.datadisk.co.uk\/html_docs\/sun\/solaris_zones.htm\">creating a zone<\/a>&nbsp;for a more details<\/td><\/tr><tr><td>deleting a zone from the global ssytem<\/td><td>## halt the zone first, then uninstall it<br>zoneadm -z &lt;zone&gt; halt<br>zoneadm -z &lt;zone&gt; uninstall<br><br>## now you can delete it<br>zonecfg -z &lt;zone&gt; delete -F<\/td><\/tr><tr><td>Display zones current configuration<\/td><td>zonecfg -z &lt;zone&gt; info<\/td><\/tr><tr><td>Display zone name<\/td><td>zonename<\/td><\/tr><tr><td>Create a zone creation file<\/td><td>zonecfg -z &lt;zone&gt; export<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Verify a zone<\/td><td>zoneadm -z &lt;zone&gt; verify<\/td><\/tr><tr><td>Installing a zone<\/td><td>zoneadm -z &lt;zone&gt; install<\/td><\/tr><tr><td>Ready a zone<\/td><td>zoneadm -z &lt;zone&gt; ready<\/td><\/tr><tr><td>boot a zone<\/td><td>zoneadm -z &lt;zone&gt; boot<\/td><\/tr><tr><td>reboot a zone<\/td><td>zoneadm -z &lt;zone&gt; reboot<\/td><\/tr><tr><td>halt a zone<\/td><td>zoneadm -z &lt;zone&gt; halt<\/td><\/tr><tr><td>uninstalling a zone<\/td><td>zoneadm -z &lt;zone&gt; uninstall -F<\/td><\/tr><tr><td>Veiwing zones<\/td><td>zoneadm list -cv<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>login into a zone<\/td><td>zlogin &lt;zone&gt;<\/td><\/tr><tr><td>login to a zones console<\/td><td>zlogin -C &lt;zone&gt; (use ~. to exit)<\/td><\/tr><tr><td>login into a zone in safe mode (recovery)<\/td><td>zlogin -S &lt;zone&gt;<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>add\/remove a package (global zone)<\/td><td># pkgadd -G -d . &lt;package&gt;<br><br>If the -G option is missing the package will be added to all zones<\/td><\/tr><tr><td>add\/remove a package (non-global zone)<\/td><td># pkgadd -Z -d . &lt;package&gt;If the -Z option is missing the package will be added to all zones<\/td><\/tr><tr><td>Query packages in all non-global zones<\/td><td># pkginfo -Z<\/td><\/tr><tr><td>query packages in a specified zone<\/td><td># pkginfo -z &lt;zone&gt;<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>lists processes in a zone<\/td><td># ps -z &lt;zone&gt;<\/td><\/tr><tr><td>list the ipcs in a zone<\/td><td># ipcs -z &lt;zone&gt;<\/td><\/tr><tr><td>process grep in a zone<\/td><td># pgrep -z &lt;zone&gt;<\/td><\/tr><tr><td>list the ptree in a zone<\/td><td># ptree -z &lt;zone&gt;<\/td><\/tr><tr><td>Display all filesystems<\/td><td># df -Zk<\/td><\/tr><tr><td>display the zones process informtion<\/td><td># prstat -Z# prstat -z &lt;zone&gt;<br>Note:-Z reports information about processes and zones<br>-z reports information about a particular zone<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Zone States Configured Configuration has been completed and storage has been committed. Additional configuration is still required. Incomplete Zone is in this state when it is being installed or uninstalled. Installed The zone has a confirmed configuration,&nbsp;zoneadm&nbsp;is used to verify the configuration, Solaris packages have been installed, even through it has been installed, it still [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1398","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1398"}],"version-history":[{"count":1,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1398\/revisions"}],"predecessor-version":[{"id":1399,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1398\/revisions\/1399"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1398"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}