Results 1 to 9 of 9

Thread: Ubuntu 20.04 unattended installation

  1. #1
    Join Date
    Oct 2023
    Beans
    5

    Ubuntu 20.04 unattended installation

    Facing below challenge during ubuntu 20.04 Generation-2 unattended installation on hyper-v using PowerShell script.
    Installation randomly failing during the package installation and got Subiquity installer error , returns 100 status code.
    Here are the packages mentioned in user-data file. appreciated quick help
    - linux-tools-virtual
    - linux-image-virtual
    - linux-cloud-tools-virtual.

  2. #2
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 20.04 unattended installation

    What does your script look like, and what are the exact errors from your installer logs?

    Separately, Which edition are your referring to? Since 20.04, server and desktop used different installers, so use different styles/formats of the scripts.
    Last edited by MAFoElffen; October 22nd, 2023 at 12:19 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Oct 2023
    Beans
    5

    Re: Ubuntu 20.04 unattended installation

    Hi,
    I am trying Ubuntu 20.04 Server on Hyper-V Generation-2 VM.
    Here is User-data file content
    ----------------------------------------------------------------------------------
    Code:
    #cloud-config
    autoinstall:
      version: 1
      apt:
        preserve_sources_list: false
        primary:
          - arches:
              - default
            uri: http://archive.ubuntu.com/ubuntu
          - arches:
              - default
            uri: http://security.ubuntu.com/ubuntu
      identity:
        hostname: ubuntuhost
        username: admin
        password: admin
      keyboard:
        layout: us
      locale: en_US.UTF-8
      network:
        network:
          version: 2
          ethernets:
            eth0:
              dhcp4: true
      packages:
        - openssh-server
        - apt-transport-https
        - ca-certificates
        - curl
        - software-properties-common
        - linux-image-virtual
        - linux-tools-virtual
        - linux-cloud-tools-virtual
    package_update: true
    package_upgrade: true
    storage:
      layout:
        name: lvm
    ssh:
      install-server: true
      allow-pw: true
    user-data:
      disable_root: false
    runcmd:
      - - sh
        - -c
        - if test -b /dev/cdrom; then eject; fi
      - - sh
        - -c
        - if test -b /dev/sr0; then eject /dev/sr0; fi
      - - locale-gen
        - en_US.UTF-8
      - - update-locale
        - en_US.UTF-8
      - - sh
        - -c
        - sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'us'\"/g' /etc/default/keyboard
      - - sh
        - -c
        - sudo apt update
      - - sh
        - -c
        - sudo apt-get update
      - - sh
        - -c
        - sudo apt-get install -f
      - - sh
        - -c
        - sudo apt list --upgradable
    late-commands:
      - 'sed -i "s/dhcp4: true/&\n      dhcp-identifier: mac/"
        /target/etc/netplan/00-installer-config.yaml'
      - echo 'admin ALL=(ALL) NOPASSWD:ALL' >
        /target/etc/sudoers.d/admin
    power_state:
      mode: reboot
      message: Provisioning finished, will reboot ...
      timeout: 15
    ----------------------------------------------------------------------------------------
    here is error screen shot

    Last edited by jparekhi; October 26th, 2023 at 07:54 AM.

  4. #4
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 20.04 unattended installation

    Please edit your last post and use CODE tags. See the link in my signature line. That will preserve the indents and spacing to that yaml file format...

    It may be just a timing issue there. Some time at that point, the depends aren't there yet or something, but they do fine if done later.

    It only a few app's, and it's having problems installing there, in packages, then I'll move them to later, in either 'run cmd' or 'late commands'... I have had better luck in installing things from the 'late commands' section.

    If more than just a few, then I'll create an install script that (in 'late coomands') I'll copy over, make executable, and call.

    I use full paths in the commands, for the just-in-cases, so I don't have to wonder what the ENV $PATH is in the target chroot.

    Do those make sense to you?

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #5
    Join Date
    Oct 2023
    Beans
    5

    Re: Ubuntu 20.04 unattended installation

    Please check the updated user-data content in earlier post , I already tried out below packages in late commands however didn't work.
    - linux-image-virtual
    - linux-tools-virtual
    - linux-cloud-tools-virtual

  6. #6
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 20.04 unattended installation

    Quote Originally Posted by jparekhi View Post
    Please check the updated user-data content in earlier post , I already tried out below packages in late commands however didn't work.
    - linux-image-virtual
    - linux-tools-virtual
    - linux-cloud-tools-virtual
    Show me the format of the commands you used you used in the late commands section... and the section of the install logs syncing with when they were being called...

    Not that I don't trust you, but if you just moved what you posted down to that section, that is not going to work. Telling me "that you tried and it didn't work", leaves a lot of details out. Like details of exactly what didn't work, when and how. If you do not show me, then I can't visualize what went wrong. I am not there looking over your shoulder to see that. I am also not very good at reading minds. LOL
    Last edited by MAFoElffen; October 26th, 2023 at 08:17 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  7. #7
    Join Date
    Oct 2023
    Beans
    5

    Re: Ubuntu 20.04 unattended installation

    Quote Originally Posted by MAFoElffen View Post
    Show me the format of the commands you used you used in the late commands section... and the section of the install logs syncing with when they were being called...

    Not that I don't trust you, but if you just moved what you posted down to that section, that is not going to work. Telling me "that you tried and it didn't work", leaves a lot of details out. Like details of exactly what didn't work, when and how. If you do not show me, then I can't visualize what went wrong. I am not there looking over your shoulder to see that. I am also not very good at reading minds. LOL
    here is the snippet from user-data file , for syncing logs I need to run the script again, I will share soon.
    Code:
    late-commands:
        - apt install -y linux-image-virtual
        - apt install -y linux-tools-virtual
        - apt install -y linux-cloud-tools-virtual

  8. #8
    Join Date
    Oct 2023
    Beans
    5

    Re: Ubuntu 20.04 unattended installation

    Quote Originally Posted by jparekhi View Post
    here is the snippet from user-data file , for syncing logs I need to run the script again, I will share soon.
    Code:
    late-commands:
        - apt install -y linux-image-virtual
        - apt install -y linux-tools-virtual
        - apt install -y linux-cloud-tools-virtual
    unable to get any logs for late-command

  9. #9
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu 20.04 unattended installation

    Add this after the late commands to help debug that:
    Code:
       late-commands:
        - apt install -y linux-image-virtual
        - apt install -y linux-tools-virtual
        - apt install -y linux-cloud-tools-virtual
       error-commands:
        - tail -200 /var/log/syslog

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •