Skip to content

Instantly share code, notes, and snippets.

@Miesvanderlippe
Created May 1, 2020 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Miesvanderlippe/d195df2d9755b5a9c48a4ae551e53ce5 to your computer and use it in GitHub Desktop.
Save Miesvanderlippe/d195df2d9755b5a9c48a4ae551e53ce5 to your computer and use it in GitHub Desktop.
Hack to enable true auto-install for Ubuntu 20.04 with cloud-init nocloud
#cloud-config
runcmd:
- [eval, 'echo $(cat /proc/cmdline) "autoinstall" > /root/cmdline']
- [eval, 'mount -n --bind -o ro /root/cmdline /proc/cmdline']
- [eval, 'snap restart subiquity.subiquity-service']
autoinstall:
version: 1
identity:
hostname: hack-nation
username: superb-hacker
password: $hashed
@gregoster
Copy link

Thank you SO much for this hack... works like a charm for me with Ubuntu 20.04. It needs to be tweaked as follows for Ubuntu 22.04:

#cloud-config
runcmd:
  - [eval, 'echo $(cat /proc/cmdline) "autoinstall" > /root/cmdline']
  - [eval, 'mount -n --bind -o ro /root/cmdline /proc/cmdline']
  - [eval, 'snap restart subiquity.subiquity-server']
  - [eval, 'snap restart subiquity.subiquity-service']
...

That is, one first has to restart the subiquity-server before restarting subiquity-service, otherwise the 'autoinstall' added to /proc/cmdline won't be read. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment