How to start a virtual virtual machine using Vagrant inside Travis-CI ?
I know that starting a VM inside a virtual machine is sometimes not supported, but it has reported successes with this particular configuration.
I am trying to configure a continuous integration server to run unittests for my sysadmin tool to test it on different operating systems and Python versions. It uses Tox to handle the initialization of various Python and Pytest virtual environments, to run tests and wrap Vagrant to set and cancel the virtual machine. It works fine on my local Ubuntu 14 host, but in Travis, Vagrant tries to load the VM virtual machine for a while:
==> default: Importing base box 'ubuntu/trusty64'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'ubuntu/trusty64' is up to date... ==> default: Setting the name of the VM: functional_tests_default_1463515960654_71459 ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 => 2222 (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... ... The job exceeded the maximum time limit for jobs, and has been terminated.
Since this does not give me any details, I am not sure how to diagnose the problem. I tried to include more output using export VAGRANT_LOG=DEBUG; but it didnβt show anything useful and exceeded the maximum size of Travis magazine. I also tried to increase the timeout and memory allocation by 1 GB, but it did not help.
The only thing I noticed that I could not explain is the message from sudo apt-get -y install -q virtualbox-ose-dkms virtualbox --fix-missing :
Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.
However, immediately before this, the command to install the kernel source is deleted:
sudo apt-get -y --force-yes install linux-headers-`uname -r`
How to run a Vagrant / Virtualbox virtual machine inside Travis-CI?
virtual-machine vagrant virtualbox travis-ci
Cerin
source share