2 minutes
Setting Up Serial Console Access on a Linux Server
If your server has a virtual serial port – like HP iLO, Dell iDRAC, or any BMC that exposes a serial console over SSH – this gets you keyboard-in-the-face access before the network stack is even up.
Useful for debugging boot issues, GRUB recovery, or just not having to walk to the machine room.
Find your serial port
sudo dmesg | grep tty
Look for something like ttyS0, ttyS1, etc. On many systems:
ttyS0= COM1 (first serial port)ttyS1= COM2 (second serial port)
The iLO virtual serial port usually appears as ttyS1. Adjust the
commands below to match your port.
Enable a serial getty
This lets you log in over the serial line.
sudo systemctl enable [email protected]
sudo systemctl start [email protected]
Replace ttyS1 with your port if different.
Configure GRUB for serial console
Edit the GRUB config:
sudo nano /etc/default/grub
Add or edit these lines. Adjust ttyS1 and --unit=1 to match your
serial port (unit 0 = COM1, unit 1 = COM2, etc.):
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS1,115200n8"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=1 --word=8 --parity=no --stop=1"
GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="gfxterm serial"
What each line does:
| Setting | Effect |
|---|---|
GRUB_CMDLINE_LINUX | Tells the kernel to send boot messages to the serial port |
GRUB_SERIAL_COMMAND | Configures the serial port speed and parameters |
GRUB_TERMINAL_INPUT | Lets you type into GRUB over serial |
GRUB_TERMINAL_OUTPUT | Shows the GRUB menu on both screen and serial |
Apply the changes:
sudo update-grub
Done
This enables console access at every stage:
| Stage | What you see |
|---|---|
| GRUB menu | Boot options, recovery mode |
| Kernel boot | Boot messages, driver loading |
| Runtime | Login prompt, full shell access |
The serial getty service gives you the login prompt after boot – you get a working shell over serial just like you would over SSH.
Reboot and connect from your BMC. Common connection commands:
| BMC | Command |
|---|---|
| HP iLO | SSH to iLO, then type VSP |
| Dell iDRAC | ssh iDRAC-ip -l root, then console com2 |
| Supermicro IPMI | ipmitool -H BMC-ip sol activate |
| QEMU/libvirt | virsh console vm-name or virt-viewer |
You should see the full boot process and be able to log in.
From now on you can interact with GRUB, watch kernel boot messages, and drop into single-user mode – all over the serial link.