{"id":13401437,"url":"https://github.com/fgrehm/vagrant-lxc","last_synced_at":"2025-03-14T07:31:41.303Z","repository":{"id":7115014,"uuid":"8408825","full_name":"fgrehm/vagrant-lxc","owner":"fgrehm","description":"LXC provider for Vagrant","archived":true,"fork":false,"pushed_at":"2022-11-24T23:41:12.000Z","size":1227,"stargazers_count":1205,"open_issues_count":1,"forks_count":181,"subscribers_count":56,"default_branch":"master","last_synced_at":"2024-09-19T05:19:09.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fgrehm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-25T12:37:14.000Z","updated_at":"2024-07-16T19:44:00.000Z","dependencies_parsed_at":"2023-01-13T14:16:33.532Z","dependency_job_id":null,"html_url":"https://github.com/fgrehm/vagrant-lxc","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrehm%2Fvagrant-lxc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrehm%2Fvagrant-lxc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrehm%2Fvagrant-lxc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrehm%2Fvagrant-lxc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fgrehm","download_url":"https://codeload.github.com/fgrehm/vagrant-lxc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243541997,"owners_count":20307803,"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","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":[],"created_at":"2024-07-30T19:01:02.638Z","updated_at":"2025-03-14T07:31:41.297Z","avatar_url":"https://github.com/fgrehm.png","language":"Ruby","funding_links":[],"categories":["Related projects","Ruby","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# :warning: PROJECT UNMAINTAINED :warning:\n\nThis project has been archived. Thanks a lot to everyone that contributed itwith over the years :heart:\n\nIf anyone else wants to resurrect it please reach out by emails!\n\n# vagrant-lxc\n\n[![Build Status](https://travis-ci.org/fgrehm/vagrant-lxc.png?branch=master)](https://travis-ci.org/fgrehm/vagrant-lxc) [![Gem Version](https://badge.fury.io/rb/vagrant-lxc.png)](http://badge.fury.io/rb/vagrant-lxc) [![Code Climate](https://codeclimate.com/github/fgrehm/vagrant-lxc.png)](https://codeclimate.com/github/fgrehm/vagrant-lxc) [![Coverage Status](https://coveralls.io/repos/fgrehm/vagrant-lxc/badge.png?branch=master)](https://coveralls.io/r/fgrehm/vagrant-lxc) [![Gitter chat](https://badges.gitter.im/fgrehm/vagrant-lxc.png)](https://gitter.im/fgrehm/vagrant-lxc)\n\n[LXC](http://lxc.sourceforge.net/) provider for [Vagrant](http://www.vagrantup.com/) 1.9+\n\nThis is a Vagrant plugin that allows it to control and provision Linux Containers\nas an alternative to the built in VirtualBox provider for Linux hosts. Check out\n[this blog post](http://fabiorehm.com/blog/2013/04/28/lxc-provider-for-vagrant/)\nto see it in action.\n\n## Features\n\n* Provides the same workflow as the Vagrant VirtualBox provider\n* Port forwarding via [`redir`](https://github.com/troglobit/redir)\n* Private networking via [`pipework`](https://github.com/jpetazzo/pipework)\n\n## Requirements\n\n* [Vagrant 1.9+](http://www.vagrantup.com/downloads.html)\n* lxc \u003e=2.1\n* `redir` (if you are planning to use port forwarding)\n* `brctl` (if you are planning to use private networks, on Ubuntu this means `apt-get install bridge-utils`)\n\nThe plugin is known to work better and pretty much out of the box on Ubuntu 14.04+\nhosts and installing the dependencies on it basically means a\n`apt-get install lxc lxc-templates cgroup-lite redir`. For setting up other\ntypes of hosts please have a look at the [Wiki](https://github.com/fgrehm/vagrant-lxc/wiki).\n\nIf you are on a Mac or Windows machine, you might want to have a look at [this](http://the.taoofmac.com/space/HOWTO/Vagrant)\nblog post for some ideas on how to set things up or check out [this other repo](https://github.com/fgrehm/vagrant-lxc-vbox-hosts)\nfor a set of Vagrant VirtualBox machines ready for vagrant-lxc usage.\n\n\n## Installation\n\n```\nvagrant plugin install vagrant-lxc\n```\n\n\n## Quick start\n\n```\nvagrant init fgrehm/precise64-lxc\nvagrant up --provider=lxc\n```\n\n_More information about skipping the `--provider` argument can be found at the\n\"DEFAULT PROVIDER\" section of [Vagrant docs](https://docs.vagrantup.com/v2/providers/basic_usage.html)_\n\n## Base boxes\n\nBase boxes provided on Atlas haven't been refreshed for a good while and shouldn't be relied on.\nYour best best is to build your boxes yourself. Some scripts to build your own are available at\n[hsoft/vagrant-lxc-base-boxes](https://github.com/hsoft/vagrant-lxc-base-boxes).\n\nIf you want to build your own boxes, please have a look at [`BOXES.md`](https://github.com/fgrehm/vagrant-lxc/tree/master/BOXES.md)\nfor more information.\n\n## Advanced configuration\n\nYou can modify container configurations from within your Vagrantfile using the\n[provider block](http://docs.vagrantup.com/v2/providers/configuration.html):\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"fgrehm/trusty64-lxc\"\n  config.vm.provider :lxc do |lxc|\n    # Same effect as 'customize [\"modifyvm\", :id, \"--memory\", \"1024\"]' for VirtualBox\n    lxc.customize 'cgroup.memory.limit_in_bytes', '1024M'\n  end\nend\n```\n\nvagrant-lxc will then write out `lxc.cgroup.memory.limit_in_bytes='1024M'` to the\ncontainer config file (usually kept under `/var/lib/lxc/\u003ccontainer\u003e/config`)\nprior to starting it.\n\nFor other configuration options, please check the [lxc.conf manpages](http://manpages.ubuntu.com/manpages/precise/man5/lxc.conf.5.html).\n\n### Private Networks\n\nStarting with vagrant-lxc 1.1.0, there is some rudimentary support for configuring\n[Private Networks](https://docs.vagrantup.com/v2/networking/private_network.html)\nby leveraging the [pipework](https://github.com/jpetazzo/pipework) project.\n\nOn its current state, there is a requirement for setting the bridge name that\nwill be created and will allow your machine to comunicate with the container\n\nFor example:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.network \"private_network\", ip: \"192.168.2.100\", lxc__bridge_name: 'vlxcbr1'\nend\n```\n\nWill create a new `veth` device for the container and will set up (or reuse)\na `vlxcbr1` bridge between your machine and the `veth` device. Once the last\nvagrant-lxc container attached to the bridge gets `vagrant halt`ed, the plugin\nwill delete the bridge.\n\n### Container naming\n\nBy default vagrant-lxc will attempt to generate a unique container name\nfor you. However, if the container name is important to you, you may use the\n`container_name` attribute to set it explicitly from the `provider` block:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.define \"db\" do |node|\n    node.vm.provider :lxc do |lxc|\n      lxc.container_name = :machine # Sets the container name to 'db'\n      lxc.container_name = 'mysql'  # Sets the container name to 'mysql'\n    end\n  end\nend\n```\n\n_Please note that there is a 64 chars limit and the container name will be\ntrimmed down to that to ensure we can always bring the container up.\n\n### Backingstore options\n\nSupport for setting `lxc-create`'s backingstore option (`-B` and related) can be\nspecified from the provider block and it defaults to `best`, to change it:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.provider :lxc do |lxc|\n    lxc.backingstore = 'lvm' # or 'btrfs', 'overlayfs', ...\n    # lvm specific options\n    lxc.backingstore_option '--vgname', 'schroots'\n    lxc.backingstore_option '--fssize', '5G'\n    lxc.backingstore_option '--fstype', 'xfs'\n  end\nend\n```\n\n## Unprivileged containers support\n\nSince v1.4.0, `vagrant-lxc` gained support for unprivileged containers. For now, since it's a new\nfeature, privileged containers are still the default, but you can have your `Vagrantfile` use\nunprivileged containers with the `privileged` flag (which defaults to `true`). Example:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.provider :lxc do |lxc|\n    lxc.privileged = false\n  end\nend\n```\n\nFor unprivileged containers to work with `vagrant-lxc`, you need a properly configured system. On\nsome distros, it can be somewhat of a challenge. Your journey to configuring your system can start\nwith [Stéphane Graber's blog post about it](https://stgraber.org/2014/01/17/lxc-1-0-unprivileged-containers/).\n\n## Avoiding `sudo` passwords\n\nIf you're not using unprivileged containers, this plugin requires **a lot** of `sudo`ing To work\naround that, you can use the `vagrant lxc sudoers` command which will create a file under\n`/etc/sudoers.d/vagrant-lxc` whitelisting all commands required by `vagrant-lxc` to run.\n\nIf you are interested on what will be generated by that command, please check\n[this code](lib/vagrant-lxc/command/sudoers.rb).\n\n\n## More information\n\nPlease refer the [wiki](https://github.com/fgrehm/vagrant-lxc/wiki).\n\n\n## Problems / ideas?\n\nPlease review the [Troubleshooting](https://github.com/fgrehm/vagrant-lxc/wiki/Troubleshooting)\nwiki page + [known bugs](https://github.com/fgrehm/vagrant-lxc/issues?labels=bug\u0026page=1\u0026state=open)\nlist if you have a problem and feel free to use the [issue tracker](https://github.com/fgrehm/vagrant-lxc/issues)\npropose new functionality and / or report bugs.\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgrehm%2Fvagrant-lxc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgrehm%2Fvagrant-lxc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgrehm%2Fvagrant-lxc/lists"}