Foreword: This is the first blog post of a mini-series, trying to document some recipes about Debian Installer hacking. VirtualBox will probably be mentioned on a regular fashion, but most of those recipes should be easily adaptable to qemu/kvm.

Problem #1: How to share some d-i logs without using the network?

Slightly longer version: Investigating some issues on a wired-less virtual machine (Network → Adapter 1 → Disable Network Adapter), it’s hard to get log files out of the virtual machine.

Recipe #1: Use serial ports!

Serial Ports → Port 1 → Enable Serial Port, then pick Raw File as Port Mode, and specify a file on the host system to gather logs.

There’s nothing to do on d-i side, the serial console appears automatically as /dev/ttyS0. From a console, one can extract the needed bits:

cp /var/log/syslog /dev/ttyS0
dmesg > /dev/ttyS0