在一个Jenkins工作中,我想用vagrant + Virtualboxtesting我的项目部署。
所以,我尝试在我的LXC容器中执行VirtualBox。
第一个难点,加载vbox内核模块。 要解决这个第一个问题,我已经在我的lxc容器configuration中添加了这行:
# vboxdrv lxc.cgroup.devices.allow = c 10:59 rwm
用这一行,我可以执行:
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:.
下一期:
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
我不知道如何解决这最后一个问题“无法打开/ dev / vboxnetctl:没有这样的文件或目录”。
你有一些技巧来解决它?
你不需要virtualbox来使用stream浪汉。 不要在虚拟机中的虚拟机上运行testing,而是在另一个容器中运行它们,并使用vagrant-lxc来pipe理它。