Packer-VirtualBox Faild to retrive the preconfiguration file

778 views
Skip to first unread message

Samirkanta Lenka

unread,
Aug 4, 2016, 3:46:41 PM8/4/16
to Packer
I am getting this issue-

Please help me on this

My Configuration File-

{
    "variables": {
        "ssh_name": "samir",
        "ssh_pass": "samir",
        "hostname": "packer-test"
    },

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

        "vboxmanage": [
            ["modifyvm", "{{.Name}}", "--vram", "32"]
        ],

        "disk_size" : 10000,

        "iso_url": "http://releases.ubuntu.com/precise/ubuntu-12.04.5-server-amd64.iso",
        "iso_checksum": "769474248a3897f4865817446f9a4a53",
        "iso_checksum_type": "md5",

        "http_directory" : "http_directory",
        "http_port_min" : 9001,
        "http_port_max" : 9001,

        "ssh_username": "{{user `ssh_name`}}",
        "ssh_password": "{{user `ssh_pass`}}",
        "ssh_wait_timeout": "20m",

        "shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now",

        "boot_command" : [
            "<esc><esc><enter><wait>",
            "/install/vmlinuz noapic ",
            "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
        "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
        "hostname={{ .Name }} ",
            "fb=false debconf/frontend=noninteractive ",
            "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
            "keyboard-configuration/variant=USA console-setup/ask_detect=false ",
            "initrd=/install/initrd.gz -- <enter>"
        ]
    }],
      "provisioners": [{
        "type": "shell",
        "script": "script.sh"
    }]
}
Capture67.PNG

Alvaro Miranda Aguilera

unread,
Aug 4, 2016, 4:01:26 PM8/4/16
to packe...@googlegroups.com
Hello,

Whats the content of http_directory?

Can you reach that url from the host when packer is running?


Whats your OS? if windows, can you test without firewall?

Can you try with different set of ports?

Thanks
Alvaro

--
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 packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/10197244-15ef-4e8f-9dd2-98f3c2ab8399%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Samirkanta Lenka

unread,
Aug 4, 2016, 4:35:30 PM8/4/16
to Packer
Hello Alvaro,

thanks for your reply

these are the information what you asked-


http_directory="http"

No that one is defaultly configured i am unable to reach to that ip.

i dont have any idea how to change that ip

Please suggest me one working port other then that

i am using Windows 8.1 Professional

Please do help me on this

Alvaro Miranda Aguilera

unread,
Aug 4, 2016, 4:53:28 PM8/4/16
to packe...@googlegroups.com
hello

http_directory shoud point to a folder that will be shared over http.

so in your case in the folder where you have the files, can you check you have http/preseed.cfg ?

when packer is running and a new VM is created by packer, try to use a browser to that url, once from your host computer is fine.

Thanks
Alvaro.

--
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 packer-tool+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Message has been deleted
Message has been deleted

Samirkanta Lenka

unread,
Aug 5, 2016, 11:23:38 AM8/5/16
to Packer
Hello Alvaro,

Thanks for your reply-
But i am not specifying any path and I followd the following site for creating the image. So there is no path to specify . If it needed could you please help me to set up that.

http://kappataumu.com/articles/creating-an-Ubuntu-VM-with-packer.html

Alvaro Miranda Aguilera

unread,
Aug 5, 2016, 11:31:39 AM8/5/16
to packe...@googlegroups.com
Hello,

If you are after ubuntu 12.04, please try this:


Plase create an account in atlas:

Then do the tutorial:

Thanks
Alvaro.

--
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 packer-tool+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Samirkanta Lenka

unread,
Aug 5, 2016, 12:53:05 PM8/5/16
to Packer
Hello Alvaro,

Thanks for your quick reply-
Here is my requirements-

Wants to create an ubuntu image using Packer, where Shell Scripts as the provisioners and being built for Virtual Box.

Can you please help me on this.

Alvaro Miranda Aguilera

unread,
Aug 5, 2016, 12:55:40 PM8/5/16
to packe...@googlegroups.com
Hello.

already did.

I suggest perform the tutorial and learn from the process.

The repo used in the tutorial works.

Alvaro.

--
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 packer-tool+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

samir kanta lenka

unread,
Aug 5, 2016, 1:26:42 PM8/5/16
to packe...@googlegroups.com
Yeah,  I will go through
that and will ask u if i will get any doubts or stuck any where.

Thank You  for your support.

You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/UTpC6Qg9UFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0ezc9vLZPwO%3D5G9w5cVyDpr%3D5B%3D-LM-%2BnFCWfKNfdqMEXQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and regards,
Samir Kanta Lenka.
email:lenkasa...@gmail.com
contact:9778989609

Samirkanta Lenka

unread,
Aug 5, 2016, 2:17:43 PM8/5/16
to Packer
Hello Alvaro,

Thanks for your quick reply-

I just created one folder called http and placed my preseed.cfg file inside it and the previous one worked fine.

the vertual image created successfully but it is getting closed after some times and it is showing one logo in my Virtulbox during the creation process after it is disapearing.

Please help me on this.

Thank you for your support.

Chen Xi

unread,
Aug 25, 2016, 2:31:50 PM8/25/16
to Packer
Hi Alvaro,

I am seeing the same issue. My question is do we need to build a http server on local machine running packer.

Thanks,
Xi


On Friday, August 5, 2016 at 12:55:40 PM UTC-4, Alvaro Miranda Aguilera wrote:
Hello.

already did.

I suggest perform the tutorial and learn from the process.

The repo used in the tutorial works.

Alvaro.
On Fri, Aug 5, 2016 at 6:53 PM, Samirkanta Lenka <lenkasa...@gmail.com> wrote:
Hello Alvaro,

Thanks for your quick reply-
Here is my requirements-

Wants to create an ubuntu image using Packer, where Shell Scripts as the provisioners and being built for Virtual Box.

Can you please help me on this.

--
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 packer-tool...@googlegroups.com.



--

Alvaro Miranda Aguilera

unread,
Aug 26, 2016, 3:01:49 AM8/26/16
to packe...@googlegroups.com
Hello,

Packer can open a http server and serve a directory from there.

ie:

{
"type": "virtualbox-iso",
"boot_command": [
..

preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
..
],
..
"http_directory": "http",
..
},


Here you can see the directory http/ will be on a web server

and then the intaller will read a response file from http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg
Thanks
Alvaro.


To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c7974cf6-5a70-4a9d-a0d9-40fe7a2ade15%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Jiarui Hong

unread,
Aug 26, 2016, 8:13:52 AM8/26/16
to Packer
Beside Alvaro's explanation, here're a few tips from me:

1. Since packer is very eager to remove the failed build output, you need some way to investigate what's going on *during the build*. Thus try launching packer with "-debug" flag! It pauses the build after every step, giving you infinite time to see what's going on in the VM.
2. Once the build is paused, press "Ctrl+Alt+F1" or similar in VM console to switch to another console, and check if you can access the http server from there. 
3. If you can't access the http server from there, then there can be multiple reasons. 
  3.1 Check virtualbox logs to see if there was an error with NAT.
  3.2. Check if firewall blocked it.
  3.3. Check packer log to see if the http server started successfully.



--

Chen Xi

unread,
Aug 29, 2016, 12:50:46 AM8/29/16
to packe...@googlegroups.com
Hi Alvaro, Jiarui,

Thanks for your quick response. I successfully built my first packer ovf file. A big thankyou to the team for providing such a nice tool to the DevOp world.

Best,
Xi

You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/UTpC6Qg9UFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/33d2e587-f65e-4fb7-83a2-fe830f0fd519%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages