In situation where there is no keyboard or display, you can use serial cable communications.
To configure serial input and output, in grub.cfg
all you need to do is:
grub> serial --unit=0 --speed=9600
grub> terminal_input serial; terminal_output serial
The key commands are: serial, terminal_input, and terminal_output.
Once done, you can interact with GRUB via serial cable.
That's all about GRUB serial communications.