I just installed Linux (Ubuntu, but it does not really matter) on an x86-based tablet. I also encrypted a partition which is mounted during bootup. Of course, one usually needs to enter the password to unlock the partition during bootup.

Is there a way to unlock (cryptsetup luksOpen) the partition with onscreen keyboard (touchscreen only, no physical keyboard present!) before the first user logs in?

The onscreen keyboard (Onboard) works very well during login (in gdm or other display manager) and later on.

I do realise X has not started at the normal time /etc/init.d/boot.crypto (or newer systemd) interactively requests passwords according to /etc/crypttab, so the question could mean, is there a way to defer unlocking until X has started (but before a user logs in).

PS: The process usually showing the password prompt is plymouth which asks for a password using https://wiki.ubuntu.com/Plymouth#A.22plymouth_ask-for-password.22. It does use a graphical display mode but I think not X?! A lightdm integration would be the other alternative (with onscreen keyboard readily available).

  • @frostschutz That does look like a solution - even if it's a hack, it's a nice hack. Perhaps TNT or you want to translate and localise it to English GB||US and turn into an Answer? – Ned64 Aug 18 at 12:18

After searching and trying for a long, long time, I finally found a solution which is acceptable for me. The situation is rather complex, so I try to describe it as structured as possible.


Hardware configuration: DH87RL board i7-4771 CPU GeForce GTX 970

Software configuration: Ubuntu 15.10

Driver selection

You can either go with the open nouveau driver which is installed by default, or use the proprietary nvidia driver. Next, the "plymouth" package which enables you to configure the graphical boot up, is strongly involved. Using the nvidia driver together with plymouth does not work for me, but for all other 3 possible combinations, the solution is described below.

There are 2 issues here closely connected, one is being able to enter the password for encrypted hard disks during boot, and the other is being able to switch to the console when X is up and running. Both issues are described below.

Being able to enter the password for encrypted hard disks during boot

Nouveau driver with plymouth: The Nouveau driver works "ok" - this means I have to press the down arrow on the keyboard while booting so the text mode appears. There, the password is asked. (Some stars may already be displayed - delete them before entering the password...)

This solution was ok, but I needed the nvidia driver to work, because with nouveau, for example, I had no proper 3D acceleration inside virtualbox.

Nvidia driver without plymouth: The nvidia driver I use is nvidia-352 currently. I installed it via apt-get. So I did not download and install the driver from the nvidia.com site directly, but used the distribution (in my case: Ubuntu 15.10) package for the nvidia driver instead.

For the nvidia driver to work, I had to disable plymouth. This can be done for example by passing the "noplymouth" option to the kernel parameters.

--- /etc/default/grub (example) ---

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noplymouth"

--- update-grub ---

Afterwards, execute update-grub from the command line:

# update-grub

With that changes, I can see the screen flicker shortly during the graphical boot (obviously the password prompt appearing for a fraction of a second, and then disappearing again). But now I know that the password prompt is there, and I can start to type the password. The prompt will reappear with the first character typed, having recognized the typed character already. If insecure whether the password prompt is ready or not, I can still press the down arrow as described above.

Yes, that´s not a perfect solution - but after searching and trying for such a long, long time: At least it is working - and you can get used to it.

Just out of curiosity, I also tried the nouveau driver with plymouth disabled: In that case it works much smoother, as the password prompt really appears and stays on the screen.

So it seems the free nouveau driver is doing something better than the nvidia driver. I guess NVIDIA has some homework to do here!

Switch to console

With the nouveau driver, it is easily possible to switch to the console (CTRL-ALT-F1)

With the nvidia-352 driver, switching to the console is NOT possible! Pressing CTRL-ALT-F1 just does nothing. A (n ugly) workaround I found for this is to restart the window manager from within your X session. Working for me with lightdm as windows manager, not tested for others. Please save all your open documents BEFORE doing this, as all applications of your X session will be killed: sudo service lightdm restart

So again, the nouveau driver does this better than the official nvidia driver. I need to say that I´m really disappointed by NVIDIA about that!

  • Thanks for the reply. Without trying it (have not done yet, but will when I have the time) it is a little difficult for me to really judge whether this solves the problem. Can you confirm that you can boot a computer with LUKS system partition without a physical keyboard using your method? – Ned64 Feb 4 '16 at 21:58
  • 1
    Sorry, Ned64 - during all the reading I ended up just scanning the articles for buzzwords. So I missed the point that this here is about tablet - urghs :-( So I guess my answer won´t help you much - sorry again. If you prefer, please delete it from this post. – masand Feb 10 '16 at 20:25
  • 1
    As you have noted, your answer doesn't really apply to the OP's question. You can easily delete it yourself if you agree. – TooTea Aug 15 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.