for 3: 3) change the first bridged nic to NAT , add the second nic to be as bridged. packer can be successful. but we need manually add config info for nic 2, otherwise nic can't get dhcp ip. this is a little difficult if we want to automate considering the types of host machine/guest os.
network --bootproto=dhcp https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax --device= - specifies the device to be configured (and eventually activated in *Anaconda*) with the network command. you should always specify a --device= for every network command. use floppy to pass the kickstart, and in the kicstart configure the networks as you need you can add multiples, say first one dhcp for packer and 2nd for your network wirh dhcp or fixed for the last q: https://www.packer.io/docs/builders/virtualbox-iso.html#vboxmanage_post i still wonder why not doing this in 2 steps first step install OS from iso second step with intermediate box, do the os update and software installation alvaro On Wed, Jan 24, 2018 at 11:58 AM, JerryWang <[email protected]> wrote: > I have tried the following options: > > 1) change the only (first) bridged nic from dhcp to static ip, packer can > be successful. but it was valueless for my configuration, we need bridged > nic with dhcp. > 2) add the second nic to nat (keep the first as bridged), failed. > 3) change the first bridged nic to NAT , add the second nic to be as > bridged. packer can be successful. > but we need manually add config info for nic 2, otherwise nic can't get > dhcp ip. this is a little difficult if we want to automate considering the > types of host machine/guest os. > > 4) will try the fourth option, > > a)first change the only (first) bridged nic to NAT. > b)do some provioner script operation > c) poweroff the guest machine > d) add a script to change the only (first) bridged nic to NAT. > e) export the vm to ova. > > Hi guys, is it possible to add stepd between c and e ? > > > > > > On Monday, January 22, 2018 at 5:11:22 PM UTC+8, Alvaro Miranda Aguilera > wrote: >> >> couple of options. >> >> but first, move from something that works, to add incremental steps. so >> get a packer + os + nat to install without network/internet requirement. >> >> >> >> As rickard suggestion, add a 2nd interface, that is on the bridge network >> and test it works. >> >> You need this after OS install, after reboot, so OS intall should be done >> first, also, you can look this in 2 steps. >> >> use say virtualbox-iso to just install the OS and create a base box. nat >> is fine since no internet is needed >> >> then use virtualbox-ovf to create a VM from the base VM and do the >> network part. >> >> >> If I had to do this in one shot, then I would try to get a fixed IP from >> the network and use it . >> >> >> >> >> On Mon, Jan 22, 2018 at 8:35 AM, jerry wang <[email protected]> wrote: >> >>> thanks for your reply. >>> my requirement is : >>> 1) Currently it's mandatory for me to use bridge to configure guest os >>> due my software limitation. >>> 2) the ip of guest os was using dhcp . >>> 3) can you share the tech that host machine connect to guest os ( just >>> as you said, not sure packer are able to get the IP of the guest >>> dinamically ) ? in other word, how to avoid the connection issue if using >>> bridged ? >>> >>> Thanks in advancd. >>> >>> >>> On Mon, Jan 22, 2018 at 3:26 PM, Alvaro Miranda Aguilera < >>> [email protected]> wrote: >>> >>>> the nat mode will use the host networking to reach the network, why you >>>> need bridge? >>>> >>>> bridge mode will work, just not sure if will be able to get the IP of >>>> the guest dinamically, so may fail to connect automagically >>>> >>>> if you can share the requirements perhaps will be easier to help >>>> >>>> alvaro >>>> >>>> On Mon, Jan 22, 2018 at 7:44 AM, <[email protected]> wrote: >>>> >>>>> i was creating vm with existing ova, my template is as below: >>>>> ............................................................ >>>>> ........................................................ >>>>> "builders" : [{ >>>>> "type" : "virtualbox-ovf", >>>>> "name" : "vboxOvfBuilder", >>>>> "vboxmanage" : [ >>>>> [ "modifyvm", "{{.Name}}", "--memory", "{{user `memSize`}}"], >>>>> [ "modifyvm", "{{.Name}}", "--cpus", "{{user `cpuCount`}}" ], >>>>> [ "modifyvm", "{{.Name}}", "--bridgeadapter1", "eno1"] >>>>> ], >>>>> "source_path" : "{{user `diskImg`}}", >>>>> "format" : "{{user `diskFmt`}}", >>>>> "headless" : true, >>>>> "vrdp_bind_address" : "0.0.0.0", >>>>> "output_directory" : "images-{{timestamp}}", >>>>> "ssh_port" : 22, >>>>> "ssh_username" : "root", >>>>> "ssh_password" : "welcome1", >>>>> "ssh_wait_timeout" : "1500s", >>>>> "vm_name" : "oraclelinux7u4-vbox", >>>>> "shutdown_command" : "shutdown -P now" >>>>> } >>>>> ], >>>>> >>>>> during builder, ssh conection failed. >>>>> ............................................................ >>>>> ............................................................ >>>>> ............................................................ >>>>> ............................................................ >>>>> ........... >>>>> 2018/01/22 14:31:35 packer: 2018/01/22 14:31:35 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:31:40 packer: 2018/01/22 14:31:40 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:31:45 packer: 2018/01/22 14:31:45 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:31:50 packer: 2018/01/22 14:31:50 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:31:55 packer: 2018/01/22 14:31:55 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:32:00 packer: 2018/01/22 14:32:00 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> 2018/01/22 14:32:05 packer: 2018/01/22 14:32:05 [DEBUG] TCP connection >>>>> to SSH ip/port failed: dial tcp 127.0.0.1:2349: getsockopt: >>>>> connection refused >>>>> ............................................................ >>>>> ............................................................ >>>>> ............................................................ >>>>> ............................................................ >>>>> ........... >>>>> hence i'm doubt whether packer support bridged mode ? >>>>> >>>>> i have tried to set ssh_skip_nat_mapping to true, it still failed. >>>>> >>>>> >>>>> -- >>>>> 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/43c2e6f0-bf7c- >>>>> 4704-98ff-dd6cf7250be1%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/packer-tool/43c2e6f0-bf7c-4704-98ff-dd6cf7250be1%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 a topic in the >>>> Google Groups "Packer" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>>> pic/packer-tool/g2-n5syCxe8/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> [email protected]. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/packer-tool/CAHqq0ezuL028CymtnRGP81ZDb3zhKJG-_sBHFz_ >>>> EWzVzdCbGMw%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/packer-tool/CAHqq0ezuL028CymtnRGP81ZDb3zhKJG-_sBHFz_EWzVzdCbGMw%40mail.gmail.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/ms >>> gid/packer-tool/CAFj7CQLzwiJB7QW_ikme_jB0sM5gvMTKM- >>> cPM1kNLvjUfZyfjA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/packer-tool/CAFj7CQLzwiJB7QW_ikme_jB0sM5gvMTKM-cPM1kNLvjUfZyfjA%40mail.gmail.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/9b5779c1-ac78-483f-82c7-b2eccada4cfb%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/9b5779c1-ac78-483f-82c7-b2eccada4cfb%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/CAHqq0ewZumHnkjw_qASiupKxfknEoHJaAhHTi%2BL7TCr9h9%3DeRg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
