check virtualnbox documentation, first nic = nic1 [--nic<1-N> none|null|nat|bridged|intnet|hostonly|generic|natnetwork]
On Sat, Nov 25, 2017 at 8:04 PM, valli nayagam <[email protected]> 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 [email protected]. > 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. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0exQLXqs9KVoHdcdPR4vJok60AphAJsp3f6Y7bWsFoXcSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
