We can configure Ubuntu machine to connect to it via serial console port(COM port).It will help us to administer the machine when there is no input devices(mouse, keyborad) or no network is available.
Enabling serial console has been changed in GRUB 2.Change GRUB_CMDLINE_LINUX to start console on ttyS0.
Open grub configuration file /etc/default/grub.
sudo vim /etc/default/grub
Set below entries to GRUB_CMDLINE_LINUX
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,38400n8"
Add serial console entries to the same file
## Serial console
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1"
Update GRUB
sudo update-grub
Reboot the machine check if changes were successful.Run the command below.
sudo cat /proc/cmdline
Output:
BOOT_IMAGE=/boot/vmlinuz-3.13.0-24-generic root=UUID=4c4e78f3-fb88-4617-bf9c-34a53e05c7b2 ro console=tty0 console=ttyS0,38400n8 quiet splash vt.handoff=7
console=tty0 console=ttyS0,38400n8 entry confirms that serial console is enabled.