Creating VMs from VBoxManage fails to create bridged ifs

This is for discussing general topics about how to use VirtualBox.
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

Greetings again. On a Ubuntu system, creating new VMs with bridged adapters doesn't work.
VBoxManage createvm --name foo1 --register
VBoxManage modifyvm foo1 --ostype Debian --memory 512
VBoxManage modifyvm foo1 --nic1 hostonly --nictype1 82540EM --hostonlyadapter1 'vboxnet0'
VBoxManage modifyvm foo1 --nic2 bridged --nictype2 82540EM --bridgeadapter1 'eth0' 
VBoxManage startvm foo1
Results in:
Waiting for VM "foo1" to power on...
VBoxManage: error: Failed to open/create the internal network 'HostInterfaceNetworking-' (VERR_INVALID_PARAMETER).
VBoxManage: error: Failed to attach the network LUN (VERR_INVALID_PARAMETER)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Console, interface IConsole, callee
When I look at the VM in the GUI, I see that the second adapter is not marked as being for eth0. However, if I click on the Settings button, then OK in the dialog without touching any of the settings, I can see that the second adapter is marked as eth0 and the VM starts up just fine, both from the GUI and from the command line.

Has anyone else hit this bug? If so, is there a way around it?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

What version of VirtualBox are you using?
And is it the install from VirtualBox.org or the Ubuntu repo?
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

4.1.8, from virtualbox.org
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

Hummm,

I don't see this issue on my main system, but... It is a build in the future.
If you run the commands and not open the VMM can you open the guests control file and are the entries there or missing, and is the syntax right?
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

Perryg wrote:Hummm,

I don't see this issue on my main system, but... It is a build in the future.
If you run the commands and not open the VMM can you open the guests control file and are the entries there or missing, and is the syntax right?

Entry is missing, but syntax is right.

Before the Settings dialog box:
<Adapter slot="1" enabled="true" MACAddress="080027266D29" cable="true" speed="0" type="82540EM">
          <DisabledModes>
            <NAT>
              <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
              <Alias logging="false" proxy-only="false" use-same-ports="false"/>
            </NAT>
          </DisabledModes>
          <BridgedInterface name=""/>
        </Adapter>
After:
<Adapter slot="1" enabled="true" MACAddress="080027266D29" cable="true" speed="0" type="82540EM">
          <DisabledModes>
            <NAT>
              <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
              <Alias logging="false" proxy-only="false" use-same-ports="false"/>
            </NAT>
          </DisabledModes>
          <BridgedInterface name="eth0"/>
        </Adapter>
The name is not getting populated by VBoxManage (even though it is clearly there), but magically filled in by the Settings dialog.

Clues for a work-around?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

I need to look into this more tomorrow. Too many things going on and my eyes are tired.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by mpack »

Some delay required between modifying the settings and starting the VM? I.e. perhaps the changes are not flushed yet.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

I ran your commands as you show with the machine = afoo1. Without opening the VMM this is the result.

Code: Select all

<Network>
        <Adapter slot="0" enabled="true" MACAddress="080027F4E1EA" cable="true" speed="0" type="82540EM">
          <DisabledModes>
            <NAT>
              <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
              <Alias logging="false" proxy-only="false" use-same-ports="false"/>
            </NAT>
            <BridgedInterface name="eth0"/>
            <HostOnlyInterface name="vboxnet0"/>
          </DisabledModes>
          <HostOnlyInterface name="vboxnet0"/>
        </Adapter>
        <Adapter slot="1" enabled="true" MACAddress="080027903DD5" cable="true" speed="0" type="82540EM">
          <DisabledModes>
Now it is possible that your version may have a bug in it as the version I am using is in the future. Only way to know is for someone with your version to test this as well.
I would but I am in the middle of a project and really can't downgrade at the moment.
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

mpack wrote:Some delay required between modifying the settings and starting the VM? I.e. perhaps the changes are not flushed yet.
Unlikely. I just ran the steps again with a "sleep 2" between each step, and got the same result.
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

Perryg wrote:I ran your commands as you show with the machine = afoo1. Without opening the VMM this is the result.

Code: Select all

<Network>
        <Adapter slot="0" enabled="true" MACAddress="080027F4E1EA" cable="true" speed="0" type="82540EM">
          <DisabledModes>
            <NAT>
              <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
              <Alias logging="false" proxy-only="false" use-same-ports="false"/>
            </NAT>
            <BridgedInterface name="eth0"/>
            <HostOnlyInterface name="vboxnet0"/>
          </DisabledModes>
          <HostOnlyInterface name="vboxnet0"/>
        </Adapter>
        <Adapter slot="1" enabled="true" MACAddress="080027903DD5" cable="true" speed="0" type="82540EM">
          <DisabledModes>
You cut off those results too early: what came ouf for the settings in adapter slot 1, which is the one that is failing?
Perryg wrote:Now it is possible that your version may have a bug in it as the version I am using is in the future. Only way to know is for someone with your version to test this as well.
I would but I am in the middle of a project and really can't downgrade at the moment.
I'd be happy if someone running the current version on a Ubuntu system would check it out. Alternately, if you tell me how to get a version for Unbuntu 11.10 for your "future version", I can try it out.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

Yes you are right. I was looking at the wrong slot, and assuming nic1=slot1 instead of nic1=slot0, my mistake.

This is defiantly a bug in the code logic as I see it and should be reported. It's interesting that the GUI automatically fixes this though, which does nothing for the ones without X.

What threw me off was it put both in slot0 and then adds nic2 to slot1 when you open the netconfig in the gui and click OK, but does not remove it from slot0.

Do you want to report this or should I?
paulehoffman
Posts: 23
Joined: 20. Oct 2010, 18:15
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: many

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by paulehoffman »

Perryg wrote:Yes you are right. I was looking at the wrong slot, and assuming nic1=slot1 instead of nic1=slot0, my mistake.

This is defiantly a bug in the code logic as I see it and should be reported. It's interesting that the GUI automatically fixes this though, which does nothing for the ones without X.

What threw me off was it put both in slot0 and then adds nic2 to slot1 when you open the netconfig in the gui and click OK, but does not remove it from slot0.

Do you want to report this or should I?
If you would, that would be great. I've never done an actual bug report for VirtualBox, and the learning curve for doing so is probably a waste of time, given that I will probably never find a bug again...

In the meantime, for the project I'm on, there is a simple solution: after creating the VMM, run a script that changes the one field to fill in eth0. Thanks for getting me to look in the file.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

klaus
Oracle Corporation
Posts: 1115
Joined: 10. May 2007, 14:57

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by klaus »

I really hope that this isn't all just due to a typo in the original post - the 4th line uses
--bridgedadapter1
where it should have
--bridgedadapter2
.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Creating VMs from VBoxManage fails to create bridged ifs

Post by Perryg »

Yes you are right of course, and I missed it not once but three times.
Post Reply