How much user pre-configuration is practical in the .iso?

Asked by MangoCats

So, if you useradd username -m while you are setting up your filesystem, that user will be pre-configured on the system, easy enough.

Has anybody tried (and succeeded) in pre-configuring the default automatically logged in user? By this, I mean the username which you specify during the installation process. For my application, I have my default users set to log in automatically.

I tried once this afternoon to just do the useradd -m, and it wasn't the best result: the installer completed, but that user was not automatically logged in, and I suppose the installer declined to set the user's password when it encountered an existing user of the same name, because I couldn't log into the system at all.

I'll try again on Monday to setup the user a little more in chroot, with a password and probably the whole skeleton folder that is normally created by the installer. Hopefully the installer doesn't do anything to actively break the existing user.

This also raises a related question: what is the name/website of the installer used in the Bionic .iso, and can it be customized to skip certain steps (like choosing a username and password)?

Thanks,

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Cubic PPA
Solved:
Last query:
Last reply:
Revision history for this message
Cubic PPA (cubic-wizard) said :
#1

For other user defaults, are you putting configurations inside
    /etc/skel
?

Also, are you using gettings inside the chroot environment to configure default user settings?

Revision history for this message
MangoCats (mangocats) said :
#2

I haven't used /etc/skel yet.

I am inside the cubic chroot, using commands like useradd -m to create the user, and hopefully later customizing that user's home folder.

So far, I've just had the above problem after simply creating the user.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#3

# In Cubic's chroot environment, create a user named 'test'
$ adduser test
# View the groups the user belongs to
$ groups test

# Add the test user to the sudo and other groups
$ usermod -a -G adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,lpadmin test
# View the groups the user belongs to
$ groups test

# Set the test user for autologin
$ nano /etc/gdm3/custom.conf
    - - - - - - - - - - - - - - -
    # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = test
    - - - - - - - - - - - - - - -

# Create the customized ISO using Cubic.

# Boot to the customized ISO
# You will be logged into the Live enviornment as user 'test'

# Launch Ubiquity installer.
# During create user 'test' with the same information as above.

# Reboot to the newly installed system.
# You will be automatically logged into Ubuntu as user 'test'

Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#4

HERE IS AN APPROACH WHERE YOU DON'T NEED TO RE-CREATE THE PRE-CONFIGURED USER:

# Create a user named 'test'
$ adduser test
# View the groups the user belongs to
$ groups test

# Add the test user to the sudo and other groups
$ usermod -a -G adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,lpadmin test
# View the groups the user belongs to
$ groups test

# Set the test user for autologin
$ nano /etc/gdm3/custom.conf
    - - - - - - - - - - - - - - -- - - - - -- - - - - -
    # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = test
    - - - - - - - - - - - - - - -- - - - - -- - - - - -

# Create the customized ISO using Cubic.

# Boot to the customized ISO
# Press: <ESC>
# Click: <F4> Modes
# Select: OEM Install (for manufacturers)
# Select: Install Ubuntu

# The Ubiquity installer will start in OEM mode
# You will NOT be permitted to enter a user
# (You must still supply a password the temporary OEM user)
# Finish the install

# Reboot to the newly installed system
# You will be automatically logged into Ubuntu as user 'test'

Revision history for this message
MangoCats (mangocats) said :
#5

Tested and confirmed - works for me with Ubuntu 18.04.0, thanks!

One point of slight confusion: when I boot the .iso from a USB, I end up in the Modes menu directly most of the time (Intel NUC BIOS settings seem to influence this behavior), so at first I was pressing ESC and ending up back in Grub, but eventually I saw the OEM install menu and all worked as advertised from there. Other times, booting from a non-UEFI partition on the USB, I couldn't get to the Modes menu no matter what I pressed during startup, and ended up in the standard installer with the big Try/Install gui. I have been using Startup Disk Creator to put my .isos onto USB, it seems to do something funky with an extra partition so that I'm ending up with three choices to boot from on the USB: Part 1 OS Bootloader, Part 1 Boot Drive and Part 0 Bootloader. It looks like Part 0 Bootloader is the one that gives you the 4 modes menu.

Also, making the user with the adduser approach, then running the non-OEM install and adding the same username during the prompting process seemed to work as well, but I do prefer the OEM install approach, even though it does have that extra "name this group of machines" step - wouldn't the name of the group of machines be defined in the image already?

Revision history for this message
Cubic PPA (cubic-wizard) said :
#6

I'm glad it worked for you.

My understanding of the "name this group" feature is that it is a way for an admin installing ubuntu on a bunch of machines to "tag" tag them as having similar setup or configurations.

If there is an issue, the group name will be included in the support request, allowing the admin to resolve the issue for the entire group of machines.