Thanks Rickard. I went ahead configuring the network on ubuntu boot with 
the script posted below. On a mac host with packer 1.3.1 this works well. 
However when running in a circleci <https://circleci.com> pipeline, packer 
build hangs on ssh:

==> virtualbox-ovf: Waiting for SSH to become available...==> virtualbox-ovf: 
Timeout waiting for SSH.


I guess there is no dhcp in circleci so tried installing a dhcp server but 
that did not solve the problem as well. 


```
#!/bin/bash

if [ -f /etc/network/interfaces ]; then
  mv /etc/network/interfaces /etc/network/interfaces.orig
fi

echo "# generated on startup"  >> /etc/network/interfaces
echo  >> /etc/network/interfaces

for networkfile in /sys/class/net/*; do
    [ -e "$networkfile" ] || continue
    [ "$networkfile" != "/sys/class/net/lo" ] || continue
    networkname=$(basename $networkfile)
    echo auto $networkname >> /etc/network/interfaces
    echo iface $networkname inet dhcp >> /etc/network/interfaces
    echo  >> /etc/network/interfaces
done

cat /etc/network/interfaces

ifreload -a
```




Am Dienstag, 16. Oktober 2018 01:39:13 UTC-7 schrieb Rickard von Essen:
>
> If you start that build, wait for the console, login with packer/packer 
> and run "ifconfig" you will see there is only a loopback interface.
>
> On Mon, Oct 15, 2018 at 10:59 PM hansman <[email protected] 
> <javascript:>> wrote:
>
>> i reproduced the same issue on a mac host machine. therefore i don't 
>> think it as a circleci issue. here is the image:
>>
>> https://drive.google.com/file/d/1AZvpqyrY5fojfUtl6qShB5aMYgU4_ny5
>>
>> and template:
>>
>> {
>>   "builders": [
>>     {
>>       "type": "virtualbox-ovf",
>>       "source_path": "
>> https://drive.google.com/file/d/1AZvpqyrY5fojfUtl6qShB5aMYgU4_ny5";,
>>       "ssh_username": "packer",
>>       "ssh_password": "packer",
>>       "ssh_timeout": "15m",
>>       "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
>>     }
>>   ]
>> }
>>
>>
>> Am Montag, 15. Oktober 2018 12:32:13 UTC-7 schrieb hansman:
>>>
>>> This issue appears on packer build: virtualbox-ovf: Timeout waiting for 
>>> SSH
>>>
>>>
>>>    - 
>>>    
>>>    packer version 1.3.1
>>>    - 
>>>    
>>>    host platform: circleci machine running circleci/classic:latest
>>>    - 
>>>    
>>>    guest image: ubuntu server 18 64 packaged as .ova
>>>    - 
>>>    
>>>    debug log (includes instructions)
>>>    packer-debug.txt 
>>>    <https://github.com/hashicorp/packer/files/2480136/packer-debug.txt>
>>>    - 
>>>    
>>>    template.json
>>>    
>>> {
>>>   "variables": {
>>>     "SSH_PASSWORD": "{{env `UBUNTU_PASSWORD`}}"
>>>   },
>>>   "builders": [
>>>     {
>>>       "type": "virtualbox-ovf",
>>>       "source_path": "file:///home/circleci/bin/ubuntu-server-18.ova",
>>>       "ssh_username": "myuser",
>>>       "ssh_password": "{{user `SSH_PASSWORD`}}",
>>>       "ssh_timeout": "10m",
>>>       "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
>>>     }
>>>   ],
>>>   "provisioners": [
>>>     {
>>>       "type": "shell",
>>>       "script": "packer/setup.sh" // a hello world script
>>>     }
>>>   ]
>>> }
>>>
>>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/996b715d-1850-4307-bdd9-8c53ef2e6c68%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/996b715d-1850-4307-bdd9-8c53ef2e6c68%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/f8d34c56-ba57-440b-b0f6-18d0ca073370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to