If you don't change the network type it should work with the example in the
docs. Get that working first and then change the network type only if you
really need to.

On Nov 25, 2017 21:00, "valli nayagam" <valli...@gmail.com> wrote:

> Because the machine boots with Network as "Nat" and may be because of that
> the pressed.file is not accessible for the VM
>
> Correct me if i'm wrong and what could be the problem to retrieve the
> preseed file.
>
> Regards
> Valli
>
> On Sunday, 26 November 2017 01:03:09 UTC+5:30, Rickard von Essen wrote:
>>
>> Just to clearify, why do you need a bridged network?
>>
>> On Nov 25, 2017 20:04, "valli nayagam" <vall...@gmail.com> wrote:
>>
>> Hello everyone,
>>
>> I'm newbie to packer, I'm trying to install debian os in virtualbox. But
>> it looks network is not connected with host machine and failed to retrieve
>> the preseed file.
>>
>> Json file:
>> {
>> "variables":{
>> "hostname": "testmachine",
>> "packerhost": "192.168.0.5",
>> "ip": "192.168.0.125",
>> "netmask": "255.255.255.0",
>> "gateway": "192.168.0.1",
>> "domain": "test.net",
>> "nameservers": "192.168.0.1",
>> "language_country": "en_US",
>> "keyboard": "en"
>> },
>>
>> "builders": [
>> {
>>   "type": "virtualbox-iso",
>>   "guest_os_type": "Ubuntu_64",
>>   "iso_url": "file:///../resources/operatingSystem_ISO/debian-9.2.1-
>> amd64-DVD-1.iso",
>>   "iso_checksum": "a6e3743a6df3e69851fd5a3e7f6f1466",
>>   "iso_checksum_type": "md5",
>>   "http_directory": "http",
>>   "http_port_min": "9001",
>>   "http_port_max": "9001",
>>   "ssh_username": "packer",
>>   "ssh_password": "packer",
>>   "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
>>   "vboxmanage": [
>> [ "modifyvm", "{{.Name}}", "--memory", "2048" ],
>> [ "modifyvm", "{{.Name}}", "--vram", "36" ],
>> [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
>> [ "modifyvm", "{{.Name}}", "--hardwareuuid",
>> "02f110e7-369a-4bbc-bbe6-6f0b6864ccb6" ],
>> [ "modifyvm", "{{.Name}}", "--nic0","bridged"]
>>   ],
>>   "boot_command": [
>> "<esc><wait>",
>> "install ",
>> "preseed/url=http://192.168.0.105:8080/preseed-deb9.cfg ",
>> "hostname={{user `hostname`}} ",
>> "netcfg/disable_autoconfig=true ",
>> "netcfg/get_domain={{user `domain`}} ",
>> "netcfg/confirm_static=true ",
>> "netcfg/get_ipaddress={{user `ip`}} ",
>> "netcfg/get_netmask={{user `netmask`}} ",
>> "netcfg/get_gateway={{user `gateway`}} ",
>> "netcfg/get_nameservers={{user `nameservers`}} ",
>> "debian-installer={{user `language_country`}} auto locale={{user
>> `language_country`}} ",
>> "keyboard-configuration/xkb-keymap={{user `keyboard`}} ",
>> "fb=false ",
>> "debconf/frontend=noninteractive ",
>> "console-setup/ask_detect=false ",
>> "<enter><wait>"
>>   ]
>>   }]
>>
>> So, I tried to add a nic card to vbox but it failed with error
>>
>>
>>
>> H:\VMWare_Installation\packer>packer build -on-error=abort
>> packer-test-valli.json
>> virtualbox-iso output will be in this color.
>>
>> ==> virtualbox-iso: Downloading or copying Guest additions
>>     virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Ora
>> cle/VirtualBox/VBoxGuestAdditions.iso
>> ==> virtualbox-iso: Downloading or copying ISO
>>     virtualbox-iso: Downloading or copying: file:///H:/VMWare_Installation
>> /resources/operatingSystem_ISO/debian-9.2.1-amd64-DVD-1.iso
>> ==> virtualbox-iso: Starting HTTP server on port 9001
>> ==> virtualbox-iso: Creating virtual machine...
>> ==> virtualbox-iso: Creating hard drive...
>> ==> virtualbox-iso: Creating forwarded port mapping for communicator
>> (SSH, WinRM, etc) (host port 2376)
>> ==> virtualbox-iso: Executing custom VBoxManage commands...
>>     virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1511636150
>> --memory 2048
>>     virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1511636150
>> --vram 36
>>     virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1511636150
>> --cpus 2
>>     virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1511636150
>> --hardwareuuid 02f110e7-369a-4bbc-bbe6-6f0b6864ccb6
>>     virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1511636150
>> --nic0 bridged
>> ==> virtualbox-iso: Error executing command: VBoxManage error:
>> VBoxManage.exe: error: Invalid NIC number 0
>> ==> virtualbox-iso: Step "StepVBoxManage" failed, aborting...
>> Build 'virtualbox-iso' errored: unexpected EOF
>>
>> ==> Some builds didn't complete successfully and had errors:
>> --> virtualbox-iso: unexpected EOF
>>
>> ==> Builds finished but no artifacts were created.
>>
>>
>> What's the problem and how to retrive the preseed file?
>>
>>
>>
>>
>> --
>> 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.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/packer-tool/f372f4af-7c34-40e1-976d-5105834d575f%40googlegroups.com
>> <https://groups.google.com/d/msgid/packer-tool/f372f4af-7c34-40e1-976d-5105834d575f%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 packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/d6d4f9cf-621e-491d-98c9-b319619694f7%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/d6d4f9cf-621e-491d-98c9-b319619694f7%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 packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_V%2BFTTknmoJqD0WXm2qFbp%3DFZaEuvJpM6a6VaHoBTUCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to