How to Uninstall and Remove a Zone

Ensure that all users are logged out of the zone.

This procedure combines three separate but dependent operations: shutting down a zone, uninstalling the zone, and deleting the zone.

Caution:

  • Removing all files in the zone's root file system is irreversible.

  • When you uninstall a zone that has its own ZFS file system for the zonepath, the ZFS file system is destroyed.

  1. Become a zone administrator.
  2. Verify that the zone is not in the running state.
    global$ zoneadm list -cv
  3. If the zone is running, shut down the zone.
    • To shut down the zone immediately:

      global$ zoneadm -z zonename shutdown
    • To specify shutdown options:

      global$ zlogin zonename shutdown [shutdown-options]

      For example, to specify a 10 second wait period before shutting down:

      global$ zlogin zonename shutdown -g 10
  4. Verify that the zone is completely shut down.
    global$ zoneadm list -cv

    The zone to be deleted should have an installed status in the output.

  5. Uninstall the zone.
    global$ zoneadm -z zonename uninstall
  6. Verify that the zone has been uninstalled.
    global$ zoneadm list -cv

    The zone to be deleted should have a configured status in the output.

  7. To completely remove the zone from the host, delete the zone.
    global$ zonecfg -z zonename delete [-F]

    Use the ‐F option if you need to force the action. If you use this option, the command proceeds without issuing a confirmation request.

  8. Verify that the deleted zone is no longer listed.
    global$ zoneadm list -cv

    Only the global zone should be listed in the output.