Copyright 2012 Stephen Niedzielski. Licensed under GPLv3.
- Download the latest Ubuntu Server LTS daily.
iso=precise-server-amd64.iso
mkdir iso_r
sudo mount "$iso" iso_r
cp -a iso_r iso_rw
sudo umount iso_r
rmdir iso_r
- Edit iso_rw/boot/grub/grub.cfg.
- Under the "Install Ubuntu Server" entry, append:
console=ttyS0,115200n8
- Before the first
menuentry
add: 1.serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
1.terminal --timeout=2 serial console
- Edit iso_rw/isolinux/isolinux.cfg.
- Comment out:
#ui gfxboot bootlogo
- Append:
serial 0 115200 0ร003
- Edit iso_rw/isolinux/txt.cfg.
- Under the "Install Ubuntu Server" entry, append:
console=ttyS0,115200n8
sudo genisoimage -input-charset utf-8 -r -V 'Ubuntu Server' -cache-inodes -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o "$iso" iso_rw
sudo chown $(id -u):$(id -g) "$iso"
sudo rm -rf iso_rw
Note: Ubuntu Server 12.04 LTS consumes about 1.8 GB. I recommend a 4 GB install.
socat UNIX-CONNECT:/tmp/precise_server_serial_0_pipe PTY,link=/tmp/precise_server_serial_0_pty&
echo stty cols $COLUMNS rows $LINES
(Copy and paste this after logging into the VM.)screen /tmp/precise_server_serial_0_pty 115200
Note: sudo adduser "$USER" dialout
- Edit /etc/default/grub.
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,115200n8"
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
- Write the changes to /boot/grub/grub.cfg:
sudo update-grub
. sudo reboot 0
.
See also: info -f grub
- Insert the disk.
mount
to find the disk.sudo umount #/media/...
- Ensure it's hosed
sudo mkfs.vfat -I #/dev/sdX
to prevent misconceptions. time vboxmanage clonehd --format RAW ~/VirtualBox\ VMs/precise_server_serial_0/Snapshots/\{0295b898-a4c5-415a-805e-69b70d00feb9\}.vdi ~/work/ubuntu_serial/precise_server_serial_0.img
. This took about two 13 seconds. Note: avoid the pitfall of grabbing the root VDI. You can also write straight to/dev/sdX
. If all works well, you should see a file that's exactly 2 GB. Note: don't useqemu-img convert
. It's appears to be busted!time sudo dd if=precise_server_serial_0.img #of=/dev/sdX
. This took about 18 minutes to copy over a USB to SD converter on a class 10 card and about 27 and a half minutes on an unmarked card, and about five and half minutes over a USB to SATA converter. If all works well, you should see some parititons ingparted
.
sudo qemu-system-x86_64 -nographic #/dev/sdX
(Exit it with ctrl-a x).