DebianInstaller没有启动

时间:2016-11-19 19:34:46

标签: vagrant packer

以下是我的build.json打包程序文件

{
    "builders": [{
        "type": "virtualbox-iso",

        "guest_os_type": "Ubuntu_64",
        "http_directory": "http",
        "iso_url": "http://mirrors.evowise.com/linuxmint//stable/18/linuxmint-18-xfce-64bit.iso",
        "iso_checksum_url": "https://ftp.heanet.ie/mirrors/linuxmint.com/stable/18/sha256sum.txt",
        "iso_checksum_type": "sha256",
        "ssh_username": "vagrant",
        "ssh_password": "vagrant",
        "boot_command": [
            "<esc><wait><esc><wait>",
            "/casper/vmlinuz initrd=/casper/initrd.lz",
            " url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
            " boot=casper automatic-ubiquity quiet splash noprompt",
            " -- ",
            "<enter>"
        ],
        "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
        "hard_drive_interface": "sata",
        "output_directory": "target",
        "vboxmanage": [
            ["modifyvm", "{{.Name}}", "--memory", "2048"],
            ["modifyvm", "{{.Name}}", "--cpus", "2"]
        ]
    }]
}

和我的preseed.cfg(位于http sub dir)

#Step 1
d-i debian-installer/locale string en_US

#Step 2
d-i time/zone string Europe/Warsaw

#Step 3
d-i console-setup/layoutcode string pl

#Step 4
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true

#Step 5
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i user-setup/allow-password-weak boolean true
d-i netcfg/get_hostname string vagrant
d-i passwd/auto-login boolean true

# Use non-free packages
ubiquity ubiquity/use_nonfree boolean true

#if you want to start commands after the installation
ubiquity ubiquity/success_command string in-target apt-get -y install openssh-server && /etc/init.d/ssh restart;

#Step 6
ubiquity ubiquity/summary note
ubiquity ubiquity/reboot boolean true

我的理解是"http_directory": "http",通过http服务器发布,url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg应该加载它。然而,这并没有发生。机器只引导进入Linux Mint,我可以通过GUI手动安装。我错过了什么?

1 个答案:

答案 0 :(得分:2)

我在尝试预制薄荷18 kde时遇到了这个问题,并发现按下了#esc&#39;得到启动:&#39;提示总是似乎只是启动到现场CD,无论我输入什么提示。

然而,点击第一个菜单项上的标签,删除命令,然后用我自己的命令替换它,然后启动到无处不在。这是我的打包文件中的启动命令:

"boot_command": [
  "<esc><wait><tab><wait><leftCtrlOn>u<leftCtrlOff>",
  "/casper/vmlinuz initrd=/casper/initrd.lz",
  " url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
  " automatic-ubiquity debug-ubiquity boot=casper nosplash noprompt",
  " -- ",
  "<enter>"
]

这会弹出第一个启动命令并使用ctrl-u清除该行并输入我想要的命令。