ProxMox: Deleting a VM

May 12, 2022

Introduction

Proxmox is an open-source server platform for enterprise virtualization that uses a modified Ubuntu kernel to deploy and manage multiple virtualized environments on a single bare metal server.

After installing Proxmox and setting up virtual machines (VMs), move on to mastering the skill of managing them. One of these skills is deleting a virtual machine.

In this article, you will learn how to delete a VM in Proxmox, as well as how to remove a VM disk and snapshot.

Proxmox delete vm

Prerequisites

Note: phoenxiNAP Bare Metal Cloud provides automated 8-minute deployments of Proxmox servers suitable for enterprise use cases. Sign up for Bare Metal Cloud today and spin up a Proxmox server in no time.

Delete a VM in Proxmox

There are two ways to delete a virtual machine in Proxmox:

  1. Using the graphical user interface (GUI).
  2. Using the command line.

Deleting a VM via GUI

To delete a VM using the Proxmox graphical user interface, follow the steps outlined below:

1. Log in to the Proxmox web console.

Log in to the Proxmox web console.

2. Select the VM you want to delete.

Select a VM in Proxmox to delete it.

3. If the machine is running, click the Shutdown button before moving on to the next step. The VM has to be shut down or stopped.

Shutdown a virtual machine in Proxmox before deleting it.

4. Select More to open a drop-down menu and click Remove.

Delete a VM in Proxmox.

5. To confirm, enter the VM ID and click Remove.

Remove a virtual machine in Proxmox.

Deleting a VM via Command Line

To delete a Proxmox VM using the command line:

1. Log into the node.

2. Find the VMID (virtual machine ID) in the VM list by running the command:

cat /etc/pve/.vmlist

The output lists information about the VMs created, including their IDs. In the example below, there is only one VM with the ID 100.

List VMs and their ID number in Proxmox.

3. Shut down or stop the VM by running:

qm shutdown [vmid]

Or:

qm stop [vmid]
Stop a running VM in Proxmox command line.

4. Copy the ID number and add it to the following command to remove the virtual machine:

qm destroy [vmid]
Removing a VM from Proxmox via command line.

Delete a VM Disk on Proxmox

In most cases, Proxmox deletes associated disks when deleting a virtual machine. To remove a disk manually, use the GUI or a terminal shell.

Delete a VM Disk via GUI

1. Select the virtual machine from the resource tree and open the Hardware tab.

2. Click the disk you want to delete.

3. Then, use the Remove button to instruct Proxmox to delete the disk.

Delete VM disk on Proxmox.

4. Confirm you want to remove the disk and permanently erase all data with Yes.

Confirming the deletion of VM disk on Proxmox

Delete a VM Disk via Command Line

1. List basic information of all the datasets on the system with:

zfs list

The output displays the names of the datasets and the values of their used, available, referenced, and mounted properties. For instance:

rpool/data/vm-100-disk-1      10G  5G  10G  -

2. To delete a disk via the command line, run:

zfs destroy -f [disk_path]

Therefore, to delete the above mentioned sample disk, run:

zfs destroy -f rpool/data/vm-100-disk-1

Delete VM Snapshots on Proxmox

Delete a VM snapshot in Proxmox via GUI or command line.

Remove a VM Snapshot via GUI

1. Select the VM in the menu on the left and open the Snapshots tab from the panel.

2. Select the snapshot you want to delete.

Select the snapshot you want to delete.

3. Confirm you want to remove the selected snapshot with Yes.

Confirming the deletion of a snapshot on Proxmox

Remove a VM Snapshot via Command Line

1. First, list all snapshots of the specified virtual machine by running the command:

qm listsnapshot [vmid]

Replace [vmid] with the ID of the virtual machine.

The sample output below shows that VM 100 includes snapshot1 and the current state of the virtual machine.

The sample output showing current state of the virtual machine.

2. To delete a snapshot, use:

qm delsnapshot [vmid] [snapshot_name]

In the example below, Proxmox deletes the specified snapshot (snapshot1) and the data related to it.

Deleting a specified snapshot in Proxmox

3. To confirm the snapshot has been removed, run the qm listsnashot command again.

Conclusion

In this article, you learned how to delete VMs in Proxmox, their disks and snapshots.

To see how Proxmox compares to other type-1 hypervisors, check out Proxmox vs. Hyper-V and Proxmox vs. ESXi.

Was this article helpful?
YesNo
Sofija Simic
Sofija Simic is an experienced Technical Writer. Alongside her educational background in teaching and writing, she has had a lifelong passion for information technology. She is committed to unscrambling confusing IT concepts and streamlining intricate software installations.
Next you should read
Proxmox vs. ESXi: Head to Head Comparison
January 27, 2022

Proxmox and ESXi are both hypervisors used for creating and managing VMs. This article compares...
Read more
Proxmox vs. Hyper-V: How to Choose?
April 21, 2022

This article compares Proxmox and Hyper-V, two popular type-1 hypervisors. Learn the differences...
Read more
What is Server Virtualization? Definition and How it Works
February 24, 2019

A virtualized server allows one piece of hardware to be used as multiple virtual servers...
Read more
What is a Hypervisor? Types of Hypervisors 1 & 2
September 29, 2022

Server virtualization is one of the hottest topics in the IT world today. It has been...
Read more