Page 1 of 1

Save Host-only Networks...

Posted: 8. Oct 2010, 01:10
by kitplummer
I'm on a Ubuntu 10.04 host, and I want to setup four host-only networks - which I can (and get them to work). Unfortunately when I restart the machine, or cycle the host's networks I lose all of my created host-only networks. And thus my VMs can't start.

Am I missing some manual config on the host, or something else?

Kit

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 02:30
by Perryg
Does the ~/.VirtualBox/VirtualBox.xml show all 4 of the host adapters and their addresses?

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 16:38
by kitplummer
Yes, the VirtualBox.xml file shows all the networks. But, they don't appear in the UI's preferences, and the machines can't boot unless I add them back in.

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 17:08
by Perryg
Post the xml here.
How did you create the host-only adapters (be specific)
What is the purpose for (4) separate host-only adapters?

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 18:24
by kitplummer

Code: Select all

<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.10-linux">
  <Global>
    <ExtraData>
      <ExtraDataItem name="GUI/LastVMSelected" value="17fdf573-ed76-48fa-9fbc-49dc1c83b519"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="295,169,769,550"/>
      <ExtraDataItem name="GUI/LicenseAgreed" value=",8"/>
      <ExtraDataItem name="GUI/SuppressMessages" value=",remindAboutMouseIntegrationOn,remindAboutAutoCapture,showRuntimeError.warning.Ext4PartitionDetected,remindAboutMouseIntegrationOff"/>
      <ExtraDataItem name="GUI/UpdateCheckCount" value="4"/>
      <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2010-10-09, stable"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPAddress" value="192.168.0.1"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPV6NetMask" value="64"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPAddress" value="192.168.1.1"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPV6NetMask" value="64"/>
      <ExtraDataItem name="HostOnly/vboxnet2/IPAddress" value="192.168.2.1"/>
      <ExtraDataItem name="HostOnly/vboxnet2/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet2/IPV6NetMask" value="64"/>
      <ExtraDataItem name="HostOnly/vboxnet3/IPAddress" value="192.168.3.1"/>
      <ExtraDataItem name="HostOnly/vboxnet3/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet3/IPV6NetMask" value="64"/>
    </ExtraData>
    <MachineRegistry>
      <MachineEntry uuid="{0150e2f9-8509-4053-812e-843ae1cbd0f4}" src="Machines/Ubu10.4/Ubu10.4.xml"/>
      <MachineEntry uuid="{17fdf573-ed76-48fa-9fbc-49dc1c83b519}" src="Machines/UbuTwo/UbuTwo.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{680db3e3-f7ed-49ac-a37f-91b1ec49ec6e}" location="HardDisks/Ubu10.4.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{8833019b-5857-4f41-b46c-c6dcd2cde46f}" location="/home/kplummer/.VirtualBox/Machines/Ubu10.4/Snapshots/{8833019b-5857-4f41-b46c-c6dcd2cde46f}.vdi" format="VDI"/>
        </HardDisk>
        <HardDisk uuid="{d5b88ab8-6496-4363-b823-f33425c98de4}" location="HardDisks/UbuTwo.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{b095d7aa-8420-4ab1-9aec-fa7f7ea7e54c}" location="/home/kplummer/.VirtualBox/Machines/UbuTwo/Snapshots/{b095d7aa-8420-4ab1-9aec-fa7f7ea7e54c}.vdi" format="VDI"/>
        </HardDisk>
      </HardDisks>
      <DVDImages>
        <Image uuid="{89c5693c-fdda-459b-b261-292e47d96fe8}" location="/usr/share/virtualbox/VBoxGuestAdditions.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <NetserviceRegistry>
      <DHCPServers>
        <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.0.100" networkMask="255.255.255.0" lowerIP="192.168.0.101" upperIP="192.168.0.254" enabled="1"/>
      </DHCPServers>
    </NetserviceRegistry>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" LogHistoryCount="3"/>
    <USBDeviceFilters/>
  </Global>
</VirtualBox>
The first host-only adapter was there initially (IIRC). The next three I added using the UI's preference, within the Network view - by clicking the "add" icon. I then changed the IPv4 address for each. That's it.

If I close VirtualBox, and re-launch my configuration is still there. If I reboot the host, the configuration goes away - but still exists in the XML config.

I'm doing some development of a redundancy application - two boxes, and two redundant networks on each side of the boxes (totally four nets). I need this setup to test multicast capabilities without requiring all the hardware necessary for a full physical load-out.

Thanks for the help. FWIW, I've been able to get everything setup and working so it is just a matter of getting the config to stick. :)

Kit

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 19:03
by Perryg
OK I just tested this.
(1) I clicked add three times and left the defaults. (192.168.56.X) This created 192.168.57.X 192.168.58.X and 192.168.59.X
(2) I then went in and set dhcp on and configured each to match the first with the exception of the 56,57,58,59.
(3) Saved and setup several guests to use the vboxnet0, vboxnet1, vboxnet2, & vboxnet3. Tested and all worked.
(4) Shut down all guests, shut down VirtualBox, even reboot the host.
Guess what? Only the default (first one) was left in the preference window.

I will investigate the further and report to bugtracker if it has not already been reported. I will also post the ticket number here when I know it.

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 19:20
by Perryg
Reported. Below is the ticket number
Ticket 7550

Re: Save Host-only Networks...

Posted: 8. Oct 2010, 19:38
by kitplummer
Thanks...glad I'm not imagining things. ;)

Re: Save Host-only Networks...

