packer build of ubuntu 18.04.5 reboot loop, bug verification?

Gary Aitken ubuntu at dreamchaser.org
Thu Sep 10 05:31:44 UTC 2020


Hi all,

I have VirtualBox 5.2.44 installed on a freebsd 11.3-RELEASE system and I
can't get packer to boot up and configure a ubuntu 18.04.5 system.

If I run VB and create a new ubuntu 18.04.5 VM from a local iso image,
it starts up fine (although there may be ssh issues).

However, if I run packer to build a system from the same iso image,
the install media boots and goes through the configuration process ok
(defaults all answers, use the whole 10GB virtual disk);
after the last questions asking if I want to install ssh(yes) or some popular
server environments (no), when I tell it to continue it starts the install
process, fetches some updates I think (but doesn’t get too far compared to a
successful install) then it reboots and goes through the whole configuration
question process again… and again… forever

The last thing I see before reboot is something about
"Sorry, there was a problem completing the installation…
"Gathering information…

I'm wondering if someone could run my packer script on a ubuntu system with
virtualbox 5.2 and let me know what happens.  You'll have to change the location
of the downloaded ubuntu-18.04.5 version, or just use the web fetch.

The packer tty session is not helpful, as it shows nothing after the configuration process starts:

$ packer build ubuntu-18-04.json
…
==> virtualbox-iso: Starting the virtual machine…
==> virtualbox-iso: Waiting 10s for boot…
==> virtualbox-iso: Typing the boot command…
==> virtualbox-iso: Using ssh communicator to connect: 127.0.0.1
==> virtualbox-iso: Waiting for SSH to become available…

The above “Waiting for SSH to become available…” is the last thing I see in the packer xterm; it preceeds all install / configuration questions.

My .json file:
(I removed provisioners and post-processors, made no difference)

{
   “builders”: [
     {
       “boot_command”: [
         "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
         "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
         "/install/vmlinuz<wait>",
         " auto<wait>",
         " console-setup/ask_detect=false<wait>",
         " console-setup/layoutcode=us<wait>",
         " console-setup/modelcode=pc105<wait>",
         " debconf/frontend=noninteractive<wait>",
         " debian-installer=en_US.UTF-8<wait>",
         " fb=false<wait>",
         " initrd=/install/initrd.gz<wait>",
         " kbd-chooser/method=us<wait>",
         " keyboard-configuration/layout=USA<wait>",
         " keyboard-configuration/variant=USA<wait>",
         " locale=en_US.UTF-8<wait>",
         " netcfg/get_domain=vm<wait>",
         " netcfg/get_hostname=vagrant<wait>",
         " grub-installer/bootdev=/dev/sda<wait>",
         " noapic<wait>",
         " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
         " -- <wait>",
         "<enter><wait>"
       ],
       "boot_wait": "10s",
       "disk_size": "{{user `disk_size`}}",
       "guest_os_type": "Ubuntu_64",
       "hard_drive_interface": "sata",
       "headless": "{{ user `headless` }}",
       "http_directory": "http",
       "iso_checksum": "{{user `iso_checksum_type`}}:{{user `iso_checksum`}}",
       "iso_urls": [
         "file:///hd2/Downloads/Ubuntu/ubuntu-18.04.5-live-server-amd64.iso",
         "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}"
       ],
       "output_directory": "../../builds/packer-{{user `template`}}-virtualbox",
       "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
       "ssh_password": "vagrant",
       "ssh_port": 22,
       "ssh_timeout": "10000s",
       "ssh_username": "vagrant",
       "type": "virtualbox-iso",
       "vboxmanage": [
         [
           "modifyvm",
           "{{.Name}}",
           "--memory",
           "{{ user `memory` }}"
         ],
         [
           "modifyvm",
           "{{.Name}}",
           "--cpus",
           "{{ user `cpus` }}"
         ]
       ]
     }
   ],
   "post-processors": [
     {
       "keep_input_artifact": true,
       "output": "ubuntu-18.04-{{.Provider}}.box",
       "type": "vagrant"
     }
   ],
   "provisioners": [
   ],
   “variables”: {
     “cpus”: “1”,
     “disk_size”: “10000”,
     “headless”: “”,
     “iso_checksum”: “3756b3201007a88da35ee0957fbe6666c495fb3d8ef2e851ed2bd1115dc36446”,
     “iso_checksum_type”: “sha256”,
     “iso_name”: “ubuntu-18.04.5-live-server-amd64.iso”,
     “memory”: “1536”,
     “mirror”: “http://releases.ubuntu.com/”,
     “mirror_directory”: “18.04.5/”,
     “template”: “ubuntu-18.04.05-live-server-amd64.iso”,
     “version”: “TIMESTAMP”,
     “vm_description”: “packer-ubuntu 18.04.05”,
     “vm_version”: “18.04.5”
   }
}

The log is no more helpful.

Any ideas what I’m doing wrong?

I took a screenshot of the VM before it rebooted but there is a big error box in the middle which obscures much of the relevant information, but what I can see is:
Running command [‘udevadm’, ‘settle’] with allowed return codes [0] (capture=False)
TIMED subp([‘udevadm’, ‘settle’]): 0.011
Running command [‘umount’, ‘/target/sys’] with allowed return codes [0]
Running command [‘umount’, ‘/target/proc’] with allowed return codes [0]
Running command [‘umount’, ‘/target/dev’] with allowed return codes [0]
finish: cmd-install/stage-curthooks/001-configure-apt/cmd-in-target: FAIL: curtin command in-target
Stderr: ‘’
Running command [‘uname’, ‘-a’] with allowed return codes [0]
Running c                       Stuff in blank space obscurred by error box
Traceback                                     "
File                                          "
"/snap/su"
304, in                                       "
await                                         "
File "/                                       "
decorated                                     "
retur                                         "
File                                          "
"/snap/su"
281, in c                                     "
self.logged_command(curtin_cmd, check=True)
File “/snap/subiquity/1966/lib/python3.6/site-packages/subiquitycore/utils.py”, line 85, in arun_command
raise subprocess.CalledProcessError(proc.returncode, cmd)
subprocess.CalledProcessError: Command ‘[systemd-cat’, ‘–level-prefix=false’;
‘–identifier=curtin_log.1521’, ‘/snap/subiquity/1966/usr/bin/python3’, ‘-m’, ‘curtin’,
‘–showtrace’, ‘-c’, ‘/var/log/installer/subiquity-curtin-install.conf’, ‘install’]’ returned non-zero exit status 3.

Any help would be much appreciated.

Gary




More information about the ubuntu-users mailing list