Skip to content

Instantly share code, notes, and snippets.

@ajmcmiddlin
Last active September 13, 2017 07:04
Show Gist options
  • Save ajmcmiddlin/f7631ebcf7ddd709d559f57b85390861 to your computer and use it in GitHub Desktop.
Save ajmcmiddlin/f7631ebcf7ddd709d559f57b85390861 to your computer and use it in GitHub Desktop.
Fixes required for a portable OVA made from an Ubuntu Vagrant box.

Fixing Ubuntu OVAs made with Vagrant

Context

We have a Vagrantfile in fp-course for creating an Ubuntu environment with course prerequisites available. If you export an appliance (OVA) from the resultant VM, it will have issues when you import it on other machines.

Symptoms

Booting the VM fails with a message referencing a missing log (e.g. ubuntu-xenial-16.04-cloudimg-console.log).

If you find the reference to this log in the machine's settings, you'll see it's the output for a serial port connection. If you disable the serial port, then boot will block at a message that includes “non blocking pool is initialized”.

Cause

The default image used by Vagrant has a serial port that outputs to a log file. The path to this file is a hardcoded absolute path on the machine that created the VM.

Fix

  1. Change the path to the file in the serial port's settings to something that exists (or can be created).
  2. Boot the machine
  3. Edit /etc/default/grub and /etc/default/grub.d/*.cfg, removing any references to console=ttySn, where n is likely 0. You should find these on lines setting GRUB_CMDLINE_LINUX_DEFAULT.
  4. Run sudo update-grub
  5. Check there are no references to ttySn in /boot/grub/grub.cfg
  6. Power off the machine
  7. Disable the serial port

References

https://askubuntu.com/questions/771871/16-04-virtualbox-vm-from-vhd-file-hangs-at-non-blocking-pool-is-initialized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment