{"id":16179237,"url":"https://github.com/jonashackt/vagrant-travisci","last_synced_at":"2025-08-15T23:13:12.578Z","repository":{"id":147270360,"uuid":"242748799","full_name":"jonashackt/vagrant-travisci","owner":"jonashackt","description":"Example project showing how to run Vagrant on TravisCI using VirtualBox","archived":false,"fork":false,"pushed_at":"2020-02-24T16:35:03.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T11:47:14.216Z","etag":null,"topics":["travis","travis-ci","vagrant","virtualbox"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonashackt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-24T13:52:21.000Z","updated_at":"2020-05-12T04:29:51.000Z","dependencies_parsed_at":"2023-06-30T01:15:45.716Z","dependency_job_id":null,"html_url":"https://github.com/jonashackt/vagrant-travisci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonashackt/vagrant-travisci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fvagrant-travisci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fvagrant-travisci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fvagrant-travisci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fvagrant-travisci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonashackt","download_url":"https://codeload.github.com/jonashackt/vagrant-travisci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonashackt%2Fvagrant-travisci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644756,"owners_count":24621332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["travis","travis-ci","vagrant","virtualbox"],"created_at":"2024-10-10T05:26:12.688Z","updated_at":"2025-08-15T23:13:12.530Z","avatar_url":"https://github.com/jonashackt.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# vagrant-travisci\n\n[![Build Status](https://travis-ci.org/jonashackt/vagrant-travisci.svg?branch=master)](https://travis-ci.org/jonashackt/vagrant-travisci)\n\nExample project showing how to run Vagrant on TravisCI using VirtualBox\n\n\u003e See a working example here: https://github.com/jonashackt/vagrant-travisci-libvrt (I didn't get this setup with VirtualBox here to work, BUT the libvirt + KVM variant works like a charm!)\n\n## Why Vagrant on a CI system?\n\nI´d really want to test bigger Infrastructure-as-Code projects like https://github.com/jonashackt/kubernetes-the-ansible-way and therefore need Vagrant running on a CI system (I don´t want to setup or host the CI system myself).\n\nAnd no, Docker-in-Docker won´t suffice here!\n\nWell until today, I really thought that __there is no way to do it with TravisCI__ - just have a look into https://github.com/jonashackt/vagrant-ansible-on-appveyor ([and this so thread](https://stackoverflow.com/questions/31828555/using-vagrant-on-cloud-ci-services)).\n\nBut then I came upon these GitHub issues in my beloved Molecule project: https://github.com/ansible-community/molecule-vagrant/issues/2#issuecomment-585616279 \u0026 especially https://github.com/ansible-community/molecule-vagrant/issues/8#issuecomment-589902704, which confused me right away because it says:\n\n\u003e I give a try and so SUDDENLY found that Travis CI now coming with vmx from /prof/cpuinfo therefore both libvirt + KVM or VirtualBox now works...\n\nThat would be awesome, since it would enable the following workflow (which would be even simpler then his libvirt + KVM alternative, which I also needed to check out (it's working!): https://github.com/jonashackt/vagrant-travisci-libvrt)\n\n![cloud-uml](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/jonashackt/vagrant-travisci/master/cloud.iuml)\n![local-uml](http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/jonashackt/vagrant-travisci/master/local.iuml)\n\n## Using VirtualBox to run Vagrant on TravisCI\n\nFirst we need to configure the usual Travis [.travis.yml](.travis.yml) for our project:\n\n```yaml\ndist: bionic\nlanguage: python\n\ninstall:\n# Install VirtualBox\n- sudo wget https://download.virtualbox.org/virtualbox/6.1.4/virtualbox-6.1_6.1.4-136177~Ubuntu~bionic_amd64.deb\n- sudo dpkg -i virtualbox-6.1_6.1.4-136177~Ubuntu~bionic_amd64.deb\n\n# How did the VirtualBox installation go?\n- VBoxManage --version\n\n# Download Vagrant \u0026 Install Vagrant package\n- sudo wget -nv https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.deb\n- sudo dpkg -i vagrant_2.2.7_x86_64.deb\n\n# Vagrant correctly installed?\n- vagrant --version\n```\n\n## prevent errors like The home directory you specified is not accessible\n\nYou may experience some strange errors like `The home directory you specified is not accessible`:\n\n```\n$ vagrant up --provider=libvirt\n\nVagrant failed to initialize at a very early stage:\n\nThe home directory you specified is not accessible. The home\n\ndirectory that Vagrant uses must be both readable and writable.\n\nYou specified: /home/travis/.vagrant.d\n\nThe command \"vagrant up --provider=libvirt\" exited with 1.\n```\n\nor `Permission denied @ rb_sysopen - /home/travis/.vagrant.d/data/machine-index/index.lock (Errno::EACCES)`:\n\n```\n$ vagrant up --provider=libvirt\n\n/opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/machine_index.rb:321:in `initialize': Permission denied @ rb_sysopen - /home/travis/.vagrant.d/data/machine-index/index.lock (Errno::EACCES)\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/machine_index.rb:321:in `open'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/machine_index.rb:321:in `with_index_lock'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/machine_index.rb:52:in `initialize'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:723:in `new'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:723:in `machine_index'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:206:in `block in action_runner'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/action/runner.rb:34:in `run'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:525:in `hook'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/lib/vagrant/environment.rb:774:in `unload'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/bin/vagrant:185:in `ensure in \u003cmain\u003e'\n\n\tfrom /opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/bin/vagrant:185:in `\u003cmain\u003e'\n\nThe command \"vagrant up --provider=libvirt\" exited with 1.\n```\n\nThe simplest solution here is to always use `sudo` prefixing our `vagrant` commands (although [this stackoverflow answer](https://stackoverflow.com/a/29438084/4964553) tells us not to do so).\n\n## Finally testdrive the Vagrant installation\n\nNow we should be able to add a `vagrant up` to the `script` section to our [.travis.yml](.travis.yml):\n\n```yaml\nscript:\n- sudo vagrant up\n- sudo vagrant ssh -c \"echo 'hello world!'\"\n```\n\n## polishing: cache vagrant boxes\n\nTo speed up our future builds, we should try to cache the big Vagrant boxes throughout our builds. [The Travis docs state](https://docs.travis-ci.com/user/caching/#arbitrary-directories), that we only need to add the following to our [.travis.yml](.travis.yml):\n\n```yaml\ncache:\n  directories:\n  - /home/travis/.vagrant.d/boxes\n```\n\nDon't simple use `.vagrant.d/boxes` here, since Vagrant will place it's boxes inside `/home/travis/.vagrant.d/boxes` - and not inside `$TRAVIS_BUILD_DIR/.vagrant.d/boxes` which expands to `/home/travis/build/jonashackt/vagrant-travisci/.vagrant.d/boxes`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fvagrant-travisci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonashackt%2Fvagrant-travisci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonashackt%2Fvagrant-travisci/lists"}