Execute virtualbox in LXC ? /dev/vboxnetctl: No such file or directory

1

I have Jenkins installed in a LXC container.

In one Jenkins job, I want to test my project deployment with vagrant + Virtualbox.

So, I try to execute VirtualBox in my LXC container.

First difficulty, load vbox kernel modules. To fix this first issue, I've appended that line in my lxc container configuration :

# vboxdrv
lxc.cgroup.devices.allow = c 10:59 rwm

With this line, I can execute :

root@jenkins-lxc:/tmp/test1# /etc/init.d/vboxdrv setup
[ ok ] Stopping VirtualBox kernel modules:.
[ ok ] Uninstalling old VirtualBox DKMS kernel modules:.
[ ok ] Trying to register the VirtualBox kernel modules using DKMS:.
[ ok ] Starting VirtualBox kernel modules:.

Next issue :

root@jenkins-lxc:/tmp/test1# vboxmanage  hostonlyif create 
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component
HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 68 of file VBoxManageHostonly.cpp

I don't know how to fix this last issue "failed to open /dev/vboxnetctl: No such file or directory".

Have you some tips to fix it ?

virtualbox
jenkins
vagrant
lxc
asked on Server Fault Oct 4, 2013 by Stéphane Klein • edited Oct 4, 2013 by Tablemaker

1 Answer

0

You don't need virtualbox to use vagrant. Instead of running your tests in a VM in virtualbox, run them in another container and use vagrant to manage it with vagrant-lxc.

answered on Server Fault Nov 20, 2013 by sciurus

User contributions licensed under CC BY-SA 3.0