I would like to create an out-of-band connection from my host to my
guest virtual machines so that I can see the grub menu and boot up
messages. On a real system, one can do this by redirecting grub and
console to a serial port. I was just wondering if this is possible
using Virtualbox.
I've googled a bit and there are hints that this may be possible using
a named pipe.
Regards,
- Robert
Got this to work with Ubuntu 10.04. There are roughly five steps:
1) enable a virtual serial device in VBox
http://www.opensourcery.co.za/2009/09/30/virtualbox-gentoo-and-serial-consoles/
2) enable serial grub
https://help.ubuntu.com/community/SerialConsoleHowto
3) enable serial bootup
https://help.ubuntu.com/community/SerialConsoleHowto
4) enable serial login
https://help.ubuntu.com/community/SerialConsoleHowto
5) use minicom to connect to pipe created in step 1
https://help.ubuntu.com/community/SerialConsoleHowto
Regards,
- Robert
In more specific detail. This assumes you have a VM running Ubuntu Lucid 10.04
1) add a serial port to the VM using the VBox GUI
Serial Ports > Port 1 tab
check Enable Serial Port
Port Number: Com1
Port Mode: Host Pipe
check Create Pipe
Path: /tmp/vbox-ubuntu-10.04
2) In /etc/default/grub, add or change this variable to have the
kernel output to the serial console
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
3) In /etc/default/grub, add or change these variables to have grub
display to the serial console
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8
--parity=no --stop=1"
4) Enable serial login
$ cat <<eof > /etc/init/ttyS0.conf
# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102
eof
5) Configure minicom
$ apt-get install minicom
$ cat <<eof > ~/.minirc.ubuntu-10.04
pu port unix#/tmp/vbox-ubuntu-10.04
eof
6) start the VM using the VBox GUI and start minicom. Alternatively,
you could start the VM using vboxheadless. For example:
$ vboxmanage list vms | grep -i lucid
"Ubuntu Lucid Server" {caf77ca8-912b-4cde-b31b-5343432ae3bd}
$ vboxheadless --startvm caf77ca8-912b-4cde-b31b-5343432ae3bd &
$ minicom ubuntu-10.04
Regards,
- Robert