From d1e922929abd9ee1d4ea682a21c77a5fe91b0b8b Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 3 May 2022 08:35:43 -0500 Subject: [PATCH] Ubuntu 22.04 on QEmu working --- distros/ubuntu-22.04-x86_64.pkrvars.hcl | 13 ++++ http/ubuntu/22.04/meta-data | 0 http/ubuntu/22.04/user-data | 96 +++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 distros/ubuntu-22.04-x86_64.pkrvars.hcl create mode 100644 http/ubuntu/22.04/meta-data create mode 100644 http/ubuntu/22.04/user-data diff --git a/distros/ubuntu-22.04-x86_64.pkrvars.hcl b/distros/ubuntu-22.04-x86_64.pkrvars.hcl new file mode 100644 index 0000000..2dd045d --- /dev/null +++ b/distros/ubuntu-22.04-x86_64.pkrvars.hcl @@ -0,0 +1,13 @@ +distro = "ubuntu" +arch = "x86_64" +version = "22.04" +iso = { + url = "https://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso" + checksum = "84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f" +} +boot_wait = "15s" +boot_command = [ + "e", + "autoinstall ds=\"nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/22.04/\" console=ttyS0" +] +ssh_handshake_attempts = 1000 diff --git a/http/ubuntu/22.04/meta-data b/http/ubuntu/22.04/meta-data new file mode 100644 index 0000000..e69de29 diff --git a/http/ubuntu/22.04/user-data b/http/ubuntu/22.04/user-data new file mode 100644 index 0000000..4dd6d9c --- /dev/null +++ b/http/ubuntu/22.04/user-data @@ -0,0 +1,96 @@ +#cloud-config +# vim: set ft=yaml: +autoinstall: + version: 1 + network: # Should disable networking, workaround for unattended-updates failing in install + version: 2 + refresh-installer: + update: yes + keyboard: + layout: us + storage: + config: + - id: drive + type: disk + ptable: gpt + name: hard-drive + preserve: false + grub_device: true + wipe: superblock + - id: bios-grub + type: partition + device: drive + size: 1M + flag: bios_grub + - id: boot-partition + type: partition + device: drive + size: 200M + name: boot + - id: swap-partition + type: partition + device: drive + size: 10% + name: swap + flag: swap + - id: root-partition + type: partition + device: drive + name: root + size: -1 + - id: boot-format + type: format + fstype: ext4 + volume: boot-partition + label: boot + preserve: false + - id: swap-format + type: format + fstype: swap + volume: swap-partition + label: swap + preserve: false + - id: root-format + type: format + fstype: ext4 + volume: root-partition + label: root + preserve: false + - type: mount + id: root-mount + device: root-format + path: / + - type: mount + id: boot-mount + device: boot-format + path: /boot + - type: mount + id: swap-mount + device: swap-format + path: none + identity: + hostname: vagrant + username: vagrant + password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0 + ssh: + install-server: yes + authorized_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key + allow-pw: yes + user-data: + disable_root: false + late-commands: + - echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant + - echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /target/etc/sudoers.d/vagrant + - chmod 440 /target/etc/sudoers.d/vagrant + # Restore network after bypassing unattended updates + - "echo -n 'network:\n version: 2\n ethernets:\n eth0:\n dhcp4: true\n dhcp-identifier: mac' > /target/etc/netplan/00-installer-config.yaml" + - netplan apply + - sed -i -E -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevnames=0\1"/' /target/etc/default/grub + - mount -o bind /dev /target/dev + - mount -o bind /sys /target/sys + - mount -o bind /proc /target/proc + - chroot /target /usr/sbin/update-grub + packages: + - curl + - sudo