Skip to content

cloud init not working #1655

@ty2

Description

@ty2

Version

v5.0.0 (2025-10-27)

Environment

VirtualBox: 7.2.4 r170995
Host OS: Arch Linux

Scenario

Start a Vagrant VM with the official bento/ubuntu-24.04 box and create an additional user (user1) via cloud-init.

Steps to Reproduce

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-24.04"

  config.vm.provider "virtualbox" do |v|
    v.name = "node1"
    v.memory = 1024
    v.cpus = 2
  end

  config.vm.cloud_init :user_data do |cloud_init|
    cloud_init.content_type = "text/cloud-config"
    cloud_init.path = "cloud.cfg"
  end

end

cloud.cfg

#cloud-config

users:
  - name: user1
    sudo: "ALL=(ALL) NOPASSWD:ALL"
    plain_text_passwd: 123456
    lock_passwd: false

  1. Create the Vagrantfile and cloud.cfg as shown above.
  2. run vagrant up
  3. After the VM is up, run vagrant ssh
  4. Run cat /etc/passwd | grep user1 or id user1, check if user1 is exists.

Expected Result

cloud-init processes the provided cloud.cfg file during first boot and creates the user user1.

Actual Result

No user user1 is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UntriagedAn issue that has yet to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions