VBoxManage error: nonexistent host networking interface

196 views
Skip to first unread message

dean warren

unread,
Sep 24, 2018, 4:08:29 AM9/24/18
to Packer
I am trying to pack for SLES 11 and Virtualbox.
 
e.g.

        "builders": [
                {
                        "type": "virtualbox-iso",
                        "guest_os_type": "OpenSUSE_64",
                        "iso_url": "file:///Users/warren_d/packer/iso/sles11sp1/SLES-11-SP1-x86_64-DVD1.iso",
                        "iso_checksum": "D2E10420F3689FAA49A004B60FB396B7",
                        "iso_checksum_type": "md5",
                        "ssh_username": "vagrant",
                        "ssh_password": "vagrant",
                        "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
                        "http_directory": "http",
                        "boot_wait": "10s",
                        "boot_command": [
                                "<esc><enter><wait>",
                                "           linux <wait>",
                                " lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml<wait>",
                                " textmode=1<wait>",
                                "<enter><wait>"
                        ],
                        "vboxmanage": [
                                [
                                        "modifyvm",
                                        "{{ .Name }}",
                                        "--nic1",
                                        "bridged"
                                ]
                        ]
                }
        ],

I need the HTTPIP to be that of the host machine. By default Vbox configures the NIC as a NAT, so I get a 10.0... IP address. Thus I need to change to a Bridged NIC so I can utilise my http folder to get the autoyast file.

However vbox reports no NIC (as per subject). Is this a packer specific problem (as Vbox seems to work fine outside of Packer)? How to I fix/work around this?

Thanks in advance

Rickard von Essen

unread,
Sep 24, 2018, 5:55:44 AM9/24/18
to packe...@googlegroups.com
I need the HTTPIP to be that of the host machine. By default Vbox configures the NIC as a NAT, so I get a 10.0... IP address. Thus I need to change to a Bridged NIC so I can utilise my http folder to get the autoyast file.

I'm not sure I understood correctly, but if by "http folder" you mean the directory you configured with "http_directory" you should not change from NAT. It will work out of the box.

If you switch to bridge ssh will not work.

If you remove the vboxmanage section what is the problem then?

// Rickard 

--
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/81b9062c-3ac9-4dec-9699-ec1aa4536feb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dean warren

unread,
Sep 24, 2018, 6:14:06 AM9/24/18
to Packer
Thanks for the reply @Rickard.

Yes I do mean the 'http_directory'. Forgive me as I am a noob to packer...

So when I run packer build on my packer file (as provided but without the 'vboxmanage' section) I get the error in SLES installation stating:
'Cannot find URL 'http://10.0.2.2:8353/autoinst.xml' via protocol HTTP(S)'

I assumed this was because of the IP address, i.e. my host is on a 192.168... address for example?
Thus I added the 'vboxmange' section as shown to attempt to change the NIC to bridged so it will be on the correct (same) network of the host. I assumed the URL could not be found because of the IP address?

Do you think my assumptions are potentially wrong? Can you see other reasons?

dean warren

unread,
Sep 24, 2018, 6:26:54 AM9/24/18
to Packer
FYI @Rickard my folder structure is as follows:

packer.json
http
    autoinst.xml
scripts

Hope this helps.

Alvaro Miranda Aguilera

unread,
Sep 25, 2018, 7:26:58 AM9/25/18
to packe...@googlegroups.com
hello there

if you could share an actual copy of your repo in github, and a copy of the packer build output will be quicker to help.

alvaro


For more options, visit https://groups.google.com/d/optout.


--
Alvaro

dean warren

unread,
Sep 25, 2018, 8:58:34 AM9/25/18
to packe...@googlegroups.com

Thanks for your replay @Alvaro


Unfortunately it is not possible to share my repo at this time. That said, the info I have given is everything in the repo e.g.

one packer file called 'packer.json' whose content is as initially shown. With a sub directory called 'http' that contains the 'autoinst.xml' file. The only item missing from my post is the contents of the 'autoinst.xml' file, which I cannot post. However it's contents is not the problem here, as is described, the 'autoinst.xml' file is not found. Thus I assumed the IP address was the problem (as per message reported during SLES setup)...


Not sure what else I can give... other then creating a dummy repo with similar content and posting that?





Rickard von Essen

unread,
Sep 25, 2018, 9:21:33 AM9/25/18
to packe...@googlegroups.com
add --on-error=ask to your packer build command. When the autoyast fails, jump in to the vm's console and troubleshoot the network. Do you have an IP, can you reach the host? Do you have a nasty (Windows) firewall intercepting all traffic?


If that doesn't work there is something with you computer/os/virtualbox.

Reply all
Reply to author
Forward
0 new messages