Page 1 of 1

Where is next hostonlyif number kept?

Posted: 1. Apr 2011, 19:54
by swork
Hi all,

I've noticed that if I create a hostonly interface, it gets numbered one higher than the last hostonly interface I created - even if that last interface has been removed in the mean time, and even if that last one was never referenced. I can't find any way to reset this "next number" counter, which I'd like to do if only for the sake of tidiness of my machine configurations.

It seems like this number must live in a configuration file somewhere, but I can't find it. Ideally there's some UI element somewhere that resets it, but failing that I'd edit a config file to reset it.

Can anybody point me to the UI, or to the file to hack? I'm running the binary distribution of OSE on Mac OSX 10.6.6.

Thanks!

Re: Where is next hostonlyif number kept?

Posted: 2. Apr 2011, 23:20
by Sasquatch
Check your VirtualBox.xml file and look for entries like this:

Code: Select all

      <ExtraDataItem name="HostOnly/vboxnet0/IPAddress" value="172.20.0.1"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPNetMask" value="255.255.255.0"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPV6Address" value="fe80::223:18ff:fe5f:2148"/>
      <ExtraDataItem name="HostOnly/vboxnet0/IPV6NetMask" value="64"/>
You may have several items there that show your 'hidden' interfaces.

Re: Where is next hostonlyif number kept?

Posted: 11. Apr 2011, 22:26
by swork
That's not it - the available hostonly interface list is configured in Preferences, not in individual VM settings. You can add one and see it called "hostonly1", delete it, then add another and see it called "hostonly2". Neither is part of any VM, and deleting all VM configurations doesn't affect this.

How does VB know to call the next one "hostonly2" and so on?

Thanks,

Steve

Re: Where is next hostonlyif number kept?

Posted: 11. Apr 2011, 22:41
by Sasquatch
Did you read what I said? I clearly say it's in the VIRTUALBOX.XML file, not in a machine.xml.

Re: Where is next hostonlyif number kept?

Posted: 12. Apr 2011, 02:08
by swork
Yup, and hey, keep it friendly please. The auto-incrementing value isn't kept in either place - it's apparently in one of the kexts, because it resets on boot. Try this with an empty VirtualBox installation (no VMs registered):

1. In Preferences | Network, create and delete a hostonly interface.

2. Do it again, and see the next higher number.

3. Quit VirtualBox, restart it, and do it again: see the next higher number (now 3 if you started from scratch).

4. Quit VirtualBox, wipe out ~/Library/VirtualBox/VirtualBox.xml entirely, and repeat - and see the next higher interface number (now 4).

5. Reboot the box, do it again, and you get number 1.

Re: Where is next hostonlyif number kept?

Posted: 14. Apr 2011, 20:10
by Sasquatch
I would rather say it's stored in memory, instead. Restarting VB doesn't change a thing, but a reboot or log out and in does. Did you wait long enough for the VBoxSVC process to stop when restarting VB?