Cloud-init not working in vagrant rocky cloud image?

Using latest cloud image for vagrant box:

Trying cloud-init the image and not working with error cloud-init is not found. ...

Tested with Ubuntu box and working OK: = “jammy-server-cloudimg-amd64-vagrant”
config.vm.box_url = “

Below the files and the error:


Vagrant.configure("2") do |config|
  config.vm.define "test1" = "rocky-9-Vagrant-VBox-x86_64"
  config.vm.box_url = ""

  config.vm.provider "virtualbox" do |v| = "rocky-9-test1"

  # cloud-init script
  config.vm.cloud_init do |cloud_init|
    cloud_init.content_type = "text/cloud-config"
    cloud_init.path = "cloud-init-test1.yml"




  list: |
  expire: False

And this is the error:

$ vagrant up

==> vagrant: You have requested to enabled the experimental flag with the following features:
==> vagrant: 
==> vagrant: Features:  cloud_init, disks
==> vagrant: 
==> vagrant: Please use with caution, as some of the features may not be fully
==> vagrant: functional yet.
Bringing machine 'test1' up with 'virtualbox' provider...
==> test1: Box 'rocky-9-Vagrant-VBox-x86_64' could not be found. Attempting to find and install...
    test1: Box Provider: virtualbox
    test1: Box Version: >= 0
==> test1: Box file was not detected as metadata. Adding it directly...
==> test1: Adding box 'rocky-9-Vagrant-VBox-x86_64' (v0) for provider: virtualbox
    test1: Downloading:
==> test1: Box download is resuming from prior download progress
==> test1: Successfully added box 'rocky-9-Vagrant-VBox-x86_64' (v0) for 'virtualbox'!
==> test1: Importing base box 'rocky-9-Vagrant-VBox-x86_64'...
==> test1: Matching MAC address for NAT networking...
==> test1: Setting the name of the VM: rocky-9-test1
==> test1: Clearing any previously set network interfaces...
==> test1: Preparing network interfaces based on configuration...
    test1: Adapter 1: nat
==> test1: Forwarding ports...
    test1: 22 (guest) => 2222 (host) (adapter 1)
==> test1: Preparing user data for cloud-init...
==> test1: Configuring storage mediums...
==> test1: Booting VM...
==> test1: Waiting for machine to boot. This may take a few minutes...
    test1: SSH address:
    test1: SSH username: vagrant
    test1: SSH auth method: private key
    test1: Vagrant insecure key detected. Vagrant will automatically replace
    test1: this with a newly generated keypair for better security.
    test1: Inserting generated public key within guest...
    test1: Removing insecure key from the guest if it's present...
    test1: Key inserted! Disconnecting and reconnecting using new SSH key...
==> test1: Machine booted and ready!
cloud-init is not found. Please ensure that cloud-init is installed and
available on path for guest 'test1'.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.