# HostKernel

The host operating system kernel used for builds in a CodeBuild project.

The host kernel does not affect the build environment operating system,
which is determined by the build image.

Only applies to the `LINUX_CONTAINER`, `ARM_CONTAINER`, `LINUX_EC2` and `ARM_EC2`
environment types. It is not applicable to Windows, Lambda or Mac environment types.

- Source: [`aws-codebuild/lib/host-kernel.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codebuild/lib/host-kernel.ts#L12)
- Type last changed: v2.271.0 · 25 Sep 2026

## Example

```ts
new codebuild.Project(this, 'Project', {
  environment: {
    buildImage: codebuild.LinuxBuildImage.STANDARD_7_0,
    hostKernel: codebuild.HostKernel.LINUX_KERNEL_6,
  },
});
```

## Members

| Member | Description |
| --- | --- |
| `LINUX_KERNEL_4` | Runs on an Amazon Linux 2 host (kernel 4.x). |
| `LINUX_KERNEL_6` | Runs on an Amazon Linux 2023 host (kernel 6.x). |
| `LINUX_KERNEL_LATEST` | Runs on the latest supported host kernel. |

## Referenced by

- [`BuildEnvironment`](/v2/docs/aws-cdk-lib.aws_codebuild.BuildEnvironment).hostKernel
