# Installation of Elastic Agents on Non-Persistent VDI Machines

**URL:** <https://discuss.elastic.co/t/installation-of-elastic-agents-on-non-persistent-vdi-machines/377504>\
**Category:** Elastic Agent\
**Tags:** elastic-stack-monitoring, fleet\
**Created:** [April 24, 2025, 8:23pm UTC](https://discuss.elastic.co/t/installation-of-elastic-agents-on-non-persistent-vdi-machines/377504 "2025-04-24T20:23:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaigaGentil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saigagentil/32/106923_2.png) [@SaigaGentil](https://discuss.elastic.co/u/SaigaGentil)\
**Post date:** [April 24, 2025, 8:23pm UTC](https://discuss.elastic.co/t/installation-of-elastic-agents-on-non-persistent-vdi-machines/377504/1 "2025-04-24T20:23:39Z")

</div>

Hello,

We have a use case where we'd like to monitor hundreds of Citrix VDI desktops. Those are machines that are regularly rebooted and are built based on an image that's prebuilt...

We have 1 image that is pushed to VDI machines in 2 different network environments, i.e Elastic agents also talk to 2 different Fleet Servers.

I saw 2 similar previous question and issue that were raised around this same topic, but never got answers to?

> [@Dynamic instances of Elastic Agent](https://discuss.elastic.co/t/dynamic-instances-of-elastic-agent/337005):
>
> Hello, we are spawning multiple Windows Server instances from a golden image. These instances get destroyed and recreated daily. For log collection we installed and enrolled the Elastic Agent in the golden image. We do get logs of all server instances, but have troubles when the agent policy is updated (it is not assigned correctly on all instances). Therefore, we try to enroll each server instance individually. The easiest option for us would be, to just recreate the agent id on startup. We …

[Issue with Elastic Agent ID duplication · Issue #37743 · elastic/beats](https://github.com/elastic/beats/issues/37743)

Anyone got any ideas?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 25, 2025, 2:01pm UTC](https://discuss.elastic.co/t/installation-of-elastic-agents-on-non-persistent-vdi-machines/377504/2 "2025-04-25T14:01:04Z")

</div>

> [@SaigaGentil](#):
>
> Anyone got any ideas?

What is exactly the issue here? How are you installing the Agent on the image?

I have the agent installed on images with delayed enrollment, so the agent will only enroll on Elastic when a VM is created using the image.

During the image creation you need to install the agent with the `--delay-enroll` [parameter](https://www.elastic.co/docs/reference/fleet/agent-command-reference#_options_5).

> --delay-enroll  
> Delays enrollment to occur on first start of the Elastic Agent service. This setting is useful when you don’t want the Elastic Agent to enroll until the next reboot or manual start of the service, for example, when you’re preparing an image that includes Elastic Agent.
