vboxnet0 is not created on startup

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Gary Golden
Posts: 2
Joined: 5. Nov 2011, 17:46
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian

vboxnet0 is not created on startup

Post by Gary Golden »

Hello.

I'm running Debian testing with Virtual box 4.1.4 installed from

Code: Select all

deb http://download.virtualbox.org/virtualbox/debian squeeze contrib
After machine bootup there is no vboxnet0 interface exists as can be seen with "ifconfig -a"
Of course ifup also fails:

Code: Select all

vboxnet0: ERROR while getting interface flags: No such device
Failed to bring up vboxnet0.
Modules are loaded:

Code: Select all

# lsmod | grep vbox
vboxpci                23083  0 
vboxnetadp             13155  0 
vboxnetflt             23287  0 
vboxdrv               213262  3 vboxpci,vboxnetadp,vboxnetflt
However, when I start Virtual Box GUI the interface is being created, but not configured. When I start a host-only guest the interface is being configured.

I would like interface being created at startup, so ifup can configure it, so I can bind daemons to it.
What can I do to debug such situation? dpkg-reconfigure virtual box is no help.
MacBruins
Posts: 1
Joined: 3. Dec 2011, 10:31
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: OpenWrt

Re: vboxnet0 is not created on startup

Post by MacBruins »

Hi Gary,

I just figured out the solution, hopefully not too late for you.

Using VirtualBox 4.1.6 on Fedora 15, vboxnet* are created when I run VBoxManage. So to create vboxnet* at boot time I just added this line to my /etc/rc.d/rc.local

Code: Select all

VBoxManage list vms > /dev/null 2>&1
William
Gary Golden
Posts: 2
Joined: 5. Nov 2011, 17:46
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian

Re: vboxnet0 is not created on startup

Post by Gary Golden »

Thanks for sharing, that's a good catch.

Developing your idea I got an alternative version, which can be useful in some situations:

Code: Select all

VBoxManage hostonlyif create >/dev/null 2>&1
It may be useful if you run VBox as non-root user, hence `list vms` as root doesn't return machines list.
It works faster and accepts additional options:

Code: Select all

VBoxManage hostonlyif       ipconfig <name>
                            [--dhcp |
                            --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |
                            --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]
                            create |
                            remove <name>
Post Reply