> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Linux

Linux chaos faults that stress, disrupt the network of, or kill processes on Linux VMs and bare-metal hosts through the Linux chaos infrastructure.

Linux faults run on a Linux VM or bare-metal host through the Linux chaos infrastructure, a `systemd` service installed on the target. The faults stress CPU, memory, and disks, disrupt network and API traffic, inject JVM faults, and kill processes or services, all on the host where the infrastructure runs.

***

## Before you begin

* **Linux chaos infrastructure:** The `linux-chaos-infrastructure` service is `active` on each target host and the infrastructure shows as **Connected** in Harness. Go to [Linux infrastructure](https://developer.harness.io/resilience-testing/chaos-testing/infrastructure/linux.md) to install it.
* **Root user for advanced faults:** Network, API, DNS, service restart, and time chaos faults need the infrastructure installed with the **Root User** option. Go to [Linux fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/permissions.md) to check which faults need it.

Linux faults set their duration with `DURATION`, a Go duration string such as `30s`, `5m`, or `1h3m2s`, not with `TOTAL_CHAOS_DURATION` in seconds. Go to [Common tunables](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/common-tunables.md#linux-and-windows-fault-duration) for the details.

***

## Supported environments

Linux faults are tested on these distributions, on `x86_64` and `arm64`. A fault page lists any distribution it does not support.

| Distribution                            | Versions                         |
| --------------------------------------- | -------------------------------- |
| Ubuntu                                  | 16 and later                     |
| Debian                                  | 10 and later                     |
| CentOS                                  | 7 and later                      |
| Red Hat Enterprise Linux                | 7 and later                      |
| Fedora                                  | 30 and later                     |
| openSUSE Leap and SUSE Linux Enterprise | 15.4 and later, and 15 and later |

The host can run on premises, on VMware, or in any public cloud, as long as the infrastructure can reach Harness over port 443.

***

## Faults

The following faults are grouped by failure type.

### Resource

| Fault                                                                                                                                  | What it does                                        | Reversible |
| -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------- |
| [Linux CPU stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-cpu-stress.md)               | Consumes CPU on the host                            | Yes        |
| [Linux disk fill](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-disk-fill.md)                 | Fills disk space at a path with a fill file         | Yes        |
| [Linux disk I/O stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-disk-io-stress.md)      | Generates disk IO load on a mount path              | Yes        |
| [Linux FS fill](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-fs-fill.md)                     | Fills the file system at a path                     | Yes        |
| [Linux JVM CPU stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-cpu-stress.md)       | Consumes CPU inside a Java process                  | Yes        |
| [Linux JVM memory stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-memory-stress.md) | Consumes heap or other memory inside a Java process | Yes        |
| [Linux memory stress](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-memory-stress.md)         | Consumes memory on the host                         | Yes        |

### Network

| Fault                                                                                                                                      | What it does                                      | Reversible |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | ---------- |
| [Linux DNS error](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-dns-error.md)                     | Fails DNS resolution for target hostnames         | Yes        |
| [Linux DNS spoof](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-dns-spoof.md)                     | Resolves target hostnames to spoofed IP addresses | Yes        |
| [Linux network corruption](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-network-corruption.md)   | Corrupts a percentage of outbound packets         | Yes        |
| [Linux network duplication](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-network-duplication.md) | Duplicates a percentage of outbound packets       | Yes        |
| [Linux network latency](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-network-latency.md)         | Adds latency to outbound traffic                  | Yes        |
| [Linux network loss](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-network-loss.md)               | Drops a percentage of outbound packets            | Yes        |
| [Linux network rate limit](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-network-rate-limit.md)   | Limits outbound bandwidth                         | Yes        |

### HTTP and API

| Fault                                                                                                                                  | What it does                                           | Reversible |
| -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------- |
| [Linux API block](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-api-block.md)                 | Blocks API requests to or from a service port          | Yes        |
| [Linux API latency](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-api-latency.md)             | Adds latency to API requests to or from a service port | Yes        |
| [Linux API modify body](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-api-modify-body.md)     | Rewrites the body of API requests or responses         | Yes        |
| [Linux API modify header](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-api-modify-header.md) | Rewrites headers of API requests or responses          | Yes        |
| [Linux API status code](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-api-status-code.md)     | Returns a chosen status code for API responses         | Yes        |

### Application

| Fault                                                                                                                                        | What it does                                             | Reversible |
| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ---------- |
| [Linux JVM method exception](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-method-exception.md) | Throws an exception from a Java method                   | Yes        |
| [Linux JVM method latency](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-method-latency.md)     | Adds latency to a Java method                            | Yes        |
| [Linux JVM modify return](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-modify-return.md)       | Changes the value a Java method returns                  | Yes        |
| [Linux JVM trigger GC](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-jvm-trigger-gc.md)             | Repeatedly triggers garbage collection in a Java process | Yes        |

### State

| Fault                                                                                                                              | What it does                                | Reversible |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ---------- |
| [Linux process kill](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-process-kill.md)       | Kills processes by ID, name, or command     | Partial    |
| [Linux service restart](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-service-restart.md) | Stops and starts systemd services in a loop | Yes        |
| [Linux time chaos](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/linux-time-chaos.md)           | Shifts the system clock by an offset        | Yes        |

***

## Troubleshooting

<details>

<summary>A Linux fault does not start and the experiment waits for the infrastructure</summary>

The `linux-chaos-infrastructure` service is stopped or cannot reach Harness. Check it with `systemctl status linux-chaos-infrastructure` on the host, and confirm the host allows outbound traffic to Harness over port 443.

</details>

<details>

<summary>A Linux fault fails with a permission denied error</summary>

The fault is an advanced fault and the infrastructure runs as a non-root user. Reinstall the infrastructure with the **Root User** option, or use a basic fault. Go to [Linux fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/permissions.md) for the list.

</details>

<details>

<summary>An API or DNS fault on Linux fails to start</summary>

The `/tmp` directory is mounted with `noexec`, so the fault cannot run its proxy or DNS interceptor binary. Check with `findmnt -l | grep noexec | grep /tmp`, and remount it with `sudo mount /tmp -o remount,exec`.

</details>

***

## Next steps

* Go to [Linux fault permissions](https://developer.harness.io/resilience-testing/chaos-testing/chaos-faults/linux/permissions.md) to check the user each fault needs.
* Go to [Linux infrastructure](https://developer.harness.io/resilience-testing/chaos-testing/infrastructure/linux.md) to install the infrastructure on more hosts.

{% @harness-feedback/feedback %}
