Overview
Today I transformed a broken Lenovo K20 laptop (dead screen) into a headless Debian 12 server using OpenClaw to manage the entire installation process remotely.
This post documents the challenges, solutions, and step-by-step process of installing Debian on a laptop with no display, using another computer (Raspberry Pi 5) as the installation platform.
The Problem
Hardware Situation
| Device | Status | Issue |
|---|---|---|
| Lenovo K20 | β οΈ Broken screen | Cannot see BIOS/installation |
| Raspberry Pi 5 | β Working | Used as installation platform |
| USB Boot Drive | β Debian 13 installer | Bootable installation media |
Challenges
- No display output - K20 screen is dead, external monitor not working
- Cannot navigate BIOS - Can't see boot menu or installation screens
- Need remote management - Must configure WiFi and SSH before first boot
- UEFI boot issues - Required proper EFI bootloader configuration
Solution: OpenClaw-Assisted Installation
Instead of traditional installation methods, I used OpenClaw (my AI assistant) to:
- Mount the K20 hard drive on Pi5 via USB adapter
- Create partitions and install Debian base system
- Configure WiFi credentials in advance
- Set up SSH for remote access
- Fix EFI bootloader for automatic startup
Step-by-Step Process
Phase 1: Hardware Preparation
# 1. Remove K20 hard drive (2.5" SATA)
# 2. Connect to Pi5 via SATA-to-USB adapter
# 3. Verify detection
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
Phase 2: Partition and Install
# Create GPT partition table
sudo parted /dev/sdc mklabel gpt
sudo parted /dev/sdc mkpart primary fat32 1MiB 513MiB
sudo parted /dev/sdc mkpart primary ext4 513MiB 100%
sudo parted /dev/sdc set 1 esp on
# Format partitions
sudo mkfs.vfat -F 32 /dev/sdc1
sudo mkfs.ext4 -F /dev/sdc2
Phase 3: Debootstrap Installation
# Install base Debian 12 (bookworm) system
sudo debootstrap --arch amd64 bookworm /mnt/k20 http://mirrors.ustc.edu.cn/debian
# Fix passwd package (common issue in chroot)
sudo chroot /mnt/k20 bash -c "touch /etc/shadow /etc/gshadow && chmod 640 /etc/shadow /etc/gshadow"
sudo chroot /mnt/k20 bash -c "dpkg --configure passwd"
sudo chroot /mnt/k20 bash -c "dpkg --configure -a"
Phase 4: Install Kernel and SSH
# Mount necessary filesystems for chroot
sudo mount --bind /dev /mnt/k20/dev
sudo mount --bind /proc /mnt/k20/proc
sudo mount --bind /sys /mnt/k20/sys
# Install kernel, GRUB, and SSH
sudo chroot /mnt/k20 bash -c "apt update && apt install -y linux-image-amd64 grub-efi-amd64 ssh network-manager vim"
Phase 5: Configure WiFi (Critical!)
Since the K20 has no display, it must connect to WiFi automatically on first boot:
# Create NetworkManager configuration
sudo tee /mnt/k20/etc/NetworkManager/system-connections/5G.nmconnection << 'EOF'
[connection]
id=5G
uuid=12345678-1234-1234-1234-123456789012
type=wifi
interface-name=wlan0
[wifi]
mode=infrastructure
ssid=η§η¨δ»₯ε€ͺδΉε
_5G
[wifi-security]
key-mgmt=wpa-psk
psk=65482908
[ipv4]
method=auto
[ipv6]
method=auto
EOF
sudo chmod 600 /mnt/k20/etc/NetworkManager/system-connections/5G.nmconnection
Phase 6: Create Users and SSH Keys
# Set root password
ROOT_HASH=$(openssl passwd -6 'k20root')
sudo tee /mnt/k20/etc/shadow > /dev/null << EOF
root:${ROOT_HASH}:19800:0:99999:7:::
EOF
# Create henry user
HENRY_HASH=$(openssl passwd -6 'k20henry')
sudo tee -a /mnt/k20/etc/shadow > /dev/null << EOF
henry:${HENRY_HASH}:19800:0:99999:7:::
EOF
Phase 7: Fix EFI Bootloader
This was the trickiest part - without proper EFI bootloader, the K20 won't start:
# Download GRUB EFI bootloader
curl -sL -o /tmp/grubx64.efi \
https://mirrors.ustc.edu.cn/debian/dists/bookworm/main/installer-amd64/current/images/netboot/debian-installer/amd64/grubx64.efi
# Copy to EFI partition
sudo cp /tmp/grubx64.efi /mnt/k20/boot/efi/EFI/BOOT/BOOTX64.EFI
sudo cp /tmp/grubx64.efi /mnt/k20/boot/efi/EFI/debian/grubx64.efi
# Create GRUB configuration
sudo tee /mnt/k20/boot/efi/EFI/BOOT/grub.cfg > /dev/null << 'EOF'
set timeout=5
search.fs_uuid f874e2b1-ea2f-4e0a-8cb2-8a1e8878a972 root
set prefix=($root)/boot/grub
configfile ($root)/boot/grub/grub.cfg
EOF
Results
| Metric | Value |
|---|---|
| Installation Time | ~2 hours |
| System | Debian 12 (bookworm) |
| Kernel | 6.1.0-42-amd64 |
| Disk Usage | 55.4G available |
| Boot Time | ~90 seconds |
| WiFi | β Auto-connect working |
| SSH | β Remote access working |
Lessons Learned
What Worked Well
- OpenClaw automation - AI assistant handled complex chroot operations
- Pre-configured WiFi - Critical for headless setup
- Debian debootstrap - Reliable base installation
- Manual EFI bootloader - Solved boot issues
Challenges
- qemu-user emulation - Some packages failed to configure in chroot
- EFI bootloader missing - Had to download and copy manually
- USB 2.0 speed - Slow data transfer (~3 MB/s)
- No display debugging - Couldn't see boot messages
Conclusion
Installing Debian on a laptop with a broken screen is challenging but entirely possible with the right approach. Using OpenClaw to automate the installation process and pre-configuring network settings made this a successful headless server setup.
Total cost: $0 (repurposing old hardware)
Time invested: ~2 hours
Result: Fully functional headless Debian server! π