Wednesday, 20 July 2011

Ubuntu 11.04 Custom Ubiquity Installer

This post is a mini how to guide running the Ubuntu 11.04 installer from a flash drive installed with a copy of Ubuntu 11.04, it uses also uses the preseed function to feed the installer settings.

The steps to getting a custom installer from flash (8GB+ drive works well):
  1. Install Ubuntu onto the flash drive, this can be done by booting from the installation disk and selecting the flash drive as the / partition and disk to install Ubuntu on, double check that the boot installer will be installed on the flash drive (seems to be default).
  2. Once installed, boot from the flash drive, this should give you a read/write copy of Ubuntu you can do quite a bit with and use for installing systems. 
  3. Install using apt-get: ubiquity, ubiquity-frontend-gtk, ubiquity-slideshow-ubuntu
  4. You can load your custom images in /usr/share/ubiquity/pixmaps/ubuntu
  5. Copy the content from your Ubuntu disk to /cdrom on the flash drive, you can also mount the iso and copy the files and directories to /cdrom
  6. Save the preseed file can as preseed.cfg in /
  7. Load the preseed file using the command: debconf-set-selections /preseed.conf
  8. Run the installer: ubiquity --automatic --desktop --gtk-ui
  9. Change the preseed.conf and reload it as required, over and over, until all the little bits work in the way required...
Tips:
  1. Installer log file /var/log/installer/debug
  2. Turn on debugging by running Ubiquity using: ubiquity --automatic -d --desktop --gtk-ui
  3. You can find all installer config options using: debconf-get-selections
  4. The selections database: /var/cache/debconf/config.dat
  5. You run the install and at various point do the get selections command which will contain the value you set in the installer, very handy for debugs
  6. Take regular breaks, the process can be a royal pain!
My preseed.conf file (I'm from South Africa so the locale etc might need adjusting)

preseed.conf:
# Enable oem mode
d-i oem-config/enable boolean true

# Run a command/script after install
d-i preseed/late_command string ls

# Ensure that the openssh server is included, you can install other packages
# required here too..
d-i pkgsel/include string openssh-server

# Add the username/password specific details
d-i passwd/allow-password-empty boolean true
d-i passwd/user-fullname string My User
d-i passwd/username string myuser
d-i passwd/user-password string myuserpass
d-i passwd/user-password-again string myuserpass

# set hostname
d-i netcfg/get_hostname string ubuntu

# Locale sets language and country.
d-i localechooser/languagelist select en
d-i languagechooser/language-name-fb select English
d-i debian-installer/locale string en_US.UTF-8

# Keyboard selection
keyboard-configuration keyboard-configuration/layout select South Africa
keyboard-configuration keyboard-configuration/unsupported_layout boolean true
keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true
keyboard-configuration keyboard-configuration/variantcode string

# Detect keyboard layout?
keyboard-configuration console-setup/ask_detect boolean false
keyboard-configuration console-setup/detected note
keyboard-configuration  keyboard-configuration/model select Generic 105-key (Intl) PC

# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true

# Set timezone
d-i time/zone string Africa/Johannesburg

# Controls whether to use NTP to set the clock during the install
# Say no so we don't wait if there's no network connection
d-i clock-setup/ntp boolean false

# partition the disk
# wipe everything and put everything in /
d-i partman/filter_mounted boolean false
d-i partman/unmount_active boolean false
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true

# Automatically download and install stable updates?
unattended-upgrades unattended-upgrades/enable_auto_updates boolean false

# run this command after the install
# /target is the newly-installed system
# oem-config-prepare sets the first run wizard for next login
#ubiquity ubiquity/success_command string chroot /target oem-config-prepare

# preseed some ubiquity specifics
ubiquity oem-config/id string MY-BATCH
ubiquity partman/unmount_active boolean false
ubiquity partman-auto/choose_recipe select atomic
ubiquity debian-installer/language string en
ubiquity localechooser/shortlist select US
ubiquity localechooser/preferred-locale select en_US.UTF-8
ubiquity localechooser/supported-locales multiselect en_US.UTF-8

#skip the screens not required
ubiquity localechooser/translation/none-yet note
ubiquity localechooser/translation/no-select note
ubiquity ubiquity/online note
ubiquity ubiquity/summary note
                                                                                                                                                                                                
# reboot after installation
# you will still be prompted "Close the tray and press ENTER to continue?"
# unless you add noprompt to the kernel command line
ubiquity ubiquity/reboot boolean false

#end of preseed.conf file

Good Luck!

    5 comments:

    1. Dear friend how can i set automatic-ubiquity as default ????

      ReplyDelete
    2. For trusty, I had to change:

      keyboard-configuration keyboard-configuration/layout select South Africa
      keyboard-configuration keyboard-configuration/unsupported_layout boolean true
      keyboard-configuration keyboard-configuration/store_defaults_in_debconf_db boolean true
      keyboard-configuration keyboard-configuration/variantcode string

      # Detect keyboard layout?
      keyboard-configuration console-setup/ask_detect boolean false
      keyboard-configuration console-setup/detected note
      keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC

      to

      ubiquity keyboard-configuration/layout select USA
      ubiquity keyboard-configuration/unsupported_layout boolean true
      ubiquity keyboard-configuration/store_defaults_in_debconf_db boolean true
      ubiquity keyboard-configuration/variantcode string
      ubiquity keyboard-configuration/layoutcode string USA

      # Detect keyboard layout?
      ubiquity keyboard-configuration console-setup/ask_detect boolean false
      ubiquity keyboard-configuration console-setup/detected note
      ubiquity keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC


      ReplyDelete
    3. Works like a charm. I used this on Ubuntu 14.04 with Customizer. on a live Cd, and not an installation on a USB stick.

      ReplyDelete
    4. Thank you! Very helpful and works with the console changes posted by Anonymous on December 2013 at 06:30. Tested on 14.04 for Ubuntu 14.04 desktop.

      ReplyDelete
    5. A broker of Binary Options needs to gauge the required bearing of the value development of the central resource. Inside most stages the two decisions are alluded to as Set and Yell. binary option tips

      ReplyDelete