The lm-sensors.service (often simply referred to as sensors or hardware monitoring) is an initialization service in Ubuntu Server that relies on the lm-sensors package. During the boot sequence, this service probes the motherboard’s I2C/SMBus and CPU registers to initialize drivers that monitor fan speeds, voltages, and thermal outputs. While critical for bare-metal physical servers to prevent thermal throttling, this service is entirely useless—and often generates boot-time errors or log spam—when Ubuntu Server is running as a virtual machine (VM) on hypervisors like VMware ESXi, Proxmox, or Hyper-V, where the guest OS has no direct access to underlying physical hardware sensors.
This guide explains how to completely disable the lm-sensors service in Ubuntu Server, ensuring the system does not attempt to probe non-existent hardware sensors during boot.
Stop and Mask the lm-sensors Service
To guarantee that the server never attempts to initialize hardware sensors, we must stop the service and explicitly mask it to prevent any other systemd target or cron job from invoking it.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, check if the service is currently running or queued:
sudo systemctl status lm-sensors.service - If it is active, stop the service immediately:
sudo systemctl stop lm-sensors.service - Next, disable the service to remove its symlinks from the boot sequence:
sudo systemctl disable lm-sensors.service - For absolute certainty, explicitly mask the service. This symlinks the unit file to
/dev/null, creating a hard block against it starting under any circumstances:sudo systemctl mask lm-sensors.service
Verify the Service Lockdown
By masking lm-sensors.service, you guarantee that the Ubuntu OS will silently skip hardware sensor probing, streamlining the boot process and cleaning up syslog errors in virtualized environments.
To verify the lockdown is successful, attempt to start the service manually:
sudo systemctl start lm-sensors.service
Systemd will return a fatal error stating that the unit is masked (e.g., Failed to start lm-sensors.service: Unit lm-sensors.service is masked). Additionally, you can execute the sensors command; it will likely return “No sensors found,” confirming that your virtual server is optimized and free from unnecessary physical hardware polling routines.