title: Packer Ubuntu 20.04 autoinstall via CD drive
body: <p>I configured my Ubuntu 20.04.1 Packer Template Deployment with user-data and meta-data mounted over CD, but I don't know how to configure the autoinstall bootcommand to get the subiquity part working:</p>
  <p>ubuntu-20.04.json</p>
  <pre><code>&quot;cd_files&quot;: [&quot;{{template_dir}}/ubuntu-20.04/meta-data&quot;, &quot;{{template_dir}}/ubuntu-20.04/user-data&quot;],
      &quot;cd_label&quot;: &quot;cidata&quot;,
      
      &quot;iso_paths&quot;: [
        &quot;[ColoNord-ISOs] ISOs/ubuntu-20.04.1-live-server-amd64.iso&quot;
      ],
      &quot;boot_wait&quot;: &quot;5s&quot;,
      &quot;floppy_files&quot;: [&quot;{{template_dir}}/preseed.cfg&quot;],
      &quot;boot_command&quot;: [
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;wait&gt;&lt;esc&gt;&lt;wait&gt;&lt;f6&gt;&lt;wait&gt;&lt;esc&gt;&lt;wait&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;&lt;bs&gt;&lt;bs&gt;&lt;bs&gt;&quot;,
        &quot;/casper/vmlinuz &quot;,
        &quot;initrd=/casper/initrd &quot;,
        &quot; ipv6.disable=1 autoinstall &quot;,
        &quot;ds=nocloud-net;s=/cidata/&quot;,
        &quot;&lt;enter&gt;&quot;
      ]
  </code></pre>
  <p>user-data</p>
  <pre><code>#cloud-config
  autoinstall:
      version: 1
      early-commands:
          #Stop SSH to prevent Packer from connecting too early
          - sudo systemctl stop ssh
      apt:
      geoip: true
      preserve_sources_list: false
      primary:
      - arches: [amd64, i386]
          uri: http://gb.archive.ubuntu.com/ubuntu
      - arches: [default]
          uri: http://ports.ubuntu.com/ubuntu-ports
      identity:
      hostname: ubuntu2004
      username: username
      password: password
      ssh:
      allow-pw: true
      install-server: true
      locale: de_CH
      keyboard: 
      layout: gb
      network:
          network:
              version: 2
              ethernets:
              ens160:
                  addresses:
                  - 10.0.249.75/24
                  gateway4: 10.0.249.1
                  nameservers:
                  addresses:
                  - 10.10.10.10
                  - 10.10.10.11
                  - 10.10.10.12
                  - 10.10.10.13
                  search:
                  - domain.local
  
      storage:
      layout:
          name: direct
      config:
          - type: disk
          id: disk0
          match:
              size: largest
          - type: partition
          id: boot-partition
          device: disk0
          size: 500M
          - type: partition
          id: root-partition
          device: disk0
          size: -1
      late-commands:
      - &quot;echo 'Defaults:username !requiretty' &gt; /target/etc/sudoers.d/username&quot;
      - &quot;echo 'username ALL=(ALL) NOPASSWD: ALL' &gt;&gt; /target/etc/sudoers.d/username&quot;
      - &quot;chmod 440 /target/etc/sudoers.d/username&quot;
  </code></pre>
  <p>Would be awesome to get this working, so I can finally deploy some basic installed vSphere Ubuntu VM Templates.
  I don't find that much documentation about this stuff, so if you can handle me sth to get this solved would also be great.</p>
  <p>Greez.</p>