Hi, Its working once I change the network type. Now I'm trying to set the 
static ip address for the Debian VM but its not working. Installation was 
completed successfuilly and statictally given ip address is not getting 
assigned

Please have a look of json and preseed changes and help me on this topic

Template:

"builders": [
    {
      "type": "virtualbox-iso",
      "boot_command": [
        "<esc><wait>",
        "install <wait>",
        "preseed/url=http://192.168.0.105:8080/preseed-deb9.cfg ",
        "debian-installer=en_US <wait>",
        "auto <wait>",
        "locale=en_US <wait>",
        "kbd-chooser/method=us <wait>",
"d-i netcfg/disable_autoconfig boolean true <wait>",
"d-i netcfg/disable_dhcp true <wait>",
"d-i netcfg/confirm_static=true <wait>",
"d-i netcfg/dhcp_options select Configure network manually <wait>",
"d-i netcfg/get_ipaddress string 192.168.0.130 <wait>",
"d-i netcfg/get_netmask string 255.255.255.0 <wait>",
"d-i netcfg/get_gateway string 192.168.0.1 <wait>",
"d-i netcfg/get_nameservers string 192.168.0.1 <wait>",
"d-i netcfg/confirm_static boolean true <wait>",
        "netcfg/get_hostname={{ .Name }} <wait>",
        "netcfg/get_domain=testing.com <wait>",
        "fb=false <wait>",
        "debconf/frontend=noninteractive <wait>",
        "console-setup/ask_detect=false <wait>",
        "console-keymaps-at/keymap=us <wait>",
        "keyboard-configuration/xkb-keymap=us <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": 45536,
      "guest_os_type": "Debian_64",
      "http_directory": "http",
       "iso_checksum": "a6e3743a6df3e69851fd5a3e7f6f1466",
      "iso_checksum_type": "md5",
      "iso_url": 
"file:///../resources/operatingSystem_ISO/debian-9.2.1-amd64-DVD-1.iso",
  "vm_name": "Testmachine",
      "ssh_username": "viewpoint",
      "ssh_password": "user",
      "ssh_port": 22,
      "ssh_wait_timeout": "10000s",
      "shutdown_command": "echo 'halt -p' > shutdown.sh; echo 
'vagrant'|sudo -S bash 'shutdown.sh'",
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
      "virtualbox_version_file": ".vbox_version",
      "vboxmanage": [
        ["modifyvm", "{{.Name}}", "--memory", "512"],
        ["modifyvm", "{{.Name}}", "--cpus", "1"],
["modifyvm", "{{.Name}}", "--nic1", "bridged"],
["modifyvm", "{{.Name}}", "--bridgeadapter1", "TP-LINK Wireless USB 
Adapter"],
["modifyvm", "{{.Name}}", "--vrde", "on"]
      ]
    }
      ]
  }

Preseed changes:


# 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

# To pick a particular interface instead:
#d-i netcfg/choose_interface select enp0s3

# To set a different link detection timeout (default is 3 seconds).
# Values are interpreted as seconds.
#d-i netcfg/link_detection_timeout string 10

# If you have a slow dhcp server and the installer times out waiting for
# it, this might be useful.
#d-i netcfg/dhcp_timeout string 60
#d-i netcfg/dhcpv6_timeout string 60

# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/disable_dhcp true
d-i netcfg/confirm_static=true

# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually

# Static network configuration.
#
# IPv4 example
d-i netcfg/get_ipaddress string 192.168.0.130
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.0.1
d-i netcfg/get_nameservers string 192.168.0.1
d-i netcfg/confirm_static boolean true

Thanks in advance


Valli








On Sunday, 26 November 2017 01:40:14 UTC+5:30, Rickard von Essen wrote:
>
> 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" <vall...@gmail.com <javascript:>> 
> 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/Oracle/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/msgid/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...@googlegroups.com <javascript:>.
>> 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/a1e227ab-b0ea-47e6-b408-feea87e8c025%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to