# Elastic Agent installation error on Azure Windows VM

**URL:** <https://discuss.elastic.co/t/elastic-agent-installation-error-on-azure-windows-vm/318067>\
**Category:** Elastic Agent\
**Created:** [November 3, 2022, 6:28am UTC](https://discuss.elastic.co/t/elastic-agent-installation-error-on-azure-windows-vm/318067 "2022-11-03T06:28:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitchelldemol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitchelldemol/32/112870_2.png) [@mitchelldemol](https://discuss.elastic.co/u/mitchelldemol)\
**Post date:** [November 3, 2022, 6:28am UTC](https://discuss.elastic.co/t/elastic-agent-installation-error-on-azure-windows-vm/318067/1 "2022-11-03T06:28:30Z")

</div>

I have come across a bug when trying to install the elastic agent (8.4.0) on Windows Server 2019 VMs on Azure via the instructions provided in the [fleet documentation](https://www.elastic.co/guide/en/fleet/8.4/install-fleet-managed-elastic-agent.html#elastic-agent-installation-steps).

The startup script on the VM runs the following command (from PowerShell)

```auto
& "C:\{path_to_exe}\elastic-agent.exe" install --url={url} --enrollment-token={token} --tag "{tags}" -n

```

which throws this error:

```auto
Error: 1 error: GetFileVersionInfoSize failed: The system cannot find the file specified.

```

Using process monitor, we saw that it is failing to find C:\Windows\system32\ntoskrnl.exe, similar to the problem in these posts [1](https://discuss.elastic.co/t/filebeat-failed-to-start-after-adding-add-host-metadata/177467), [2](https://discuss.elastic.co/t/filebeat-as-webjob-in-an-azure-app-service/165056) and [Github issue](https://github.com/elastic/beats/issues/11864) (coresponding to post 1).

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/7/97d663423ee9e3fac2f4f3793f45f2bfd285c383.png)

This file is actually located in the D: drive, so adding a symlink from `C:\Windows\system32` to `D:\Windows\sysem32` seems to fix the issue as the agent installs successfully and we can see data in Kibana.

Also note that unzipping the agent folder to D: and trying to install results in the same error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 1, 2022, 6:28am UTC](https://discuss.elastic.co/t/elastic-agent-installation-error-on-azure-windows-vm/318067/2 "2022-12-01T06:28:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
