0

I'm currently running into an issue with creating a preseeded Ubuntu 16.04 32-bit install. I'm installing into a VirtualBox VM on an Ubuntu 16.04 desktop. The iso I'm using is here: http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-i386/current/images/netboot/mini.iso

My install prompt looks like this enter image description here

And I can get to the boot prompt buy hitting <esc>. enter image description here

I can also get to a different prompt (That already has a lot of text filled in) via selecting Advanced options -> Command-line expert install and hitting <tab> when Command-line expert install is selected enter image description here

The issue I'm currently having is that when I get to either command prompt, (clearing any text that may be there already) and try to load my preseed file, I am brought back to the first install screen (first image) or it continues to ask me questions, even though I have preseeded the answers. Then the process that waits for ssh to become available runs out of time and the process fails.

==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Timeout waiting for SSH.
==> virtualbox-iso: Step "StepConnect" failed
==> virtualbox-iso: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step

There are some that claim this is a bug with Ubuntu that was not back-ported into 16.04.

Currently, I see lots of help online for Ubuntu server (not what I'm using) and different key combos for the boot command to solve the problem.

I've tried:

  1. Going to the first prompt and then adding the preseed file location "boot_command": [ "<esc><wait>", "/install/vmlinuz <wait>", "auto=true <wait>", "priority=critical <wait>", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{userubuntu_name}}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  2. Going to the second prompt and giving the preseed file location "boot_command": [ "<down><down><enter><down><down><tab>", "<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><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=true <wait>", "priority=critical <wait>", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{userubuntu_name}}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  3. Going to the first (and second) prompt and then adding the preseed file location using a different install keyword "boot_command": [ "<esc><wait>", "install <wait>", "auto <wait>", "priority=critical <wait>", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{userubuntu_name}}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  4. Going to the first (and second) prompt and then adding the preseed file location using a different preseed url keyword "boot_command": [ "<esc><wait>", "/install/vmlinuz <wait>", "auto <wait>", "priority=critical <wait>", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{userubuntu_name}}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  5. Going to the first (and second) prompt and then adding the preseed file location using extended keywords "boot_command": [ "<esc><wait>", "/install/vmlinuz <wait>", "auto <wait>", "priority=critical <wait>", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{userubuntu_name}}.cfg <wait>", "preseed/interactive=false <wait>", "debian-installer=en_US <wait>", "locale=en_US <wait>", "kbd-chooser/method=dk <wait>", "keyboard-configuration/xkb-keymap=dk <wait>", "netcfg/get_hostname={{ .Name }} <wait>", "netcfg/get_domain=vagrantup.com <wait>", "fb=false <wait>", "debconf/frontend=noninteractive <wait>", "console-setup/ask_detect=false <wait>", "console-keymaps-at/keymap=dk <wait>", "<enter><wait>" ],
  6. I've tried using a different iso (tried to get the ubuntu server iso) but when I do, the virtuabox process can't make a hardrive for it.
    ==> virtualbox-iso: Downloading or copying ISO
    ==> virtualbox-iso: Downloading or copying: http://releases.ubuntu.com/16.04/ubuntu-16.04-server-i386.iso
    ==> virtualbox-iso: Starting HTTP server on port 8916
    ==> virtualbox-iso: Creating virtual machine...
    ==> virtualbox-iso: Creating hard drive...
    ==> virtualbox-iso: Error attaching ISO: VBoxManage error: VBoxManage: error: Could not get the storage format of the medium '/home/project/packer_cache/414469dcbe8946731d7d3f214d3dd31de5806cb67eabc1873b915662bd2ba4cd.iso' (VERR_NOT_SUPPORTED)
    ==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component MediumWrap, interface IMedium, callee nsISupports
    ==> virtualbox-iso: VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp
    ==> virtualbox-iso: VBoxManage: error: Invalid UUID or filename "/home/project/packer_cache/414469dcbe8946731d7d3f214d3dd31de5806cb67eabc1873b915662bd2ba4cd.iso"
    ==> virtualbox-iso: Step "stepAttachISO" failed
    ==> virtualbox-iso: [c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succ
    ceeds)? ==> virtualbox-iso: Unregistering and deleting virtual machine...
    ==> virtualbox-iso: Deleting output directory...
    Build 'virtualbox-iso' errored: Error attaching ISO: VBoxManage error: VBoxManage: error: Could not get the storage format of the medium '/home/project/packer_cache/414469dcbe8946731d7d3f214d3dd31de5806cb67eabc1873b915662bd2ba4cd.iso' (VERR_NOT_SUPPORTED)
    VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component MediumWrap, interface IMedium, callee nsISupports
    VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp
    VBoxManage: error: Invalid UUID or filename "/home/project/packer_cache/414469dcbe8946731d7d3f214d3dd31de5806cb67eabc1873b915662bd2ba4cd.iso" 

My preseed file (preseed_xenial.cfg):

### Unattended Installation
d-i auto-install/enable boolean true
d-i debconf/priority select critical

### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_DK.UTF-8

# The values can also be preseeded individually for greater flexibility.
d-i debian-installer/language string en
d-i debian-installer/country string DK
# Optionally specify additional locales to be generated.
d-i localechooser/supported-locales multiselect en_DK.UTF-8, en_US.UTF-8, da_DK.UTF-8

# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select dk

### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/hostname string ur

### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
d-i mirror/protocol string ftp
d-i mirror/ftp/hostname string ftp.de.ubuntu.org
d-i mirror/ftp/directory string /ubuntu
d-i mirror/ftp/proxy string

### Account setup
# Skip creation of a root account (normal user account will be able to
# use sudo). The default is false; preseed this to true if you want to set
# a root password.
d-i passwd/root-login boolean false

d-i passwd/root-password-again password vagrant
d-i passwd/user-fullname string vagrant
d-i passwd/user-uid string 900
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/username string vagrant
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false

### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string EU/Copenhagen
d-i clock-setup/ntp boolean true

### Partitioning
d-i partman-auto/disk string /dev/sda
# - regular: use the usual partition types for your architecture
# - lvm:     use LVM to partition the disk
# - crypto:  use LVM within an encrypted partition
d-i partman-auto/method string regular
#d-i partman-auto/choose_recipe select atomic
d-i partman-basicfilesystems/no_swap boolean false
d-i partman-auto/expert_recipe string \
  all-in-one :: \
    50 50 50 ext3 \
      $primary{ } \
      $bootable{ } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext3 } \
      mountpoint{ /boot/grub } \
      . \
    250 250 250 ext3 \
      $primary{ } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext3 } \
      mountpoint{ /tmp } \
      . \
    2000 2000 2000 ext3 \
      $primary{ } \
      method{ format } \
      format{ } \
      use_filesystem{ } \
      filesystem{ ext3 } \
      mountpoint{ / } . \
    50 1000 -1 ext3 \
      $primary{ } \
      method{ format } format{ } \
      use_filesystem{ } filesystem{ ext3 } \
      mountpoint{ /data } \
      . \
