Ubuntu 16.04 Xenial booting fails with preseed

Asked by Badrinath on 2020-06-05

Hi,

I have built the ubuntu 16.04 LTS xenial ISO through CUBIC and in chroot enviroment i have installed few application by adding universe repo "VLC" and added the preseed file as below.

However it does not recognize the preseed file....Please Help!

### Partitioning
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/choose_recipe select atomic

# This makes partman automatically partition without confirmation
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

# Locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us

# Network
#d-i netcfg/get_hostname string unassigned-hostname
#d-i netcfg/get_domain string unassigned-domain
#d-i netcfg/choose_interface select auto

# Clock
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true

# Packages, Mirrors, Image
#d-i base-installer/kernel/override-image string linux-server
#d-i base-installer/kernel/override-image string linux-image-amd64
#d-i mirror/country string US
#d-i mirror/http/proxy string
#d-i apt-setup/restricted boolean true
#d-i apt-setup/universe boolean true
d-i pkgsel/install-language-support boolean false
tasksel tasksel/first multiselect ubuntu-desktop

# Users
d-i passwd/user-fullname string badri
d-i passwd/username string vbad
d-i passwd/user-password-crypted password ubuntu/
#d-i passwd/root-login boolean true
#d-i passwd/root-password-crypted password [crypt 3]
#d-i user-setup/allow-password-weak boolean true

# Grub
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Badrinath
Solved:
2020-06-11
Last query:
2020-06-11
Last reply:
2020-06-06
Cubic PPA (cubic-wizard) said : #1

Did you list the preseed file in the Grub Boot options?

