# Create a Golden Image with the Nano Agent Pre-Installed

<mark style="color:blue;">Published: July 25, 2022</mark>

Using a Golden Image of a virtual machine (VM) to deploy consistently creates a template that reduces errors, ensures consistency, and lowers the level of effort during deployment. The use of a Golden Image is also common in environments with autoscaling and automation.

Below are the steps that should be followed to include the Spyderbat Nano Agent into your Golden Image:

1\. Identify the VM that you want to base your Golden Image.

2\. Install the Spyderbat Nano Agent on this VM by choosing to add a new source in the Sources section of the UI.

<figure><img src="/files/X0t0aGTvjtX35y8bfCHS" alt=""><figcaption></figcaption></figure>

3\. After you have successfully installed and registered the Spyderbat Nano Agent, run the following command to stop the Nano Agent (it will take a few seconds to fully stop):

```
sudo systemctl stop nano_agent.service
```

4\. Remove the unique machine ID (MUID) that associates the Nano Agent with the specific VM it is running on, by executing the following command:

```
sudo rm /opt/spyderbat/etc/muid
```

5\. Save this VM as your Golden Image using the respective Cloud Platform or Virtual Machine functionality.

6\. The Nano Agent service will start automatically when the virtual machine is loaded and boots, at which time a new, unique MUID will be generated and associated with the specific VM.

See also[ How to perform an unattended Spyderbat Nano Agent installation on AWS](/installation/spyderbat-nano-agent/aws-unattended-install.md) for additional information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spyderbat.com/installation/spyderbat-nano-agent/creating-vm-golden-images-that-include-spyderbats-nano-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
