Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Installing & Configuring Cloud-Init on ISO-Built Ubuntu 22.04 VMs

Rumi, May 27, 2026May 27, 2026

Target OS : Ubuntu 22.04 LTS (installed from ISO) should also works on 20.x release
Hypervisor : Proxmox VE
Cloud-Init Ver : 25.3-0ubuntu1~22.04.1 (or later)

================================================================================
1. PREREQUISITES
================================================================================

- Ubuntu 22.04 VM running on Proxmox VE
- Root/sudo access inside the VM
- VM must have internet connectivity
- All commands are run INSIDE the VM (not on the Proxmox host)

================================================================================
2. INSTALL CLOUD-INIT
================================================================================

sudo apt update
sudo apt install cloud-init -y

================================================================================
3. ENABLE CLOUD-INIT SERVICES
================================================================================

sudo systemctl enable cloud-init
sudo systemctl enable cloud-init-local
sudo systemctl enable cloud-config
sudo systemctl enable cloud-final

================================================================================
4. CONFIGURE CLOUD-INIT FOR PROXMOX (NoCloud DATASOURCE)
================================================================================

4a. Create the Proxmox datasource config:

sudo nano /etc/cloud/cloud.cfg.d/99_proxmox.cfg

Paste the following:

--- START OF FILE ---
datasource_list: [NoCloud, None]
disable_root: false
ssh_pwauth: true
--- END OF FILE ---

4b. Create the network renderer config:

sudo nano /etc/cloud/cloud.cfg.d/99_network.cfg

Paste the following:

--- START OF FILE ---
system_info:
network:
renderers: ['netplan']
--- END OF FILE ---

!! CRITICAL WARNING !!
The renderer config MUST be under ‘system_info:’ and NOT under the top-level ‘network:’ key. Putting ‘renderers’ or ‘version’ under the top-level ‘network:’ key will cause cloud-init to treat them as actual network config, resulting in this error:

RuntimeError: Unknown network config version: None

WRONG:
network:
renderers: ['netplan']
version: 2

CORRECT:
system_info:
network:
renderers: ['netplan']

================================================================================
5. REMOVE INSTALLER OVERRIDE FILES
================================================================================

Ubuntu ISO installs leave files that BLOCK cloud-init from working.
Remove them:

sudo rm -f /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
sudo rm -f /etc/cloud/cloud.cfg.d/99-installer.cfg

Explanation of what each file does:

subiquity-disable-cloudinit-networking.cfg
– Contains: network: {config: disabled}
– Effect: Completely disables cloud-init network configuration

99-installer.cfg
– Contains: datasource_list: [None] plus hardcoded instance-id
– Effect: Overrides our NoCloud datasource, prevents cloud-init
from reading the Proxmox CloudInit drive
– Also sets: preserve_hostname: true, resize_rootfs: false,
growpart: mode: ‘off’ — all of which block cloud-init

The following files are SAFE to keep:
– 05_logging.cfg
– 90_dpkg.cfg
– curtin-preserve-sources.cfg
– README

================================================================================
6. REMOVE OLD STATIC NETPLAN CONFIG
================================================================================

!! CRITICAL STEP !!
The file /etc/netplan/00-installer-config.yaml is generated by the Ubuntu installer (subiquity) and contains hardcoded network settings. It takes priority over cloud-init’s generated config
(50-cloud-init.yaml) because ’00-‘ sorts before ’50-‘.

If NOT removed, cloud-init’s network config will NEVER take effect.

BACKUP FIRST (so you can restore network if something goes wrong):

sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bak

Then remove it:

sudo rm -f /etc/netplan/00-installer-config.yaml

================================================================================
7. CLEAN MACHINE-UNIQUE IDENTIFIERS
================================================================================

These must be reset so future clones get unique identities:

sudo truncate -s 0 /etc/machine-id
sudo rm -f /var/lib/dbus/machine-id
sudo ln -sf /etc/machine-id /var/lib/dbus/machine-id
sudo rm -f /etc/ssh/ssh_host_*
sudo rm -rf /var/lib/cloud/

================================================================================
8. REGENERATE SSH HOST KEYS (FOR CURRENT VM)
================================================================================

sudo ssh-keygen -A
sudo systemctl restart ssh

Verify keys exist:

ls -la /etc/ssh/ssh_host_*

You should see at least 3 key pairs (rsa, ecdsa, ed25519).

================================================================================
9. DISABLE CLOUD-INIT ON CURRENT VM (PROTECT EXISTING CONFIG)
================================================================================

sudo touch /etc/cloud/cloud-init.disabled

This prevents cloud-init from running on the CURRENT VM, preserving your existing configuration. Cloud-init remains installed and enabled for future use — it simply skips execution when this file exists.

When you later clone/template this VM, REMOVE this file so clones run cloud-init on first boot.

================================================================================
10. ADD CLOUDINIT DRIVE IN PROXMOX
================================================================================

On the Proxmox host web UI:

1. Select the VM in the left panel
2. Go to Hardware tab
3. Click Add → CloudInit Drive
4. Select storage (e.g., local-lvm or local)
5. Click Add

After adding, the Cloud-Init tab in the VM's menu will become active
(no longer grayed out). You can configure:
- User
- Password
- SSH public key
- DNS domain and servers
- Network (IP, gateway, netmask)

================================================================================
11. REBOOT AND VERIFY (CURRENT VM)
================================================================================

sudo reboot

After reboot, verify:

cloud-init status
Expected: status: disabled

systemctl status ssh
Expected: active (running)

