Skip to content

Instantly share code, notes, and snippets.

@foosel
Last active January 12, 2023 16:25
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save foosel/3abd45bc1b6ae121965b to your computer and use it in GitHub Desktop.
Save foosel/3abd45bc1b6ae121965b to your computer and use it in GitHub Desktop.
Getting the fingerprint reader of a Thinkpad x240 to work under Ubuntu 14.04

lsusb lists the fingerprint reader in the x240 as follows:

Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc.

There exists experimental driver support for this in a fork of libfprint for vfs5011 sensors, however you'll need to compile the driver yourself. To get the fingerprint sensor to work for lightdm login, su etc, follow these steps.

  1. Install fingerprint-gui:

    sudo add-apt-repository ppa:fingerprint/fingerprint-gui
    sudo apt-get update
    sudo apt-get install libbsapi policykit-1-fingerprint-gui fingerprint-gui
    
  2. Get your compilation tools and library dependencies:

    sudo apt-get install build-essential automake checkinstall shtool libtool libxv-dev libmagick++-dev
    
  3. Get the sources, compile and install them:

    git clone https://github.com/abbradar/fprint_vfs5011
    cd fprint_vfs5011
    ./autogen.sh
    make
    sudo make install
    
  4. Make sure your user has permissions for accessing the fingerprint sensor device. Create a file /lib/udev/rules.d/40-libfprint0-custom.rules with the following contents:

    # Device Validity VFS5011
    ATTRS{idVendor}=="138a", ATTRS{idProduct}=="0017", MODE="0664", GROUP="plugdev"
    
  5. Add your user to the plugdev group:

    sudo usermod -a -G plugdev <username>
    
  6. Restart udev:

    sudo service udev restart
    
  7. Log out of your session and log back in.

  8. Enroll your fingerprints with fingerprint-gui, verify them, then see if a sudo -s now suddenly asks you for your fingerprint.

@namore
Copy link

namore commented May 8, 2015

I had to install libusb-1.0-0-dev and libnss3-dev as well, running Ubuntu 15.04. It is apparently not possible to start a pull request on a Gist.

@MrMEEE
Copy link

MrMEEE commented Jun 17, 2015

I can't get it to work on 15.04...

The scanning seems stretched, and can't be verified???

@commonism
Copy link

For the distortion - swiping faster helps. (Lenovo x250, Ubuntu 1404)

@ccoenen
Copy link

ccoenen commented Aug 23, 2015

I did managed to set it up by adding the ubutu-ppa in my debian's /etc/apt/sources.list:

... other deb and deb-src lines i didn't touch

deb http://ppa.launchpad.net/fingerprint/fingerprint-gui/ubuntu utopic main 
deb-src http://ppa.launchpad.net/fingerprint/fingerprint-gui/ubuntu utopic main 

I then added their gpg-key (check it's validity yourself!)

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2F20733F

Afterwards, you can use aptitude / apt-get / synaptic or whatever you like to install the package fingerprint-gui:

apt-get install fingerprint-gui

As far as i can tell, it works alright.

(leavingit here, in case anyone else has a x240 / x250 and runs debian)

@Lesik
Copy link

Lesik commented Nov 4, 2015

@ccoenen

I am using a ThinkPad X240 with Debian 8 (Jessie). I only have the main repository enabled, so no non-free repositories enabled.

Since Ubuntu 14.04 (Trusty Tahr) is the newest LTS available (next one will come 2016 – 16.04), which may (but mustn't necessarily) mean that the packages are slightly more stable, I think it's smart to set the Ubuntu version to trusty instead of utopic (14.10, not an LTS), like you did:

deb http://ppa.launchpad.net/fingerprint/fingerprint-gui/ubuntu trusty main
deb-src http://ppa.launchpad.net/fingerprint/fingerprint-gui/ubuntu trusty main

On another note: I prefer to store individual third-party repositories in individual files. To do this, simply
# touch /etc/apt/sources.list.d/fingerprint-gui.list
(or whatever name you'd like), then put the content above in it.

I can confirm that after this the fingerprint scanner works. In fingerprint-gui your finger will look weirdly squished and pinched, and at first I thought the driver was not working correctly. I tried "verifying" my finger, and it always failed. Turns out that you have to be careful to precisely repeat the motion you did when registering the finger. I remember the fingerprint scanner in my old HP notebook, it didn't seem to be as picky as the X240's one. I had to try again and again many times until I finally got it work, so if you're reading this and can't get yours to work, don't give up. :)

@mauricioschneider
Copy link

Just to add to the last part of @Lesik comment, make sure you swipe your finger fast so you get an actual fingerprint look in the capture, instead of just a stretched fingerprint.

@neuthral
Copy link

i installed all packages and libraries, i didn't get the build to work after 'make' fprint, but i fingerprint-gui worked on ubuntu 17.10 and Thinkpad X240, i set up my fingerprint and now kdm login ask for fingerprint and it works!

@rokyo401
Copy link

rokyo401 commented Feb 4, 2019

I followed all the steps and when I do

sudo -s

I am asked for my fingerprint and if I swipe that, it authenticates. So that worked.

However, I cannot swipe my finger at login (Ubuntu 18.04.1). There is no option to enable fingerprint login in the 'Users' section of Ubuntu's preferences. Any idea how I can activate it? ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment