Skip to content
Snippets Groups Projects
Select Git revision
  • 99772671a6414eb2983a1f0fdb813f2300c556f9
  • develop default protected
  • dont-use-etc-hosts
  • sec
  • simplify-grafana
  • simple-docs-build
  • local-test-grid
  • no-morph-on-nodes
  • stuff
  • arion
10 results

README.rst

Blame
  • Forked from PrivateStorage / PrivateStorageio
    1365 commits behind the upstream repository.
    README.rst 1.80 KiB

    Set up and use a network of local development VMs

    ... using Vagrant to manage VirtualBox VMs. (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.)

    Use the local development environment

    1. Enter the project's nix-shell:

      nix-shell ../../../shell.nix

    2. Build and start the VMs:

      VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up
    3. Then, add the Vagrant SSH configuration to your user's ~/.ssh/config file:

      install -d ~/.ssh ; vagrant ssh-config >> ~/.ssh/config
    4. Edit the generated configuration: Add the publicIP addresses from grid.nix to ssh config Host match blocks (not HostName) so the Host lines all read like:

      Host payments1 192.168.67.21
        HostName 127.0.0.1
        User vagrant
        [...]

    From version 1.5.0 Morph honors the SSH_CONFIG_FILE environment variable since 3f90aa88 (March 2020, v 1.5.0), so in the future this will get a bit more convenient.

    1. Add your SSH key to users.nix so you'll be able to log in after deploying the new configuration:

      $EDITOR secrets/users.nix
    1. Then, build and deploy our software to the Vagrant VMs:

      morph build grid.nix
      morph push grid.nix
      morph deploy grid.nix boot
      vagrant halt
      vagrant up
      morph upload-secrets grid.nix
    You should now be able to log in with the users and keys you set in your users.nix file.