To get a virtual serial console, you need to enable the iLO virtual serial port. I had mine set up like this:
- iLO 2 Virtual Serial Port: COM2 0x2F8 IRQ 3
I also enabled ssh access in the iLO web interface. This way I can ssh into the iLO and see all BIOS messages using the “vsp” command. I can even go to the BIOS setup (RBSU) by pressing “ESC-9”.
To be able to control GRUB via the virtual serial port, it has to be configured. I changed the following lines in /etc/default/grub:
1 2 3 4 5 |
GRUB_HIDDEN_TIMEOUT=15 GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=15 GRUB_CMDLINE_LINUX="text console=tty0 console=ttyS1,115200n8" GRUB_TERMINAL=console |
You must run “update-grub” after editing that file to generate the boot configuration.
The GRUB_HIDDEN_TIMEOUT is the number of seconds to wait for ESC before booting the default kernel. You can press ESC and select another kernel using the virtual serial console.
The GRUB_HIDDEN_TIMEOUT_QUIET=false shows a countdown, so you know when exactly to press ESC.
The GRUB_CMDLINE_LINUX directs Linux kernel messages to both console (tty0) and serial port COM2 (ttyS1). You can configure the speed (115200) in the iLO setup.
To get a login prompt after boot, I added a file named /etc/init/ttyS1.conf with the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# ttyS1 - getty # # This service maintains a getty on tty1 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[2345] and ( not-container or container CONTAINER=lxc or container CONTAINER=lxc-libvirt) stop on runlevel [!2345] respawn exec /sbin/getty -8 115200 ttyS1 |
That will start a getty on the virtual serial port.
Now I can log in via the iLO if I mess up the network configuration. I can also perform salvage operations at boot time in case filesystem checks fail.
This has been tested on Ubuntu Server 12.04.2 LTS x86_64.
The iLO2 is a bit fussy about ssh public keys. You can upload your key, but I had to make a copy of my id_dsa.pub and change the userid part in the end to exactly match the iLO2 username. You have to remove any @host after the username.
Thank you! This worked perfectly on my Proxmox 5.x / iLO 2 setup 🙂