Cloud Init Image Config
Setup Links:
Using Cilium with k0s on alpine
How to build a minimal cloud-init image for Proxmox
Building alpine-virt with netkit kernel module enabled
Notes from above
apk add openssh-server-pam qemu-guest-agent dbus chrony cloud-init util-Linux doas
vi /etc/ssh/sshd_config
rc-service sshd restart
vi /etc/fstab
echo "rc_cgroup_mode=\"unified\"" >> /etc/rc.conf
rc-service cgroups start
rc-update add cgroups
rc-update add chronyd default
rc-service dbus start
rc-update add dbus
rc-update add qemu-guest-agent
vi /etc/init.d/sysfs
/etc/init.d/sysfs restart
apk add findmnt
findmnt -o TARGET,PROPAGATION
vi /etc/init.d/sysfs
echo 'datasource_list: [ NoCloud, ConfigDrive ]' >> "/etc/cloud/cloud.cfg.d/99_pve.cfg"
vi /etc/ssh/sshd_config
rc-update add qemu-guest-agent default
echo '%wheel ALL=(ALL) NOPASSWD: ALL' > "/etc/sudoers.d/wheel"
echo 'permit nopass :wheel' > "/etc/doas.d/wheel.conf"
echo 'datasource_list: [ NoCloud, ConfigDrive ]' > "/etc/cloud/cloud.cfg.d/99_pve.cfg"
# -- final steps that cannot be undone, one should snapshot before running
#lockdown
/bin/sh -c "/bin/echo 'root:*' | /usr/sbin/chpasswd -e"
/usr/bin/passwd -l root
# definitely no turning back after this:
setup-cloud-init
# Shut down the VM and do **NOT** restart it
poweroff
#prox
qm set 999 --ide2 local-lvm:cloudinit
qm set 999 --boot c --bootdisk scsi0
No Comments