Установка из командной строки не работает в 16.04 mini.iso (не на сервере Ubuntu)

В настоящее время я сталкиваюсь с проблемой создания предустановленной 32-битной установки Ubuntu 16.04. Я устанавливаю в VirtualBox VM на рабочий стол Ubuntu 16.04. Исо я использую здесь: http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-i386/current/images/netboot/mini.iso

Мой запрос на установку выглядит следующим образом enter image description here

И я могу получить приглашение на загрузку, нажав <esc>. enter image description here

Я также могу получить другую подсказку (в которой уже заполнено много текста), выбрав Advanced options -> Command-line expert install и нажав <tab>, когда выбрано Command-line expert install enter image description here

Проблема, с которой я сталкиваюсь в настоящее время, заключается в том, что при получении любой из командных строк (очистка любого текста это может быть уже там) и попробуйте загрузить мой файл preseed, я возвращаюсь к первому экрану установки (первое изображение), или он продолжает задавать мне вопросы, даже если я уже задал ответы. Тогда процесс, который ожидает, что ssh станет доступным, истекает, и процесс завершается неудачей.

==> 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

Некоторые утверждают, что это ошибка в Ubuntu, которая не была перенесена в 16.04 .

В настоящее время я вижу много помощи в Интернете для сервера Ubuntu (не то, что я использую) и различные комбинации клавиш для команды загрузки для решения проблемы.

Я пытался:

  1. Переход к первому приглашению и добавление местоположения файла preseed "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>" ],
  2. Переход ко второму приглашению и выдача местоположение файла preseed "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_{{user ubuntu_name }}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  3. Переход к первому (и второму) приглашению и добавление местоположения файла preseed с использованием другого ключевого слова установки "boot_command": [ "<esc><wait>", "/install/vmlinuz <wait>", "auto <wait>", "priority=critical <wait>", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{user ubuntu_name }}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  4. Переход к первому (и второму) приглашению, а затем добавление местоположения файла preseed с использованием другого ключевого слова preseed url "boot_command": [ "<esc><wait>", "install <wait>", "auto <wait>", "priority=critical <wait>", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{user ubuntu_name }}.cfg <wait>", "preseed/interactive=false <wait>", "<enter><wait>" ],
  5. Переход к первая (и вторая) подсказка, а затем добавление местоположения файла preseed с использованием расширенных ключевых слов "boot_command": [ "<esc><wait>", "install <wait>", "auto <wait>", "priority=critical <wait>", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_{{user ubuntu_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. Я пробовал использовать другой iso (пытался получить сервер ubuntu iso) но когда я это сделаю, процесс virtuabox не сможет сделать это жестким приводом.
    ==> 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" 

Мой предварительный файл (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

Мой файл шаблона упаковщика (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"]
    }
  ]
}

Я не конечно, почему это не работает, любая помощь будет принята с благодарностью.

0
задан 30 August 2019 в 20:53

1 ответ

Это сработало для меня:

"<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>"
-1
ответ дан 25 March 2020 в 09:04

Другие вопросы по тегам:

Похожие вопросы: