DEV Community

Cover image for Part 4 - Fixing the Ubuntu Server boot bug: drivers and cloud-init in VirtualBox
Melissa
Melissa

Posted on

Part 4 - Fixing the Ubuntu Server boot bug: drivers and cloud-init in VirtualBox

How I Fixed the Ubuntu "Bug Boot" in VirtualBox — From 2 CPUs to Disabling Cloud-Init

This is my first successful server setup. Last time I abandoned Ubuntu because I found another way to run my Python controller. Now I need a server again — for a Tor middle relay I want to run on a VPS soon — so I went back into gremlin and boot-bug territory. And this time, it booted.

The setup:
Oracle VirtualBox on my laptop. Ubuntu Server 24.04 LTS ISO. Goal: a local lab VM to learn server basics before renting a VPS.

The bug:
VM shows as "Running" in VirtualBox, but stuck on boot. Screen shows cloud-init tasks: A start job is running... or cloud-init waiting for network/datasource. Never gets to login.

What I tried first:

  1. Lowered CPUs from 2 to 1 vCPU — Tor and servers don't need much CPU, they need stable network.
  2. Turned OFF 3D acceleration in Display settings. Servers don't need graphics.

Still stuck.

The real fix: Disable cloud-init for this boot

Cloud images wait forever for a cloud network that VirtualBox NAT doesn't provide.

  1. Power Off the VM (not Save State).
  2. Start VM, immediately hold Shift or tap ESC to get GRUB menu.
  3. With Ubuntu highlighted, press e to edit.
  4. Ignore the top lines. Scroll DOWN with arrow keys past insmod, set root=...
  5. Find the line starting linux /vmlinuz-... root=UUID=... ro quiet splash (or just ... ro)
  6. At the very END of that line, add a space and: cloud-init=disabled No quotes. It should look like ... ro quiet splash cloud-init=disabled
  7. Press Ctrl+X or F10 to boot.

It booted to login.

Make it permanent:

Once logged in:

sudo touch /etc/cloud/cloud-init.disabled
sudo systemctl disable cloud-init cloud-init-local cloud-config cloud-final
sudo reboot

Now it boots in 15 seconds.

Lessons for next time:

  • If you don't need a cloud image, download "Ubuntu Server" ISO, not "Ubuntu Cloud".
  • Always take a snapshot right after first successful boot. I called mine "clean boot fixed".
  • 1 vCPU + 2GB RAM is plenty for a Tor middle relay lab. The challenge isn't power, it's uptime.

Next step: learning what it takes to keep a Tor middle relay up 24/7, so I'm ready for a VPS.

Bug boot graphic: that's exactly what it looks like while messing with your computing day.

Top comments (0)