almost 8 years ago
  1. http://frederik.orellana.dk/booting-ubuntu-14-04-cloud-images-without-a-cloud/
  2. http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt

Steps

sudo mkdir -p /var/lib/cloud/seed/nocloud

sudo tee /var/lib/cloud/seed/nocloud/meta-data <<EOF
instance-id: ubuntu
local-hostname: ubuntu
EOF

sudo tee /var/lib/cloud/seed/nocloud/user-data <<EOF
#cloud-config
apt_update: true
apt_upgrade: true
#apt_proxy: http://10.0.1.5:8000
apt_sources:
 - source: "ppa:git-core/ppa"
packages:
 - unattended-upgrades
 - squid-deb-proxy-client
 - vim
 - ntp
 - git
timezone: Asia/Taipei
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
runcmd:
 - grep $(cat /etc/hostname) /etc/hosts || sudo echo 127.0.0.1 $(cat /etc/hostname) >> /etc/hosts
EOF
  • Remove cloud-init instance, which will trigger cloud-init on next booting.
( cd /var/lib/cloud/instance && sudo rm -Rf * )
sudo shutdown -P now

Done!

← go-ipfs on windows Create ZFS iSCSI/NFS storage on Ubuntu 14.04 for esxi →
 
comments powered by Disqus