I created config files

echo 'password: asd' > userdata
echo 'local-hostname: localhost' > metadata

Then created iso from them

genisoimage -output geniso.iso -volid cidata -joliet -rock userdata metadata

And created QEMU image

virt-install --connect qemu:///system virt-type qemu --name mymachine --memory 4096 --vcpus=2 --os-type linux --os-variant ubuntu18.04 --disk path=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2 --disk  geniso.iso,device=cdrom --import --network network=default --noautoconsole

Screenschot below shows that machine has been changed to localhost but the password did not work. enter image description here

1 Answer 1


The cloud-init config format is a bit more structured than what you used. And the minimal change to your case is to recognize that the leading #cloud-init isn't optional.

Your question is pretty close to this or this example, so I recommend to get your remaining details there as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.