packer script for ubuntu that works on fbsd virtualbox

Gary Aitken freebsd at
Sun Sep 13 03:53:32 UTC 2020

I'm having trouble getting packer to produce a ubuntu-18.04.5 that actually
works on virtualbox on my 11.3-RELEASE-p6 fbsd system.  I can create one
using vagrant or from virtualbox itself, but not using packer.  I've tried
using the packer installed via pkg install (1.6.0), and I've also using a
1.6.1 from source.  I thought about trying to build a more recent virtualbox
but the patches in the port are tweaking stuff way beyond my abilities.

Can anyone post a packer .json file to create a ubuntu vm that works?

The VM goes through the initial install process ok, then begins installing
updates.  After update #14 or so, it crashes and reboots, starting the
install process all over.  Again and again.

Using the virtualbox-ose from pkg install (5.2.44).

FWIW, here's the .json file that doesn't work, given the command
   "packer build ubuntu-18-04.json"

   "builders": [
       "boot_command": [
         " 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>",
       "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": [
         "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}"
       "output_directory": "../../builds/packer-{{user `template`}}-virtualbox",
       "shutdown_command": "echo 'vagrant' | sudo -S shutdown now",
       "ssh_password": "vagrant",
       "ssh_port": 22,
       "ssh_timeout": "1000s",
       "ssh_username": "vagrant",
       "type": "virtualbox-iso",
       "vboxmanage": [
           "{{ user `memory` }}"
           "{{ user `cpus` }}"
   "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": "",
     "mirror_directory": "18.04.5/",
     "preseed_path": "preseed.cfg",
     "template": "ubuntu-18.04.05-live-server-amd64.iso",
     "version": "TIMESTAMP",
     "vm_description": "packer ubuntu-18.04.5",
     "vm_version": "18.04.5"



More information about the freebsd-questions mailing list