« You know it's time to buy a Mac when... | Main | The not yet announced Path64 compiler suit »

June 24, 2009

HOWTO get virtualbox to redirect to a console COM1 / ttya for debbuging

This is a short HOWTO on getting virtualbox (vbox) to redirect output to COM1 aka ttya so you can connect via a "serial" connection outside of the virtual machine.  A few things you can use this for is logging the console output on boot or login from your normal work terminal of choice.

To start..

1) If you're on an opensolaris host.. You'll need socat or nc.  (Thanks go to Triskelios for pointing out nc will work as well)

If you're on ips

pkg install SUNWnetcat

or build socat-1.7 (2.x doesn't build and I haven't as of today had a chance to file a bug or send a patch.. someone should do this *cough* )

http://www.dest-unreach.org/socat/

(Not sure if it'll build with sun cc.. I was lazy and used gcc this time..)

2) Next configure your serial connection for the virtual machine..

enable serial ports

COM1

use host-pipe

create pipe

# then put the path ( I used /tmp/vboxlog )

3) When the virtual machine starts you'll see /tmp/vboxlog now exists

socat unix-client:/tmp/vboxlog stdout

or

nc -U /tmp/vboxlog

or

socat unix-client:/tmp/vboxlog stdout | tee boot.log

4) Modify your kernel line for grub to look like..

kernel /platform/i86pc/multiboot -B console=ttya,ttya-mode="115200,8,n,1,-"

----

From here you should be in business to catch the console output for the virtual machine when it boots.  Once you stop seeing output you can just connect without tee and login like normal..

I couldn't find this in the documentation anywhere so hope it help.. Let me know..

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e55181841888330115714eecc4970b

Listed below are links to weblogs that reference HOWTO get virtualbox to redirect to a console COM1 / ttya for debbuging:

Comments

The comments to this entry are closed.

The postings on this site are my own and don't necessarily represent NetSyncro.com Inc's positions, strategies or opinions.

OpenSolaris is a trademark of Sun Microsystems, Inc.