In the previous post I told you how to get cloud-init to work in non-cloud environments.
What if you need to disable cloud-init entirely?
With systemd services and guestfish this is easy:
$ guestfish -a disk.img -i \ ln-sf /dev/null /etc/systemd/system/cloud-init.service
Why not use this opportunity to get rid of tmp-on-tmpfs at the same time:
$ guestfish -a disk.img -i \ ln-sf /dev/null /etc/systemd/system/tmp.mount
Systemd’s design of mapping services to files also makes it easy to list the available services in a guest:
$ virt-ls -a /tmp/fedora-19.img -R /lib/systemd/system