# Can not delete virtual machine

**URL:** https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675
**Category:** Product Support
**Created:** [November 10, 2023, 8:54am UTC](https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675 "2023-11-10T08:54:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Justina\_Gr](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/justina_gr/32/7894_2.png) [@Justina\_Gr](https://forum.opennebula.io/u/Justina_Gr)
#### Post date: [November 10, 2023, 8:54am UTC](https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675/1 "2023-11-10T08:54:35Z")

</div>

Hello, interesting problem, does not allow to delete virtual machine in opennebula executing shell code:

After writing in shell script line:

$ onevm recover --delete [virtual\_machineid]

Occurs error:

User[id] : not authorized to perform ADMIN vm[id]

I use opennebula 6.8 version, maybe is it a bug? Where could be a problem? how should i fix that issue?

---

<div class="post-metadata">

### Author: ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)
#### Post date: [November 10, 2023, 2:14pm UTC](https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675/2 "2023-11-10T14:14:42Z")

</div>

> [@Justina\_Gr](#):
>
> User[id] : not authorized to perform ADMIN vm[id]

Looks like the opennebula user trying to perform the recover is not authorized to manage the VM in question. Check the VM permissions with `onevm show <vm_id>`.

---

<div class="post-metadata">

### Author: ![Justina\_Gr](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/justina_gr/32/7894_2.png) [@Justina\_Gr](https://forum.opennebula.io/u/Justina_Gr)
#### Post date: [November 11, 2023, 7:53am UTC](https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675/3 "2023-11-11T07:53:50Z")

</div>

After executing this command, tells:  
ONE\_AUTH file not present.

---

<div class="post-metadata">

### Author: ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)
#### Post date: [November 13, 2023, 2:50pm UTC](https://forum.opennebula.io/t/can-not-delete-virtual-machine/11675/4 "2023-11-13T14:50:26Z")

</div>

Make sure you either have the user auth [stored in the corresponding file](https://docs.opennebula.io/6.8/management_and_operations/references/cli.html?highlight=one_auth#shell-environment). Either that or pass the `--user` and `--password` arguments to every command.