systemctl is-enabled cloud-init
Expected: enabled

ls /etc/cloud/cloud-init.disabled
Expected: file exists

================================================================================
12. TEST CLOUD-INIT (REMOVE DISABLED FILE)
================================================================================

When ready to test that cloud-init works with Proxmox:

12a. Configure cloud-init settings in Proxmox GUI:
– Go to Cloud-Init tab
– Set: User, Password, SSH Key, IP, Gateway, DNS
– Click “Regenerate Image” button at the top

12b. Inside the VM, enable cloud-init:

sudo rm /etc/cloud/cloud-init.disabled
sudo cloud-init clean --logs
sudo rm -rf /var/lib/cloud/
sudo reboot

12c. After reboot, verify:

cloud-init status
Expected: status: done
ip addr show
Expected: IP matches what was set in Proxmox Cloud-Init tab

cat /etc/netplan/50-cloud-init.yaml
Expected: Contains proper netplan config with Proxmox IP,
gateway, and DNS

12d. Verify the cloud-init drive was read:

sudo mkdir -p /mnt/ci
sudo mount /dev/sr0 /mnt/ci
cat /mnt/ci/network-config
cat /mnt/ci/user-data
cat /mnt/ci/meta-data
sudo umount /mnt/ci

================================================================================
13. CREATING A PROXMOX TEMPLATE (FOR FUTURE USE)
================================================================================

To convert this VM into a cloneable template:

13a. Inside the VM:

sudo rm -f /etc/cloud/cloud-init.disabled
sudo cloud-init clean --logs
sudo rm -rf /var/lib/cloud/
sudo rm -f /etc/ssh/ssh_host_*
sudo truncate -s 0 /etc/machine-id
sudo shutdown -h now

13b. On the Proxmox host web UI:

– Right-click VM → Convert to template
– Select template → Hardware → Add → CloudInit Drive (if needed)
– Go to Cloud-Init tab → Configure user, password, SSH key, network
– Click “Regenerate Image”

13c. To deploy a new VM from the template:

– Right-click template → Clone
– Choose: Linked Clone or Full Clone
– Go to Cloud-Init tab → Set unique IP and hostname
– Click “Regenerate Image”
– Start the clone
– Cloud-init runs on first boot automatically

================================================================================
14. TROUBLESHOOTING
================================================================================

+————————————-+———————————–+
| SYMPTOM | CAUSE & FIX |
+————————————-+———————————–+
| cloud-init status: disabled | Normal — cloud-init.disabled file |
| | is present. Not an error. |
+————————————-+———————————–+
| RuntimeError: Unknown network | 99_network.cfg has renderers |
| config version: None | under top-level ‘network:’ key |
| | instead of ‘system_info:’. |
| | FIX: Use system_info: > network: |
| | > renderers: [‘netplan’] |
+————————————-+———————————–+
| IP not changing despite Proxmox | Old 00-installer-config.yaml is |
| cloud-init config | still present and overriding. |
| | FIX: rm /etc/netplan/00-installer- |
| | config.yaml |
+————————————-+———————————–+
| cloud-init status: error | Check logs: |
| | cat /var/log/cloud-init.log |
| | cat /var/log/cloud-init-output.log|
| | cloud-init status –long |
+————————————-+———————————–+
| SSH host keys missing after reboot | Regenerate: |
| | sudo ssh-keygen -A |
| | sudo systemctl restart ssh |
+————————————-+———————————–+
| NoCloud datasource not found | CloudInit Drive not attached in |
| | Proxmox. FIX: Hardware > Add > |
| | CloudInit Drive |
+————————————-+———————————–+
| datasource_list: [None] overriding | 99-installer.cfg still present. |
| NoCloud | FIX: rm /etc/cloud/cloud.cfg.d/ |
| | 99-installer.cfg |
+————————————-+———————————–+
| Network lost after reboot | Restore from backup: |
| | sudo cp /etc/netplan/00-installer- |
| | config.yaml.bak /etc/netplan/ |
| | 00-installer-config.yaml |
| | sudo netplan apply |
+————————————-+———————————–+
| “No CloudInit Drive found” grayed | CloudInit Drive not yet added. |
| out in Proxmox GUI | FIX: Hardware > Add > CloudInit |
| | Drive |
+————————————-+———————————–+

Administrations Configurations (Linux) Proxmox Cloud-initProxmoxUbuntuUbuntu 20Ubuntu 22

Post navigation

Previous post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx openvpn pfsense php Postfix Proxmox RDP Softether SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin Windows 10 XCP-NG zimbra

Topics

Recent Posts

  • Installing & Configuring Cloud-Init on ISO-Built Ubuntu 22.04 VMs May 27, 2026
  • Upgrdae debian 12 to debian 13 May 22, 2026
  • User Account Control (UAC) or Windows blocks a setup file May 2, 2026
  • Install Proxmox VE on Debian 13 Trixie March 24, 2026
  • Directory Index PHP file March 17, 2026
  • CovermyAss February 27, 2026
  • KVM Cloud Capacity Planning Script (Enhanced) February 20, 2026
  • Youtube MP3 Downloader Script using AI February 14, 2026
  • Install Softether VPN and create a Destination NAT (D-NAT) Rule to access the private Client VPN Node on a Debian 12 OS February 14, 2026
  • Deploying Pulse Monitoring for Proxmox Cluster Ecosystem February 13, 2026

Archives

Top Posts & Pages

  • Installing & Configuring Cloud-Init on ISO-Built Ubuntu 22.04 VMs
©2026 Bots! | WordPress Theme by SuperbThemes