Docker의 Jenkins가 VirtualBox의 /dev/vboxnetctl에 액세스할 수 없습니다.

Docker의 Jenkins가 VirtualBox의 /dev/vboxnetctl에 액세스할 수 없습니다.

사용자 "jenkins"(Docker에서 실행, 공식 이미지)로 실행되는 Jenkins를 설정하려고 합니다. Jenkins는 docker-machine과 virtualbox를 사용하여 가상 머신을 시작해야 합니다.

마운트된 /dev/vboxnetctl을 젠킨스 컨테이너에 바인딩합니다. 또한 sudo를 사용하여 루트로 docker-machine을 실행해 보았습니다.

그러나 사용자 jenkins에게는 /dev/vboxnetctl에 액세스할 수 있는 권한이 없습니다.

$ docker-compose exec jenkinsmaster sudo docker-machine create test
Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
Running pre-create checks...
(test) Image cache directory does not exist, creating it at /root/.docker/machine/cache...
(test) No default Boot2Docker ISO found locally, downloading the latest release...
(test) Latest release for github.com/boot2docker/boot2docker is v17.09.0-ce
(test) Downloading /root/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.09.0-ce/boot2docker.iso...
(test) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(test) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/test/boot2docker.iso...
(test) Creating VirtualBox VM...
(test) Creating SSH key...
(test) Starting the VM...
(test) Check network to re-create if needed...
(test) Creating a new host-only adapter produced an error: /usr/bin/VBoxManage hostonlyif create failed:
(test) 0%...
(test) Progress state: NS_ERROR_FAILURE
(test) VBoxManage: error: Failed to create the host-only adapter
(test) VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: Operation not permitted
(test) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
(test) VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 71 of file VBoxManageHostonly.cpp
(test) 
(test) This is a known VirtualBox bug. Let's try to recover anyway...
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue

어떻게 작동하게 만들까요?

관련 정보