Ubuntu 20.04 on QEmu working

This commit is contained in:
Greg Hellings
2022-05-04 09:00:17 -05:00
parent 950500c9f1
commit ff59effbb1
43 changed files with 757 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
d-i preseed/include string ../preseed.cfg
+3
View File
@@ -0,0 +1,3 @@
d-i preseed/include string ../preseed.cfg
d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0
+19
View File
@@ -0,0 +1,19 @@
d-i preseed/include string /preseed/ubuntu-server-minimalvm.seed
d-i preseed/include string ../preseed.cfg
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/model select USA
d-i keyboard-configuration/layout select USA
d-i keyboard-configuration/variant select USA
d-i grub-installer/bootdev string /dev/vda
d-i netcfg/choose_interface select auto
d-i mirror/http/mirror select us.archive.ubuntu.com
d-i mirror/http/proxy string
View File
+96
View File
@@ -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
+60
View File
@@ -0,0 +1,60 @@
d-i debian-installer/locale string en_US
d-i time/zone string UTC
d-i keyboard-configuration/xkb-keymap select us
d-i clock-setup/utc boolean true
d-i clock-setup/utc-auto boolean true
d-i debian-installer/missing-provide select ${DEFAULT}
d-i partman-auto/method string regular
d-i partman-auto/expert_recipe string \
scheme :: \
200 0 200 ext4 \
$primary{ } \
$bootable{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ /boot } . \
200% 0 200% linux-swap \
$primary{ } \
method{ swap } \
format{ } . \
1 0 -1 ext4 \
$primary{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ / } .
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i base-installer/excludes string laptop-detect
d-i passwd/root-password-again password vagrant
d-i passwd/root-password password vagrant
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i user-setup/allow-password-weak boolean true
d-i pkgsel/include string curl openssh-server sudo
d-i pkgsel/language-packs multiselect
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
tasksel tasksel/first multiselect ubuntu-server
d-i finish-install/reboot_in_progress note
d-i preseed/late_command string \
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; \
in-target update-initramfs -u