Linux: Dell Laptop Fan Control And Get CPU Temperature

I have installed Debian or Ubuntu Linux on Dell Inspiron / Latitude / Precision / Vostro laptop. How do I see the current CPU temperature? How do I control and see fan status on Dell laptop?

Tutorial details
Difficulty Intermediate (rss)
Root privileges Yes
Requirements i8k driver
Time 5m
You need to use the i8kfan and sensors commands to get the following information on Dell laptop powered by Linux operating systems:

ADVERTISEMENTS

  1. Cpu temperature
  2. Left or right fan status
  3. Left or right fan speed
  4. Ac power status
  5. Fn buttons status

Say hello to i8k driver to control Dell laptop fan

You need to load a driver called i8k. It is used for accessing SMM BIOS on Dell laptops. It is well supported on business class Dell laptop modules such as Latitude, Inspiron, Vostro, Precision mobile workstations and so on. This module is included with Linux kernel version 3.0 or above.

How do I load the driver?

Type the following modprobe command to load the i8k driver:
$ sudo modprobe -v i8k
OR
# modprobe -v i8k
Sample outputs:

insmod /lib/modules/3.5.0-30-generic/kernel/drivers/char/i8k.ko

Install i8kutils package on Debian / Ubuntu

Open a terminal and then type the apt command/apt-get command:
$ sudo apt-get install i8kutils
Outputs:

[sudo] password for vivek: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  acpi tcl tcl8.6
Suggested packages:
  tcl-tclreadline
