I'm running Ubuntu under virtualized environment (as a guest of VMware ESXi, HyperV or KVM). Which packages should I delete that are not needed under virtualized environment since a virtualized guest Ubuntu anyway cannot access physical hardware anyway? I mean packages like linux-firmware, intel-microcode, amd64-microcode, thermald, acpid, etc. Could you please somehow suggest a list of unnecessary packages that I could delete? I'm running many virtual machines and I don't want for them to reboot in vain just because some packages, like linux-firmware for example, have updated by unattended-upgrades.
2 Answers
If you start with Ubuntu's cloud images, then there's nothing hardware-related to remove. This won't help with your current VMs, but is an easier starting point for your future VMs.
Here's an example of getting started using KVM and cloud-images:
Everything you need, including KVM, is a dependency of the wonderful
uvtool
package. No PPAs, this is all stock Ubuntu main.$ sudo apt install uvtool
Download a cloud image. It's 400MB, so it takes a couple minutes. Don't panic about a lack of feedback - let it run.
$ uvt-simplestreams-libvirt sync release=disco arch=amd64
Create the VM:
$ uvt-kvm create my_VM_name release=disco
There - it's running now. You can use virsh
to control the VM (suspend, resume, shutdown, start, list, etc). You can SSH into it, or use virt-viewer
.
Alternately, if you don't want to use uvtool
, you can download cloud images from https://cloud-images.ubuntu.com/
-
Thank you for your reply, however, I don't usually control the host, I purchase virtual machine services from different providers like Azure and they provide ready Ubuntu virtual machines with modules like
intel-microcode
already installed so I have to uninstall them. Jul 9, 2019 at 22:50 -
2Oh, in that case see docs.microsoft.com/en-us/azure/virtual-machines/linux/… Jul 9, 2019 at 23:07
-
@MaximMasiutin you misled us. you said you're "running Ubuntu", as in "stock Ubuntu". you're not. You're running Ubuntu distros modified by Azure, this would have been crucial information to provide in the OP. this is an edge case, not a majority case. this is why we all assumed it was vanilla Ubuntu and why your question didn't make any sense.– tatsuJul 10, 2019 at 7:33
I have identified the following packages so far that tend to operate physical hardware thus cannot do anything under virtualized environment so can be safely removed to avoid unnecessary reboots when they are updated by unattended-upgrades
:
amd64-microcode intel-microcode iucode-tool thermald acpid linux-firmware mdadm
-
1mdadm is not hardware related. You can have RAIDs in a VM. You can remove it if your setup doesn't deal with RAIDs, but it is outside the scope of your own question.– oᴉɹǝɥɔFeb 9, 2023 at 17:03
-
apt purge -s acpid
for example. If deleting whatever you want doesn't break your clone, apply the same to the "real" VM. You could also turn off unattended upgrades.unattended-upgrades
while actually they are not used. So my goal is to not minimize reboots and but save resources (disk, CPU) taken by upgrading these unused modules.