I assume you have a Virtual Macine with CentOS 8 installed and want to make it ready for cloud-init:
Login as root user and check the status of the selinux via command
setatus
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-1.png)
In case like above it is enabled then edit the file /etc/sysconfig/selinux, then disable the selinux.
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image.png)
Reboot the machine and check it again via sestatus, it mus be disabeld
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-2.png)
yum install -y cloud-init
yum install -y perl
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-3.png)
Create a file for network configuration and input : network: {config: disabled}
This will configure cloud init to skip the network configuration
vi /etc/cloud/cloud.cfg.d/99-custom-networking.cfg
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-4.png)
Press shift + zz to save the document, issue the following command
cloud-init clean
then shutdown the machine via :
init 0
Go to the properties of VM, and configure the CD/DVD like below
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-5.png)
At the end convert the VM to the Template.
![](https://www.vmehrabi.com/wp-content/uploads/2023/08/image-6.png)