The following NEW packages will be installed:
  acpi i8kutils tcl tcl8.6
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 51.8 kB of archives.
After this operation, 181 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 acpi amd64 1.7-1.1 [12.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 tcl8.6 amd64 8.6.10+dfsg-1 [14.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 tcl amd64 8.6.9+1 [5,112 B]
Get:4 http://archive.ubuntu.com/ubuntu focal/universe amd64 i8kutils amd64 1.43 [19.0 kB]
Fetched 51.8 kB in 2s (31.4 kB/s)   
Selecting previously unselected package acpi.
(Reading database ... 293832 files and directories currently installed.)
Preparing to unpack .../acpi_1.7-1.1_amd64.deb ...
Unpacking acpi (1.7-1.1) ...
Selecting previously unselected package tcl8.6.
Preparing to unpack .../tcl8.6_8.6.10+dfsg-1_amd64.deb ...
Unpacking tcl8.6 (8.6.10+dfsg-1) ...
Selecting previously unselected package tcl.
Preparing to unpack .../archives/tcl_8.6.9+1_amd64.deb ...
Unpacking tcl (8.6.9+1) ...
Selecting previously unselected package i8kutils.
Preparing to unpack .../i8kutils_1.43_amd64.deb ...
Unpacking i8kutils (1.43) ...
Setting up tcl8.6 (8.6.10+dfsg-1) ...
Setting up acpi (1.7-1.1) ...
Setting up tcl (8.6.9+1) ...
Setting up i8kutils (1.43) ...
Created symlink /etc/systemd/system/multi-user.target.wants/i8kmon.service → /lib/systemd/system/i8kmon.service.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.2) ...

Older Linux distro config (pre systemd)

Edit the file /etc/default/i8kbuttons and /etc/default/i8kmon and set ENABLED to 1:

ENABLED=1

Alternatively, use the sed command to do all your dirty work:

sed -i.bak 's/ENABLED=0/ENABLED=1/' /etc/default/{i8kmon,i8kbuttons}

Start the service (this is equivalent of running the modprobe -v i8k command):
# /etc/init.d/i8kmon start
Sample outputs:

 * Starting Dell Inspiron fan/cpu-temperature monitor i8kmon             [ OK ] 

Newer Linux distro with systemd

You need to edit and check for the /etc/i8kmon.conf file using the vim command or cat command:
$ cat /etc/i8kmon.conf
Default config file:

# Sample i8kmon configuration file (/etc/i8kmon.conf, ~/.i8kmon).
 
# External program to control the fans
set config(i8kfan)	/usr/bin/i8kfan
 
# Report status on stdout, override with --verbose option
set config(verbose)	0
 
# Status check timeout (seconds), override with --timeout option
set config(timeout)	2
 
# Temperature threshold at which the temperature is displayed in red
set config(t_high)	80
 
# Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
# These were tested on the I8000. If you have a different Dell laptop model
# you should check the BIOS temperature monitoring and set the appropriate
# thresholds here. In doubt start with low values and gradually rise them
# until the fans are not always on when the cpu is idle.
set config(0)   {{0 0}  -1  55  -1  60}
set config(1)   {{1 1}  50  65  55  70}
set config(2)   {{2 2}  60  75  65  80}
set config(3)   {{2 2}  70 128  75 128}
 
# Speed values are set here to avoid i8kmon probe them at every time it starts.
set status(leftspeed)	"0 1000 2000 3000"
set status(rightspeed)	"0 1000 2000 3000"
 
# end of file

Use the systemctl command to start/stop/restart the service:
$ sudo systemctl start i8kmon.service
$ sudo systemctl stop i8kmon.service
$ sudo systemctl restart i8kmon.service
$ sudo systemctl status i8kmon.service

How do I see the current status?

Type the following command
$ i8kctl
Here is what i see from my Dell laptop:

1.0 (null) XYZABC123 43 1 1 77130 78120 0 -1

Where,

  1. 1.0 i8k format version
  2. (null) bios version
  3. XYZABC123 machine id (Dell serial number)
  4. 43 cpu temperature
  5. 1 left fan status
  6. 1 right fan status
  7. 7713 left fan speed
  8. 7812 right fan speed
  9. 0 ac power status
  10. -1 : fn buttons status

Just print the CPU temp, enter:
$ i8kctl temp
Sample outputs:

52

Controlling fan speed on Dell laptop

First, just print the fan status info:
$ i8kctl fan
Sample outputs:

1 1

The fan command can accept two optional parameters which specify the new fan state for left and right fans. The state parameter can be:
Where,

  1. 0 : turn the fan off (not recommended)
  2. 1 : set low speed
  3. 2 : set high speed
  4. - : don’t change the state of this fan

For example, the following command sets the left fan (usually used by CPU) to high speed and leaves the right unchanged:
$ i8kctl fan 2 -
In this example, sets the left fan (usually used by CPU) to high speed and leaves the left unchanged:
$ i8kctl fan - 2
The following will set both fans to low speed:
$ i8kctl fan 1 1
This is equivalent of running the following commands:

 ## the syntax is ##
i8kfan leftFan rightFan
 
# Set left fan on high and leaves the right unchanged
i8kfan 2 -
 
# Set right fan on high and leaves the left unchanged
i8kfan - 2
 
# Set both fans to low 
i8kfan 1 1

Please note that the service /etc/init.d/i8kmon starts i8kmon in daemon mode. So setting the speed with i8kfan is pointless since the daemon will override the speed with its own value on fly as per system temperature.

Using sensors command

First, install and configure lm_sensors package as described here and type the following command to see information about your FAN and cpu core temperature:
$ sensors
Sample outputs:

Fig.01: sensors command in action -  show the current readings of all sensor chips on Dell laptop

Fig.01: sensors command in action – show the current readings of all sensor chips on Dell laptop

I also suggest that you use the acpi -V command to see the current battery status and thermal temperature under Linux operating systems.

See also
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
39 comments… add one
  • Lee May 16, 2013 @ 9:34

    How this would work for Dell XPS variants?

    • 🐧 nixCraft May 16, 2013 @ 11:43

      It should work as Ubuntu 12.04 LTS is official supported on many XPS variants. Why not try it out the commands and let us know the result?

      HTH.

  • M. Minhazul Haque May 16, 2013 @ 9:54

    Great article indeed. Would you please correct the following line?

    Start the service (this is equivalent of running the modprobe -v i8k command):
    # /etc/init.d/i8kmon start

    The start argument was missing.

    • 🐧 nixCraft May 16, 2013 @ 11:44

      The faq has been updated. I appreciate your post.

  • SuilAmhain May 16, 2013 @ 12:34

    Great Article. FYI, I always had stress with this on my Dell Studio 1735. systems locks etc…

  • PDK May 17, 2013 @ 15:23

    Is there any module for ASUS Laptops ??

  • alex Jun 13, 2013 @ 16:16

    I use fedora and I got a dell laptop yesterday. Not using the dedicated graphics seems to do the trick, but the simple fact of the matter is that i cannot spend all of my time checking the temperature and changing the fan speeds all the time. Seriously, didn’t anyone at Dell think about these scenarios? or did they even bother to test it a bit, at least with the most common distros (hint: ubuntu/debian/suse/fedora)?

  • Mohamed Jul 25, 2013 @ 4:03

    It’s great thanks , but I had a question .. the first parameter of the fan option is always “-1 ” what does that mean ?

    there is the out put of “i8kctl fan” it is “-1 1”

    and thanks a lot :)

  • Piotrek Sep 17, 2013 @ 8:48

    > there is the out put of “i8kctl fan” it is “-1 1″

    obviously your system does not have a left fan . . . ; -)

  • cybericius Nov 12, 2013 @ 20:33

    Hi,

    I would like to have some auto control for my Dell M4600 fans in Ubuntu since they are much louder in that than with Windows.
    Any suggestion?

    Thx!

  • Vitor Nov 23, 2013 @ 23:26

    Hi,

    I use ‘i8kmon’ from ‘i8kutils’ for fan auto control on my Dell, and that is running very nice.

    • Shannon Dec 8, 2013 @ 22:06

      How do you use this command to auto control the fan?

      • Vitor Mar 8, 2014 @ 14:25

        The command issued at init is

        tclsh /usr/bin/i8kmon --daemon --nouserconfig --auto
        • johannes Apr 30, 2016 @ 13:32

          after installing and running the commands there are to things
          1. fan turns on and of constantly =(
          2. it looks like it is set to auto

          set PROG_VERSION “v1.30 11/16/2013”

          array set config {
          sysconfig /etc/i8kmon.conf
          userconfig ~/.i8kmon
          i8kfan /usr/bin/i8kfan
          acpi “acpi”
          geometry {}
          use_conf 1
          auto 1
          daemon 1
          verbose 0
          timeout 5
          unit C
          t_high 80
          min_speed 2000

          and last there is no /etc/default/i8kbuttons and /etc/default/i8kmon
          e 6530 -linux mint
          some ideas
          thank you

  • Shannon Dec 8, 2013 @ 11:45

    Tried editing the files in the etc/default folder but I keep getting file permission erros, any work around to that?

  • paul Jan 6, 2014 @ 16:16

    thanks for this. i have an old D620 with lubuntu on it which was getting mega hot because the fan wouldn’t come on. problem solved now.

  • Matti Mar 8, 2014 @ 2:06

    Why enable i8kbuttons?

  • Vitor Mar 8, 2014 @ 14:29

    It seems it was used the old days. The manpage of i8kbuttons says
    ‘Monitor the status of Fn-buttons on Dell Inspiron laptops.’.
    But now, perhaps it is not necessary. I can say that for me it is not!

  • fredguy Mar 9, 2014 @ 12:53

    One question, why don’t the good people of i8kmon put the ENABLED standard on 1?
    I was struggling with permission hence the question. :-)

    I love linux but the temperature was so high, I hesitated, then found this site.
    It was a bit fiddly, but I love it. It just switched of automatically and now it started on speed 1 again. It is on 30 celsius now.

    Thank you

    • mike Apr 28, 2015 @ 21:18

      I have a dell D610 kernel 3.13 on Rebecca, I installed i8kutils by means of the software manager but still can’t access/manipulate the fan speed. After I set i8kctl fan 2 0 the fan runs fast for 5 seconds and then I’m right back to square one again. -1 0. Am I missing something?

  • jasray Apr 17, 2014 @ 18:49

    A bit lost here; the fan configuration for 1 and 1 as well as changing the etc file to enabled 1 works fine; how do I make the settings default? When I reboot the laptop, the fan speeds revert to normal which shows 1 and 3.

    Thanks!

  • riadh Sep 26, 2014 @ 22:11

    sed: impossible de lire /etc/default/i8kmon: No such file or directory exist
    sed: impossible de lire /etc/default/i8kbuttons: No such file or directory exist

  • Farasath Ahamed Oct 3, 2014 @ 17:48

    Followed this and worked fine…
    But after a while the fan seemed to stop working all together…
    Please help me to get this sorted out

  • oldcity Oct 18, 2014 @ 19:23

    Dell Latitude D810. Ubuntu 14.04.1 fully up to date.
    Did install latest i8kutils.

    Had following problems.

    $ sudo modprobe -v i8k
    gave no output for insmod

    # sed -i.bak ‘s/ENABLED=0/ENABLED=1/’ /etc/default/{i8kmon,i8kbuttons}

    sed: can’t read /etc/default/{18kmon,: No such file or directory
    sed: can’t read i8kbuttons}: No such file or directory

    # /etc/init.d/i8kmon start
    * Starting Dell fan/cpu-temperature monitor i8kmon [fail]

    Explain/help needed.
    tia

  • oldcity Oct 19, 2014 @ 11:47

    The sed -1.bak command gives:
    sed: can’t read /etc/default/i8kmon: No such file or directory exist
    sed: can’t read /etc/default/i8kbuttons: No such file or directory exist
    How to fix?
    The command /etc/init.d/i8kmon start
    shows [fail]
    What did I miss
    tia

  • oldcity Oct 23, 2014 @ 23:35

    Do not know what I did right or incorrectly but what I did above stands.
    Before beginning the install process the temp was at 54c.
    However yesterday when I powered up and left it on for a while and checked
    the temp it was down to 36c I maaged to check the right side vent and found
    the fan was in fact working.. I powered up again today and after 1 hour the
    temp was 36c and after 2 hours was 37c. The room temp was 26c.
    It would be nice if someone could resolve issues in my earlier post.
    Thanks for the program.

  • XviiGalaxy Nov 4, 2014 @ 20:04

    1.0 (null) 9SX2LX1 51 -1 1 27660 144630 0 -1
    This is result that I got, but I want to know why the fn is -1,and how to use fn function
    Thanks

  • Hugh Feb 22, 2015 @ 18:06

    Can this software allow me to set the temperature level for when the cooling fan is started, currently is turns on at 32 or 34 degrees (see below), with is too low, can I change this to a higher level?

    root@DELL-DEBIAN:/home/hugh# sensors
    coretemp-isa-0000
    Adapter: ISA adapter
    Core 0:       +32.0°C  (high = +105.0°C, crit = +105.0°C)
    Core 1:       +34.0°C  (high = +105.0°C, crit = +105.0°C)
  • Jimmy Sep 6, 2015 @ 2:22

    Thanks for this article, it’s been a lifesaver! Since I’ve been running this utility, both my left and right fans are acting erratically. They constantly switch on and off every few seconds. Your article mentioned that the daemon assumes control overriding any commands that you throw at it. Has anybody run into this issue?

  • KYD Sep 16, 2015 @ 1:40

    Vintage machine help
    machine:
    Dell
    Intel PII @ 397 Mhz
    256Megs RAM
    40 Gig HDD
    Ubuntu 15.04 Vivid
    Kernel 4.1.4-040104-gen

    i get the same error on this machine. but i do question the age of the laptop. It is old! but that aside, I have tried the above method with no resolve. I do not how ever, have any fan speed issues.
    Thanks for the article.

    Linux!
    It will work!

  • carlos Dec 19, 2015 @ 1:35

    I have 1 vostro 1510 , i install ubuntu 15.10 , after i install i8kutils (1.60) 1 have problens (freezes) , for my solution is :

    IN FILE : /etc/i8kmon.conf
    # Run as daemon, override with –daemon option:
    set config(daemon) 1
    # Automatic fan control, override with –auto option
    set config(auto) 0
    # Status check timeout (seconds), override with –timeout option
    set config(timeout) 2
    # Report status on stdout, override with –verbose option
    set config(verbose) 1
    # Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
    set config(0) {{-1 0} -1 50 -1 50}
    set config(1) {{-1 1} 50 70 50 70}
    set config(3) {{-1 2} 70 128 70 128}
    # end of file

    AND IN FILE : /etc/init.d/i8kmon

    I change line for : I8KMON_ARGS to :
    I8KMON_ARGS=”–daemon –noauto –nouserconfig “

    after have a flag –auto , for my causes freezes (i understain , automode try detect , but a moment to change values for fan , try change into fan 2 , and i no have 2 fan , i have 1 )

    note : my notebook have 1 fan not 2 , i found others peoples inform same problem in autodiscovery for i8kmon
    note 2 : if possible , try inform for this project to try create a check is possible fix auto detection for others models if have 1 fan .

    thx

    • Anonymous Jun 12, 2016 @ 22:27

      Changing

      I8KMON_ARGS="–daemon –nouserconfig –auto"

      to

      I8KMON_ARGS="–daemon –nouserconfig –noauto"

      in

      /etc/init.d/i8kmon

      Worked for my issues when fans would shut off and on to throttle temperature. Now constant on :)

  • Gustaf Hauruck Feb 6, 2016 @ 18:17

    Did not work on my DELL XPS 13 with ubuntu 14.04

    gus@XPS:~$ sudo apt-get install i8kutils

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      acpi
    The following NEW packages will be installed:
      acpi i8kutils
    0 upgraded, 2 newly installed, 0 to remove and 20 not upgraded.
    Need to get 39,2 kB of archives.
    After this operation, 162 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://de.archive.ubuntu.com/ubuntu/ trusty/universe acpi amd64 1.7-1 [13,8 kB]
    Get:2 http://ppa.launchpad.net/vitorafsr/ppa/ubuntu/ trusty/main i8kutils amd64 1.42-45~ubuntu14.04.1 [25,4 kB]
    Fetched 39,2 kB in 0s (149 kB/s)   
    Selecting previously unselected package acpi.
    (Reading database ... 1368873 files and directories currently installed.)
    Preparing to unpack .../archives/acpi_1.7-1_amd64.deb ...
    Unpacking acpi (1.7-1) ...
    Selecting previously unselected package i8kutils.
    Preparing to unpack .../i8kutils_1.42-45~ubuntu14.04.1_amd64.deb ...
    Unpacking i8kutils (1.42-45~ubuntu14.04.1) ...
    Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
    Processing triggers for ureadahead (0.100.0-16) ...
    ureadahead will be reprofiled on next reboot
    Setting up acpi (1.7-1) ...
    Setting up i8kutils (1.42-45~ubuntu14.04.1) ...
     * Starting Dell fan/cpu-temperature monitor i8kmon
     * Could not find /proc/i8k.
    invoke-rc.d: initscript i8kmon, action "start" failed.
    dpkg: error processing package i8kutils (--configure):
     subprocess installed post-installation script returned error exit status 1
    modprobe: ERROR: could not insert 'i8k': No such device
    Errors were encountered while processing:
     i8kutils
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    gus@XPS:~$ i8kctl temp
    can't open /proc/i8k: No such file or directory
    
    • Anonymous Oct 5, 2020 @ 9:58

      It worked on my system but you need to update repo first:
      sudo apt-get update
      sudo apt-get upgrade
      sudo apt-get install i8kutils

  • rob Oct 4, 2020 @ 14:34

    worked for my Dell Latitude E6510 – Thanks!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.