Skip to content

cloud-init

This content is not available in your language yet.

Every TebibHost image runs cloud-init on first boot. You can pass your own user data when you create a VM to install packages, create users, write files or run scripts.

Your user data is added next to TebibHost’s own part, which you can’t remove. That part:

  • installs the project SSH keys you picked for the image’s default user (ubuntu, debian, rocky, almalinux);
  • sets the hostname (the VM’s hostname, by default its name);
  • turns off password logins over SSH and logins as root;
  • grows the root partition and filesystem to fill the boot disk;
  • updates the package lists and installs qemu-guest-agent (used for consistent snapshots and to report the VM’s IPs and OS);
  • gives the VM a fresh machine ID;
  • configures the network for DHCP on IPv4 and IPv6.

Any format cloud-init accepts works: #cloud-config YAML, a shell script starting with #!, or a MIME multi-part file. The limit is 32 KiB. User data is read on the VM’s first boot only and can’t be changed after the VM is created.

web.yaml
#cloud-config
packages:
- nginx
write_files:
- path: /var/www/html/index.html
content: |
<h1>Hello from TebibHost</h1>
runcmd:
- systemctl enable --now nginx

In VMs → New VM, paste the file into cloud-init user data (optional).

Remember to open port 80 to see the page.

Package installs need the internet. Every VM has IPv6 outbound from the start, and the major distributions’ mirrors answer over IPv6. Sources that are IPv4-only need a NAT gateway or a public IP on the VM.

  • The output of your user data is in /var/log/cloud-init-output.log inside the VM.
  • cloud-init status --long shows whether it finished and any errors.
  • If you can’t log in at all, watch the boot on the serial console.

The API never returns user data after the VM is created, but it is stored with the VM and handed to it on a configuration disk that anyone with root in the VM can read. Keep long-lived secrets out of it, or rotate them after first boot.