Your preseed.cfg file should be in the http directory (specified by "http_directory": "http"). And it will be availible to the VM on HTTP and loaded by the installer by this part of the boot_command:
preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg There {{.HTTPIP}}:{{.HTTPPort}} will be replaced with the actual IP and port of a http-server that packer will start. All of these things seems ok (if you putt the preseed.cfg in the http directory), but you need to be able to run (and start a VM manually) in VirtualBox without it core dumping. On Mon, Jan 14, 2019 at 10:56 AM Tekchand Dagar <[email protected]> wrote: > Hello Rickard, > > Thank you for your quick response. > > I am also confused with preseed.cfg i have copied that .json template > from internet and using. I need to specify the full URL for preseed.cfg or > can i create preseed.cfg file at my packer machine and specify the file > path in .json template? > > Below is the link for preseed.cfg file but i didn't specify it anywhere in > my .json template. > > *https://raw.githubusercontent.com/pavel-klimiankou/packer-example/master/http/preseed.cfg > <https://raw.githubusercontent.com/pavel-klimiankou/packer-example/master/http/preseed.cfg>* > > How we can check the VM console because i don't have GUI mode for my > packer machine. When i am trying to run the virualbox over my packer > machine i am getting below error: > > [image: Selection_012.png] > > > I have removed the duplicate keys from my .json file. > > Please help me. > > On Monday, January 14, 2019 at 2:56:57 PM UTC+5:30, Rickard von Essen > wrote: >> >> Please provide your preseed.cfg and also a screenshot of the VM console >>> when SSH times out. Also your ssh_timeout seems way to short to install >>> Ubuntu. Increase it to something like 15m. (And you have some duplicate >>> keys in your config what can cause you trouble in the future). >> >> >> On Mon, Jan 14, 2019 at 10:13 AM Tekchand Dagar <[email protected]> >> wrote: >> >>> Hello Team, >>> >>> I am getting the below error during virtualbox image creation: >>> >>> Error: >>> >>> Build 'virtualbox-iso' errored: Timeout waiting for SSH. >>> >>> Below is my .json file. >>> >>> { >>> "builders": [ >>> { >>> "type": "virtualbox-iso", >>> "guest_os_type": "Ubuntu_64", >>> "iso_url": " >>> http://releases.ubuntu.com/16.04/ubuntu-16.04.5-server-amd64.iso", >>> "iso_checksum": >>> "c94de1cc2e10160f325eb54638a5b5aa38f181d60ee33dae9578d96d932ee5f8", >>> "iso_checksum_type": "sha256", >>> "ssh_username": "ubuntu", >>> "output_directory": "/tek", >>> "vm_name": "packerimage", >>> "disk_size": "10000", >>> "headless": "true", >>> "http_directory": "http", >>> "boot_wait": "2m30s", >>> "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 ", >>> "initrd=/install/initrd.gz ", >>> "net.ifnames=0 ", >>> "auto-install/enable=true ", >>> "debconf/priority=critical ", >>> "preseed/url=http:// >>> {{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg", >>> "<enter>" >>> ], >>> "ssh_timeout": "1m30s", >>> "ssh_username": "ubuntu", >>> "ssh_password": "ubuntu", >>> "shutdown_command": "sudo systemctl poweroff", >>> "shutdown_command": "sudo systemctl poweroff", >>> "vboxmanage": [ >>> ["modifyvm", "{{.Name}}", "--memory", 512], >>> ["modifyvm", "{{.Name}}", "--cpus", 1] >>> ] >>> }], >>> "provisioners": [{ >>> "type": "shell", >>> "script": "ansible.sh" >>> } >>> ]} >>> >>> -- >>> This mailing list is governed under the HashiCorp Community Guidelines - >>> https://www.hashicorp.com/community-guidelines.html. Behavior in >>> violation of those guidelines may result in your removal from this mailing >>> list. >>> >>> GitHub Issues: https://github.com/mitchellh/packer/issues >>> IRC: #packer-tool on Freenode >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Packer" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/packer-tool/0f31af57-6c7b-4056-8369-6fa597af052f%40googlegroups.com >>> <https://groups.google.com/d/msgid/packer-tool/0f31af57-6c7b-4056-8369-6fa597af052f%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/591585e7-d11e-4cba-92a2-cd668effb08d%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/591585e7-d11e-4cba-92a2-cd668effb08d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt-PhVs6a_-xjqBK%3DigtFbqLWZJrgw-PNhw_SjSB-8wLpw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
