Skip to content
Snippets Groups Projects
README.rst 1.82 KiB
Newer Older
  • Learn to ignore specific revisions
  • Set up and use a network of local development VMs
    -------------------------------------------------
    
    ... using `Vagrant <https://www.vagrantup.com/>`_ to manage VirtualBox VMs [#]_.
    To get started, first install Vagrant and make sure it works.
    One possible way to do it in NixOS:
    
    1. Install Vagrant, by adding the packages:
    
      - ``vagrant`` (orchestrating virtual machines on the command line)
         - Only use when version >= 2.2.16 has become available.  Else see below.
      - Optional: ``packer`` (for creating your own VM images)
    
    2. Add configuration to install and enable VirtualBox:
    
      - ``virtualisation.virtualbox.host.enable = true;``
    
    3. Add your user to the ``vboxusers`` group, for example:
    
      - ``users.extraGroups.vboxusers.members = [ "flo" "jp" ];``
    
    
    .. [#] The author of this documentation wasted a lot of time trying to get Vagrant to work with KVM/libvirt.  Issues with networking that looked like guest misconfigurations vanished after changing to the better-tested combination of Vagrant and VirtualBox.
    
    
    Pre-Vagrant 2.2.16: Get Vagrant with the required fixes for NixOS guests
    ````````````````````````````````````````````````````````````````````````
    
    The Vagrant nixos-guest template `received a critical update on 2021-03-08 <https://github.com/hashicorp/vagrant/commit/990d94ed9d0b3092e855bc1bb9deeeb7aa7792cf>`_ which is going to be in version 2.2.16 once it's out.
    
    Retrieve and use the latest Vagrant development version locally::
    
      git clone ssh://git@github.com/hashicorp/vagrant.git
      cd vagrant/
      nix-shell -p gcc gnumake git gnutar curl ruby
      bundle install
      bundle --binstubs exec
      cd exec/
      export PATH=`pwd`:$PATH
    
    
    Use the local development environment
    `````````````````````````````````````
    
    Build and start the VMs::
    
      vagrant up
    
    Then::
    
      morph build grid.nix
      morph push grid.nix
      morph deploy grid.nix switch