the auto installation runs perfectly with customize user-data, but it won't auto reboot when install complete.
I find no documents about reboot in https://ubuntu.com/server/docs/install/autoinstall-reference
and I also find an article here http://junyelee.blogspot.com/2021/05/subiquity.html
# use interactive-sections to avoid an automatic reboot
and here is my user-data
#cloud-config
autoinstall:
### config storage and network manually
interactive-sections:
- storage
# Swapfile on root volume
swap:
swap: 16GB
late-commands:
- curtin in-target --target=/target -- apt-get --purge -y --quiet=2 remove byobu
- curtin in-target --target=/target -- apt-get install -y git wget curl rsync net-tools ssh ubuntu-desktop plymouth-theme-ubuntu-logo grub-gfxpayload-lists mailutils
- curtin in-target --target=/target -- hostnamectl set-hostname ubuntu-jammy.abc.com
# Write a script that can take care of some post install setup "late-commands" cannot be interactive unfortunately"
- |
cat <<EOF | sudo tee /target/etc/finish-install-setup.sh
#!/usr/bin/env bash
echo *************************
echo **** Finish Setup ****
echo *************************
echo 'Enter the hostname for this system: '
read NEW_HOSTNAME
hostnamectl set-hostname \${NEW_HOSTNAME}
echo
echo 'Enter the timezone for this system: '
echo 'Asia/Taipei'
read NEW_TIMEZONE
timedatectl set-timezone \${NEW_TIMEZONE}
echo *************************
echo
echo *************************
echo 'Restarting to finish ...'
shutdown -r 3
EOF
- curtin in-target --target /target chmod 744 /etc/finish-install-setup.sh
apt:
disable_components: []
geoip: true
preserve_sources_list: false
primary:
- arches:
- amd64
- i386
uri: http://free.nchc.org.tw/ubuntu
- arches:
- default
uri: http://ports.ubuntu.com/ubuntu-ports
drivers:
install: false
identity:
hostname: ubuntu-jammy
password: somesupersecretpasswordhere
realname: administrator
username: administrator
kernel:
package: linux-generic
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
ethernets:
ens18:
dhcp4: true
version: 2
ssh:
allow-pw: true
authorized-keys: []
install-server: true
### user-data , commands run during first boot
user-data:
runcmd:
- rm -rf /usr/bin/python
- ln -s /usr/bin/python3.10 usr/bin/python
- wget https://download.nomachine.com/download/7.8/Linux/nomachine_7.8.2_1_amd64.deb -O /opt/nomachine.deb
- dpkg -i /opt/nomachine.deb
#- /etc/finish-install-setup.sh
version: 1
I have to press enter at the end to reboot machine , which I don't think it's a good "automation".
But I need to configure storage layout manually , is there any solutions the force to reboot after the installation complete ?