(Also, I'm curious why you are using 16.04? Are there features in 16.04 that are not available in 18.04 LTS?)

Cubic PPA (cubic-wizard) said : #2
Badrinath (badrinak) said : #3

Thank you for your help! I am trying to configure both 16.04 LTS xenial as well bionic 18.04 lts
my grub.cfg as follows:

Grub file:
menuentry "Install Ubuntu" {
    set gfxpayload=keep
    linux /casper/vmlinuz file=/cdrom/preseed/my.seed auto=true priority=critical keyboard-configuration/layoutcode=us boot=casper automatic-ubiquity initrd=/casper/initrd.gz quiet splash noprompt noshell ---
    initrd /casper/initrd
}

When I try to copy the built ISO and boot..I get an Initfram error saying that mount: can't find /root in /etc/fstab

Appreciate your help

Badrinath (badrinak) said : #4

Hi Mate,

i used the above provided link to set as presed file for my unbutu desktop, and the above grub settings remains same.

However when i try to boot it says veryfing and it prmpts again to choose the options.

Please Help!

Regards,

Cubic PPA (cubic-wizard) said : #5

I'm still curious... Why are you customizing Ubuntu 16.04 and not 18.04?
(Your answer will help me understand better how/why people use Cubic).

In the mean time, I'll try to create a version of 16.04 in Cubic and see if I get the same issue.

1. What OS ad version are you running Cubic in?
2. What is your version of Cubic (what is the output of `dpkg -l cubic`).
3. Are you customizing the official "ubuntu-16.04.5-desktop-amd64.iso" or something else?
4. What is the size of your final customized ISO?

Cubic PPA (cubic-wizard) said : #6

This is my grub.cfg file (with no customizations)...

menuentry "Install Ubuntu" {
 set gfxpayload=keep
 linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash ---
 initrd /casper/initrd
}

I noticed you have "initrd=/casper/initrd.gz" in your version of grub.cfg.
Om not sure why initrd has to be specified on the "linux..." line (3rd line), since it is already on the "initrd..." line (4th line)? However, it should probably be referenced as "/casper/initrd" without the "*.gz" extension. See the note on the Kernels tab in Cubic, and it will let you know how the kernel files should be referenced.

If you use the basic grub.cfg file shown above, does your ISO boot? (Trying to figure out if the issue is with how Cubic builds the ISO, or with your grub.cfg or preseed file)?

Cubic PPA (cubic-wizard) said : #7

NOTES:

Here is information regarding the tests I have done...

- Using the latest version of Cubic, 2020.06-26.
- Running in Ubuntu 20.04 LTS
- Customizing ubuntu-16.04.5-desktop-amd64.iso

This may be different than your setup. I suspect you are...
- Using the older version of Cubic
- Running Cubic in Ubuntu 16.04

Are you customizing the desktop or server ISO?
I ask because your preseed file looks like a "server" preseed?

Cubic PPA (cubic-wizard) said : #8

(1)
In order to have the "my.seed" preseed file picked up by the Live environment, you need to modify /isolinux/txt.cfg and reference this file. (You of course probably still want to make the same changes to grub.cfg and loopback.cfg).

(2)
The initrd should be referenced as "initrd=/casper/initrd" not "initrd=/casper/initrd.gz".

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
default live
label live
  menu label ^Try Ubuntu without installing
  kernel /casper/vmlinuz
  append file=/cdrom/preseed/my.seed boot=casper initrd=/casper/initrd quiet splash ---
label live-install
  menu label ^Install Ubuntu
  kernel /casper/vmlinuz
  append file=/cdrom/preseed/my.seed boot=casper only-ubiquity initrd=/casper/initrd quiet splash ---
label check
  menu label ^Check disc for defects
  kernel /casper/vmlinuz
  append boot=casper integrity-check initrd=/casper/initrd quiet splash ---
label memtest
  menu label Test ^memory
  kernel /install/mt86plus
label hd
  menu label ^Boot from first hard disk
  localboot 0x80
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Badrinath (badrinak) said : #9

Hi Mate,

Thank you for helping me..I got this working with below preseed file...However i want to remove the disk encryption and just want to have 2 LVM partition.
/root /swap.

because when you automate the instllation,we expect users not to inveterne or type anything apart from thier username and password

Is there way to create preseed without the crypto option?
d-i auto-install/enable boolean true
d-i debconf/priority select critical
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/shortlist select US
d-i localechooser/supported-locales multiselect en_US.UTF-8
# Keyboard
d-i console-setup/ask_detect boolean false
d-i console-keymaps-at/keymap select us
# Localization
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8
### Clock and time zone setup
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
d-i partman-auto/method string crypto
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string crypt
d-i partman-crypto/passphrase password 1234
d-i partman-crypto/passphrase-again password 1234
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select root-encrypted
d-i partman-auto/expert_recipe string \
      root-encrypted :: \
              500 500 500 ext3 \
                      $primary{ } $bootable{ } \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              8000 8000 8000 linux-swap \
                      $lvmok{ } lv_name{ swap } \
                      in_vg { crypt } \
                      $primary{ } \
                      method{ swap } format{ } \
              . \
              500 10000 1000000000 ext4 \
                      $lvmok{ } lv_name{ root } \
                      in_vg { crypt } \
                      $primary{ } \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ / } \
              .

d-i partman-md/device_remove_md boolean true
d-i partman-basicfilesystems/no_mount_point boolean false
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

# Enable extras.ubuntu.com.
d-i apt-setup/extras boolean true
# Install the Ubuntu desktop.
tasksel tasksel/first multiselect ubuntu-desktop
# On live DVDs, don't spend huge amounts of time removing substantial
# application packages pulled in by language packs. Given that we clearly
# have the space to include them on the DVD, they're useful and we might as
# well keep them installed.
ubiquity ubiquity/keep-installed string icedtea6-plugin openoffice.org
d-i base-installer/kernel/image string linux-generic
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false

### Account setup
# This is just for testing!!!
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
d-i passwd/user-password password ubuntu
d-i passwd/user-password-again password ubuntu
# or encrypted using a crypt(3) hash.
#d-i passwd/user-password-crypted password [crypt(3) hash]
# The installer will warn about weak passwords. If you are sure you know
# what you're doing and want to override it, uncomment this.
d-i user-setup/allow-password-weak boolean true
ubiquity ubiquity/reboot boolean true

My worked preseed.

Badrinath (badrinak) said : #10

Hi Mate.

I was able to resolve using the perseed file.

I will close this thread.

Regards

Badrinath