2016-12-20 08:36:06 -05:00
---
layout: doc
title: How to Remove VMs Manually
permalink: /doc/remove-vm-manually/
---
How to Remove VMs Manually
==========================
2018-07-16 17:51:13 -04:00
How to Remove a TemplateVM Manually
2018-06-12 22:50:03 -04:00
------------------------------------------
2016-12-20 08:36:06 -05:00
2018-07-16 17:51:13 -04:00
Try the [normal method] before resorting to these.
2018-06-12 22:50:03 -04:00
All of the following commands should be executed in a dom0 terminal.
2016-12-20 08:36:06 -05:00
2018-07-16 17:51:13 -04:00
### R3.2
2016-12-20 08:36:06 -05:00
1. Remove the TemplateVM's directory:
2018-06-12 22:50:03 -04:00
$ rm -rf /var/lib/qubes/vm-templates/< template-name >
2016-12-20 08:36:06 -05:00
2. Remove the TemplateVM from qubes.xml:
2018-06-12 22:50:03 -04:00
$ qvm-remove --just-db < template-name >
2016-12-20 08:36:06 -05:00
3. Remove the TemplateVM's `*.desktop` files from `~/.local/share/applications` :
2018-06-12 22:50:03 -04:00
$ rm ~/.local/share/applications/< template-name > *
2016-12-20 08:36:06 -05:00
2017-03-09 11:41:55 -05:00
4. Remove the TemplateVM's Applications Menu entry:
2017-03-09 11:30:12 -05:00
2018-06-12 22:50:03 -04:00
$ sudo rm /etc/xdg/menus/applications-merged/< template-name > *
[normal method]: /doc/templates/#how-to-install-uninstall-and-reinstall
2018-07-16 17:51:13 -04:00
### R4.0
When a template is marked as 'installed by package manager', but cannot be uninstalled there, trying to uninstall manually will result in the error "ERROR: VM installed by package manager: template-vm-name". Do as follows to be able to uninstall the template:
1. Check the state of `installed_by_rpm`
$ qvm-prefs template-vm-name
2. If `installed_by_rpm - True]` , mark the template as not installed by package manager
$ qvm-prefs template-vm-name installed_by_rpm false
3. Re-check the state of `installed_by_rpm`
- If `installed_by_rpm - False` , remove the template like you would a regular qube:
$ qvm-remove template-vm-name
- If `installed_by_rpm` remains `True` , reboot your computer to bring qubes.xml in sync with qubesd, and try again to remove the template.