<commit_before>.. _installation:

============
Installation
============

Runtime Dependencies
====================

Vagga is compiled as static binary, so it doesn't have many runtime
dependencies. It does require user namespaces to be properly set up, which
allows Vagga to create and administer containers without having root privlege.
This is increasingly available in modern distributions but may need to be
enabled manually.

* the ``newuidmap``, ``newgidmap`` binaries are required (either from
  ``shadow`` or ``uidmap`` package)

* known exception for Archlinux: ensure ``CONFIG_USER_NS=y`` enabled in kernel. Default kernel doesn't contain it, you can check it with::

    $ zgrep CONFIG_USER_NS /proc/config.gz

  See :ref:`archlinux`

* known exception for Debian and Fedora: some distributions disable
  unprivileged user namespaces by default. You can check with::

    $ sysctl kernel.unprivileged_userns_clone
    kernel.unprivileged_userns_clone = 1

  and to enable::

    $ sudo sysctl -w kernel.unprivileged_userns_clone=1
    kernel.unprivileged_userns_clone = 1
    # make available on reboot
    $ echo kernel.unprivileged_userns_clone=1 | \
        sudo tee /etc/sysctl.d/50-unprivleged-userns-clone.conf
    kernel.unprivileged_userns_clone=1

* ``/etc/subuid`` and ``/etc/subgid`` should be set up. Usually you need at
  least 65536 subusers. This will be setup automatically by ``useradd`` in new
  distributions.  See ``man /etc/subuid`` if not. To check::

    $ grep -w $(whoami) /etc/sub[ug]id
    /etc/subgid:<you>:689824:65536
    /etc/subuid:<you>:689824:65536

The only other optional dependency is ``iptables`` in case you will be doing
:doc:`network tolerance testing</network>`.

See instructions specific for your distribution below.

Building From Source
====================

.. note:: The recommended way to building vagga is to install the tool from
   packages (see :ref:`Ubuntu` below and then build vagga using vagga itself,
   the text below describes old-style build process)


Build-time dependencies:

* Rust_ compiler 1.0.0-alpha (``rustc``)
* ``make`` (probably gnu variant)
* ``git`` (when installing from git source)

Run-time dependencies (basically none):

* ``glibc`` (probably you have it)
* ``newuidmap/newgidmap`` binaries (in ubuntu is separate ``uidmap`` package,
  but it's a part of ``shadow`` which is installed everywhere)

Process is as simple as following::

    git submodule update --init
    make
    sudo make install PREFIX=/usr


.. _Rust: http://rust.org
.. _linux: http://kernel.org

.. _ubuntu:
<commit_msg>Fix link to rust's home page<commit_after>.. _installation:

============
Installation
============

Runtime Dependencies
====================

Vagga is compiled as static binary, so it doesn't have many runtime
dependencies. It does require user namespaces to be properly set up, which
allows Vagga to create and administer containers without having root privlege.
This is increasingly available in modern distributions but may need to be
enabled manually.

* the ``newuidmap``, ``newgidmap`` binaries are required (either from
  ``shadow`` or ``uidmap`` package)

* known exception for Archlinux: ensure ``CONFIG_USER_NS=y`` enabled in kernel. Default kernel doesn't contain it, you can check it with::

    $ zgrep CONFIG_USER_NS /proc/config.gz

  See :ref:`archlinux`

* known exception for Debian and Fedora: some distributions disable
  unprivileged user namespaces by default. You can check with::

    $ sysctl kernel.unprivileged_userns_clone
    kernel.unprivileged_userns_clone = 1

  and to enable::

    $ sudo sysctl -w kernel.unprivileged_userns_clone=1
    kernel.unprivileged_userns_clone = 1
    # make available on reboot
    $ echo kernel.unprivileged_userns_clone=1 | \
        sudo tee /etc/sysctl.d/50-unprivleged-userns-clone.conf
    kernel.unprivileged_userns_clone=1

* ``/etc/subuid`` and ``/etc/subgid`` should be set up. Usually you need at
  least 65536 subusers. This will be setup automatically by ``useradd`` in new
  distributions.  See ``man /etc/subuid`` if not. To check::

    $ grep -w $(whoami) /etc/sub[ug]id
    /etc/subgid:<you>:689824:65536
    /etc/subuid:<you>:689824:65536

The only other optional dependency is ``iptables`` in case you will be doing
:doc:`network tolerance testing</network>`.

See instructions specific for your distribution below.

Building From Source
====================

.. note:: The recommended way to building vagga is to install the tool from
   packages (see :ref:`Ubuntu` below and then build vagga using vagga itself,
   the text below describes old-style build process)


Build-time dependencies:

* Rust_ compiler 1.0.0-alpha (``rustc``)
* ``make`` (probably gnu variant)
* ``git`` (when installing from git source)

Run-time dependencies (basically none):

* ``glibc`` (probably you have it)
* ``newuidmap/newgidmap`` binaries (in ubuntu is separate ``uidmap`` package,
  but it's a part of ``shadow`` which is installed everywhere)

Process is as simple as following::

    git submodule update --init
    make
    sudo make install PREFIX=/usr


.. _Rust: http://www.rust-lang.org
.. _linux: http://kernel.org

.. _ubuntu:

{'fraction_non_alphanumeric': 0.11768104776579352, 'fraction_numerical': 0.014252696456086287, 'mean_word_length': 4.182634730538922, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1266396', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1520, 'n_words': 581}