Today we encountered a situation where a Proxmox system’s KVM virtual machine refused to delete after the storage volume that it’s virtual HDD resided on was lost; trying to delete the KVM from the web GUI resulted in the following error:
TASK ERROR: storage ‘proxmoxHDD’ does not exists
Attempting to delete it from the command line using:
qm destroy [VM ID]
storage ‘proxmoxHDD’ does not exists
Fortunately, there’s a way around this. The KVM config files live in:
Move or erase the [VM ID].conf file and when you refresh your web GUI the VM should be gone.
Vim has a host of really useful shortcuts; the one we are looking at today allows you to delete the text on the same line after the cursor position. To do this, move the cursor to the desired position and hit:
In other words, a capital D. We don’t need a colon in front of it. This will delete the remainder of the line.
In Ubuntu 12.04 and 12.10, to delete an additional user you have created, use the following:
sudo deluser [username]
By example, if we wanted to delete a user we created called “test”, we would run:
sudo deluser test
Removing user `test’ …
Warning: group `test’ has no more members.
Be careful with this – don’t delete your admin account 🙂
If you have upgraded your kernel you will have found that Ubuntu keeps the older ones around, which can be handy if something breaks in the newer kernel and you have to boot from your old system. Over time, however, these can add up in terms of the amount of space consumed – at around 150MB per kernel you could easily find yourself with over a GB of old kernels if you’ve upgraded enough times. In this example the system we are using is Ubuntu 220.127.116.11. If you’re using Ubuntu Desktop, open up a terminal window – if you’re using Ubuntu Server, log in as usual and run:
to see which kernel you are currently running. Make sure not to delete this one.
Now, to see a list of the installed kernels, we run:
dpkg –list | grep linux-image
This command lists the installed packages and filters the list to include only those which have “linux-image” in them, which should only be your kernels. Your list should look something along the lines of:
ii linux-image-2.6.32-33-server 2.6.32-33.72 Linux kernel image for version 2.6.32 on x86_64
ii linux-image-3.2.0-35-generic 3.2.0-35.55 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-38-generic 3.2.0-38.61 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-server 18.104.22.168.46 Linux kernel image on Server Equipment.
To remove a kernel, run the following:
sudo apt-get purge [kernel]
Using the above list, say we want to get rid of 3.2.0-35. In that case the command would be:
sudo apt-get purge linux-image-3.2.0-35-generic
Once you have removed your unwanted kernels run:
This will update the boot menu accordingly.