I have several ubuntu guests inside a Mac OS X virtualbox host. When I start them, about half of the time they correctly boot and get to their login screens/start all their services. The other half of the time, they sit waiting for me to choose an OS. This is fine when I'm sitting in front of them, but I'd like the VMs to automatically boot when the machine starts. It's worth noting that the same problem doesn't seem to happen if I do a reboot from within the guest OS.What I've tried:I've tried uncommenting GRUB_HIDDEN_TIMEOUT and running update-grub, this makes the guest OS boot correctly more often, but doesn't fix the problem. Booting them headlessly doesn't help either.Where they get stuck:/etc/default/grub:# If you change this file, run 'update-grub' afterwards to update# /boot/grub/grub.cfg.# For full documentation of the options in this file, see:#   info -f grub -n 'Simple configuration'GRUB_DEFAULT=0GRUB_HIDDEN_TIMEOUT=0GRUB_HIDDEN_TIMEOUT_QUIET=trueGRUB_TIMEOUT=2GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`GRUB_CMDLINE_LINUX_DEFAULT=GRUB_CMDLINE_LINUX=# Uncomment to enable BadRAM filtering, modify to suit your needs# This works with Linux (no patch required) and with any kernel that obtains# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)#GRUB_BADRAM=0x01234567,0xfefefefe,0x89abcdef,0xefefefef# Uncomment to disable graphical terminal (grub-pc only)#GRUB_TERMINAL=console# The resolution used on graphical terminal# note that you can use only modes which your graphic card supports via VBE# you can see them in real GRUB with the command `vbeinfo'#GRUB_GFXMODE=640x480# Uncomment if you don't want GRUB to pass root=UUID=xxx parameter to Linux#GRUB_DISABLE_LINUX_UUID=true# Uncomment to disable generation of recovery mode menu entries#GRUB_DISABLE_RECOVERY=true# Uncomment to get a beep at grub start#GRUB_INIT_TUNE=480 440 1Versions:Grub 1.99-21ubuntu3.9Ubuntu Server LTSVirtualbox 4.2.10
grub waits for user input when booting as guest in virtualbox
grub;virtualbox;headless
So, it turns out this is a documented feature of grub. If your computer shuts down abnormally, it won't boot into an OS automatically. This is why the problem never happened when I rebooted from within the OS.How to disableJust in case that link goes dead:Disable Grub2's recordfail featureFor most people, this new feature of Grub 2 is certainly a good thing. But for those plagued by one of the bugs or who would like to disable it for other reasons:Open the file /etc/grub.d/00_header viasudo nano /etc/grub.d/00_headerLook forif [ ${recordfail} = 1 ]; then    set timeout=-1else    set timeout=${GRUB_TIMEOUT}fiChange it toset timeout=5Save the file and runsudo update-grub