d-i partman-auto/choose_recipe select all-in-one
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/mount_style select uuid
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string /dev/sda


###################################
### Kernel installation
d-i base-installer/kernel/image string linux-image-686-pae
###################################

### Apt
d-i apt-setup/non-free boolean false
d-i apt-setup/contrib boolean false
d-i apt-setup/services-select multiselect security
d-i apt-setup/security_host string security.ubuntu.org

### Package selection
tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server sudo bzip2 acpid zlib1g-dev wget curl dkms make
# No language support packages.
d-i pkgsel/install-language-support boolean false
d-i pkgsel/upgrade select none
# Prevent packaged version of VirtualBox Guest Additions being installed:
d-i preseed/early_command string sed -i \
  '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \
  /usr/lib/pre-pkgsel.d/20install-hwpackages
popularity-contest popularity-contest/participate boolean false

### Other
# Allow non-free firmware
d-i hw-detect/load_firmware boolean true
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note

My packer template file (ubutntu_xenial):

    {
    "variables": {
        "ubuntu_version": "16.04",
        "ubuntu_name": "xenial"
    },
  "builders": [
    {
      "type": "virtualbox-iso",
      "boot_command": [
        "<esc><wait>",
        "/install/vmlinuz <wait>",
        "auto=true <wait>",
        "priority=critical <wait>", 
        "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{user `ubuntu_name`}}.cfg <wait>",
        "preseed/interactive=false <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "5s",
      "disk_size": 2700,
      "guest_os_type": "Ubuntu",
      "headless": false,
      "http_directory": "http",
      "iso_url": "http://archive.ubuntu.com/ubuntu/dists/{{user `ubuntu_name`}}-updates/main/installer-i386/current/images/netboot/mini.iso",
      "iso_checksum_type": "none",
      "ssh_username": "vagrant",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_wait_timeout": "1000s",
      "shutdown_command": "echo 'vagrant'|sudo -S /sbin/shutdown -hP now",
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
      "virtualbox_version_file": ".vbox_version",
      "vm_name": "ubuntu-{{user `ubuntu_version`}}-i386",
      "vboxmanage": [
        [ "modifyvm", "{{.Name}}", "--memory", "4096" ],
        [ "modifyvm", "{{.Name}}", "--cpus", "4" ],
        [ "modifyvm", "{{.Name}}", "--vram", "128"],
        [ "modifyvm", "{{.Name}}", "--usb", "off"],
        [ "modifyvm", "{{.Name}}", "--ostype", "Ubuntu"],
        [ "modifyvm", "{{.Name}}", "--acpi", "on"],
        [ "modifyvm", "{{.Name}}", "--ioapic", "on"],
        [ "modifyvm", "{{.Name}}", "--hwvirtex", "on"],
        [ "modifyvm", "{{.Name}}", "--pae", "on"],
        [ "modifyvm", "{{.Name}}", "--nestedpaging", "on"],
        [ "modifyvm", "{{.Name}}", "--rtcuseutc", "on"],
        [ "modifyvm", "{{.Name}}", "--vrde", "on"]
      ]
    }
  ],
  "post-processors": [
    {
      "type": "vagrant",
      "compression_level": "9",
      "output": "ubuntu-{{user `ubuntu_version`}}-i386_{{.Provider}}.box",
      "only": ["virtualbox-iso"]
    }
  ],
  "provisioners": [
    {
      "type": "file",
      "source": "scripts/expand-rootfs.sh",
      "destination": "/home/vagrant/expand-rootfs.sh"
    },
    {
      "type": "file",
      "source": "scripts/regen-ssh-keys.sh",
      "destination": "/home/vagrant/regen-ssh-keys.sh"
    },
    {
      "type": "file",
      "source": "scripts/on-first-boot.sh",
      "destination": "/home/vagrant/on-first-boot.sh"
    },
    {
      "type": "file",
      "source": "scripts/on-first-boot.service",
      "destination": "/home/vagrant/on-first-boot.service"
    },
    {
      "type": "shell",
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
      "scripts": [
        "scripts/update.sh",
        "scripts/fs.sh",
        "scripts/sshd.sh",
        "scripts/networking.sh",
        "scripts/sudoers.sh",
        "scripts/vagrant.sh",
        "scripts/vbaddguest.sh",
        "scripts/cleanup.sh"
      ],
      "only": ["virtualbox-iso"]
    }
  ]
}

I'm not sure why it's not working, any help would be greatly appreciated.

-1

This worked for me:

"<tab><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>",
"<wait> preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-server.seed ",
"debian-installer=en_US auto=true locale=en_US kbd-chooser/method=us ",
"console-setup/ask_detect=false keyboard-configuration/layoutcode=us ",
"hostname=ubuntu initrd=initrd.gz --- quiet <wait><enter>"
| improve this answer | |
  • It is better to include a brief description of what your fix is doing, not just posting the raw code. 'Teach a man to fish' philosophy. – David Mar 25 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.