# Configuring instances with user-defined guest policies

Container-Optimized OS includes the
[OS Config](https://docs.cloud.google.com/compute/docs/vm-manager)
agent. You can use OS Config's [guest policies](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#resource:-guestpolicy) to configure your
instance. `packages` and
`packageRepositories` features of guest policies are not supported on Container-Optimized OS.

To enable OS Config and create a guest policy, see [Enable OS Config
agent](https://docs.cloud.google.com/compute/docs/manage-os#overview) and [Create a
guest
policy](https://docs.cloud.google.com/compute/docs/os-config-management/create-guest-policy), respectively.

Here is an example that shows how users can use `assignment` and `recipes`
features of guest policies to create a file on instances located at
us-central1-a.

    assignment:
      zones:
      - us-central1-a
    recipes:
    - name: recipe-runscript
      desiredState: INSTALLED
      installSteps:
      - scriptRun:
          interpreter: SHELL
          script: touch /tmp/TOUCH_FILE

> [!NOTE]
> **Note:** While it is optional to provide an `interpreter` on other distros, Container-Optimized OS requires `interpreter` to execute the given script.

> [!NOTE]
> **Note:** While `recipes` are run once-per-instance on other distros, on Container-Optimized OS, `recipes` are run on every boot. This is because most of the directories are stateless; therefore, changes made by `recipes` will not persist across reboots. See [Disks and Filesystem](https://docs.cloud.google.com/container-optimized-os/docs/concepts/disks-and-filesystem) for more information on Container-Optimized OS's filesystem.