Headless Ubuntu server on a Lenovo Thinkcentre M53 Tiny
📆 2024-11-14 14:52
After about 8 hours or trying different BIOS settings, Google-ing and swearing I managed to install Ubuntu Server 24.04 LTS on a Lenovo Thinkcentre M53 and got it to boot without a keyboard and a monitor attached.
Overview
I actually installed Ubuntu on 3 different M53's.
[Photo]
I bought them used with 8GB of RAM and 500GB HDD's. Actually, this page is now served by one of the 3 Lenovo M53's. They are now a K3S cluster in my living room.
Specs
Installing Ubuntu Server
The latest Ubuntu Server version available when doing this was 24.04. I'm not going to talk about creating a bootable USB drive, you probably know how to do that.
Failed tries
My first installation failed. I just pressed F1 to enter the BIOS, moved my Flash drive at the top of the list of bootable devices, saved and exited.
Ubuntu installation failed with GRUB unable to install error (can't remember the exact message and I don't plan on replicating the issue 😀).
Because I'm human, I thought I'd give it another go and, as expected, the result was the same 😵.
Succesful install
After some Google-ing, I remember reading on ubuntuforums.org that GRUB might not install on Lenovo's fail safe BIOS defaults.
Back in BIOS, I did the following:
- enabled Wake On Lan (not necessary for installing Ubuntu but useful in the future)
- disabled Secure Boot
- disabled CSM
And I gave it another go. This time I manually configured the partitions by:
- selecting the HDD and the option Use as boot drive which creates the EFI partition
- creating the rest of the space into ext4 and mounting it to /
- no SWAP was created
Ubuntu and GRUB installed. I removed the flash drive, rebooted and saw that Ubuntu server booted.
At this time, I had an USB keyboard and a monitor connected via VGA. I shutdown the PC, removed the keyboard and monitor and powered it on again. The light was on but no HDD activity other than 2, maybe 3 blinks after the power button was pressed. I waited for a bit and tried to ssh into it with no success.
Making it boot headless
There are a few settings which I tried until I found something that worked. First of all the
BIOS settings
I had to
- enable Keyboardless operation
- disable Startup device menu prompt
- enable Quick boot
- set HDD as primary boot device under Primary boot sequence, Error boot sequence and Automatic boot sequence
GRUB settings
It's a simple fix but it took me another 20 minutes to figure it out with Google in front of me. You have to disable GRUB's graphical terminal by editing the config file located at /etc/default/grub and uncommenting the line that contains #GRUB_TERMINAL=console . Yes, you just remove the # 😀
Stupid things happen
The second Lenovo M53 still wouldn't boot headless after I applied all the settings mentioned above. After a bit of comparing I realised I had to insert 2 more settings into GRUB's config file located at /etc/default/grub which is GRUB_TIMEOUT_STYLE=hidden and GRUB_TIMEOUT=0
I don't know why on the second machine these values were not present in GRUB's config file.
Summary
In order to have a headless Ubuntu server running on a Lenovo M53 tiny (and probably other similar Lenovo's) you have to change settings under BIOS for installing Ubuntu and edit GRUB's default configuration for a succesful boot without a monitor connected.
Hope this helps!