Posted: 13. Oct 2010, 15:48
by phikapjames
Not imagining at all. I've had this issue for about a year now and finally decided to do something about it. I'm always at the latests versions. It's still happening with Ubuntu 10.10, and up until yesterday, Ubuntu 9.10. I also have the network information in the xml.

Each time after a reboot, when I would go add it through the configuration, it would pick up the old settings once it had been added. I don't need to reconfigure it, just keep adding it back again after each reboot.

Code: Select all

<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.9-linux">
  <Global>
    <ExtraData>
      <ExtraDataItem name="GUI/LastVMSelected" value="c7714d9e-fde1-4f0d-9525-25cead6b3632"/>
      <ExtraDataItem name="GUI/LastWindowPostion" value="565,530,770,518"/>
      <ExtraDataItem name="GUI/LicenseAgreed" value="7,8"/>
      <ExtraDataItem name="GUI/SUNOnlineData" value="007040680069006b00610070006a0061006d4565007300401167006d00610069006c002e0063016f006d23000009d59d3db"/>
      <ExtraDataItem name="GUI/SuppressMessages" value=",confirmInputCapture,remindAboutMouseIntegrationOn,remindAboutAutoCapture,remindAboutMouseIntegrationOff,confirmGoingFullscreen"/>
      <ExtraDataItem name="GUI/UpdateCheckCount" value="143"/>
      <ExtraDataItem name="GUI/UpdateDate" value="1 d, 2010-10-14, stable"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPAddress" value="192.168.66.1"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPAddress" value="192.168.225.2"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet1/IPV6NetMask" value="64"/>
    </ExtraData>
    <MachineRegistry>
      <MachineEntry uuid="{c7714d9e-fde1-4f0d-9525-25cead6b3632}" src="Machines/M0n0wall/M0n0wall.xml"/>
      <MachineEntry uuid="{3bbf33fe-fe6d-45de-8967-98456041d2e7}" src="Machines/CentOS Test/CentOS Test.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{fb6c9516-160b-4483-96ab-4a4d78c362d6}" location="HardDisks/CentOS Test.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{56d5df9f-a4cc-4c1f-8a86-71840b4b5244}" location="HardDisks/m0n0wall.vmdk" format="VMDK" type="Normal"/>
      </HardDisks>
      <DVDImages>
        <Image uuid="{ed94c86f-7223-4fa8-bd98-c14261e4d994}" location="/usr/share/virtualbox/VBoxGuestAdditions.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <NetserviceRegistry>
      <DHCPServers>
        <DHCPServer networkName="HostInterfaceNetworking-vboxnet0" IPAddress="192.168.66.100" networkMask="255.255.255.0" lowerIP="192.168.66.101" upperIP="192.168.66.254" enabled="1"/>
        <DHCPServer networkName="HostInterfaceNetworking-vboxnet1" IPAddress="0.0.0.0" networkMask="0.0.0.0" lowerIP="0.0.0.0" upperIP="0.0.0.0" enabled="0"/>
      </DHCPServers>
    </NetserviceRegistry>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" LogHistoryCount="3"/>
    <USBDeviceFilters/>
  </Global>
</VirtualBox>

Re: Save Host-only Networks...

Posted: 13. Dec 2010, 06:53
by abw
I search why sudo invoke-rc.d vboxdrv start just create vboxnet0
I found answer in /usr/share/virtualbox/src/vboxhost/vboxnetadp/VBoxNetAdp.c line 1131 and next
i change

Code: Select all

int  vboxNetAdpInit(void)
{
    unsigned i;
    PVBOXNETADP pVboxnet0;
    /*
     * Init common members and call OS-specific init.
     */
    for (i = 0; i < RT_ELEMENTS(g_aAdapters); i++)
    {
        g_aAdapters[i].enmState = kVBoxNetAdpState_Invalid;
        g_aAdapters[i].uUnit    = i;
        vboxNetAdpOsInit(&g_aAdapters[i]);
    }

    /* Create vboxnet0 */
    return vboxNetAdpCreate(&pVboxnet0);
}
with

Code: Select all

int  vboxNetAdpInit(void)
{
    unsigned i;
    PVBOXNETADP pVboxnet0;
    PVBOXNETADP pVboxnet1;
    PVBOXNETADP pVboxnet2;
    PVBOXNETADP pVboxnet3;
    PVBOXNETADP pVboxnet4;
    PVBOXNETADP pVboxnet5;
    PVBOXNETADP pVboxnet6;
    PVBOXNETADP pVboxnet7;
    /*
     * Init common members and call OS-specific init.
     */
    for (i = 0; i < RT_ELEMENTS(g_aAdapters); i++)
    {
        g_aAdapters[i].enmState = kVBoxNetAdpState_Invalid;
        g_aAdapters[i].uUnit    = i;
        vboxNetAdpOsInit(&g_aAdapters[i]);
    }

    /* Create vboxnet0 */
    vboxNetAdpCreate(&pVboxnet0);
    /* Create vboxnet1 */
    vboxNetAdpCreate(&pVboxnet1);
    /* Create vboxnet2 */
    vboxNetAdpCreate(&pVboxnet2);
    /* Create vboxnet3 */
    vboxNetAdpCreate(&pVboxnet3);
    /* Create vboxnet4 */
    vboxNetAdpCreate(&pVboxnet4);
    /* Create vboxnet5 */
    vboxNetAdpCreate(&pVboxnet5);
    /* Create vboxnet6 */
    vboxNetAdpCreate(&pVboxnet6);
    /* Create vboxnet7*/
    return vboxNetAdpCreate(&pVboxnet);
}
and run sudo /etc/init.d/vboxdrv setup and sudo invoke-rc.d vboxdrv start
and now VBoxManage list hostonlyifs show 8 vboxnet, good