# Snapshot fails on images that enable the QEMU guest agent

Source: https://docs.quake.ai/docs/operate/troubleshooting/ubuntu-22-snapshots
Markdown: https://docs.quake.ai/docs/operate/troubleshooting/ubuntu-22-snapshots.md
> Resolve the libvirt qemu-guest-agent snapshot error on custom images that set hw_qemu_guest_agent='yes'. The default Ubuntu-22.04 shared image snapshots without this step.

---

# Snapshot fails on images that enable the QEMU guest agent

The default `Ubuntu-22.04` shared image snapshots without any extra steps, because it ships with the property `hw_qemu_guest_agent='no'`. This page covers a narrower case: custom or user-uploaded images that set `hw_qemu_guest_agent='yes'` but do not run the agent inside the instance.

## Issue

When an image sets `hw_qemu_guest_agent='yes'`, Nova asks the QEMU guest agent inside the instance to quiesce the filesystem before it captures a snapshot. If the agent is missing or stopped, the snapshot fails.

In the Quake AI console, **Create Snapshot** reports that the operation failed. Select **Click to show detail** to see the error:

```text
libvirt cannot connect to the qemu-guest-agent inside the instance
```

The default `Ubuntu-22.04` image sets `hw_qemu_guest_agent='no'`, so a default instance does not reach this path.

## Confirm whether your image is affected

Read the image property before you change anything. The error applies only when the property is set to `yes`:

```bash
openstack image show YOUR_IMAGE_NAME -c properties
```

Look for `hw_qemu_guest_agent='yes'` in the output. If the value is `no` or absent, the snapshot does not depend on the guest agent, and this workaround does not apply.

## Workaround

If your image sets `hw_qemu_guest_agent='yes'` and the snapshot fails with the error above, install and start the agent inside the instance.

1. Connect to the instance over SSH:

```bash
ssh ubuntu@YOUR_INSTANCE_IP
```

2. Install the agent and start it:

```bash
sudo apt-get update
sudo apt-get install -y qemu-guest-agent
sudo systemctl enable --now qemu-guest-agent
```

3. Close the SSH session:

```bash
exit
```

4. From the Quake AI console, go to **Compute** > **Instances** and find the instance.
5. Select **More** > **Instance Status** > **Soft Reboot**, then wait for the instance to return to the active state.
6. Select **More** > **Backup & Snapshots** > **Create Snapshot** and provide a name for the snapshot.

The snapshot now completes, because the guest agent answers the quiesce request from Nova.
