diff --git a/morph/grid/local/README.rst b/morph/grid/local/README.rst index 9d60afafc5009df951ee91e9fe09dc70ee0715cf..e53cd1a212c1b68ccafc4e112facb0219487b52e 100644 --- a/morph/grid/local/README.rst +++ b/morph/grid/local/README.rst @@ -12,26 +12,23 @@ Nix without the OS will not work. Setup virtualisation on the host ```````````````````````````````` -* VirtualBox - Add to your NixOS system configuration at ``/etc/nixos/configuration.nix``:: - - virtualisation.virtualbox.host.enable = true; - # Save bytes and build time, optional but recommended: - virtualisation.virtualbox.host.headless = true; - -* LibVirt - Add to your NixOS system configuration at ``/etc/nixos/configuration.nix``:: +1. Add to your NixOS system configuration at ``/etc/nixos/configuration.nix``:: + # Enable libvirt - likely incompatible with virtualisation.virtualbox! virtualisation.libvirtd.enable = true; + # Required for LibVirt security.polkit.enable = true; - # Enable HW acceleration if available + # Enable HW acceleration if (nested virtualisation is) available #boot.kernelModules = [ "kvm-amd" "kvm-intel" ]; -* LibVirt (optional) - Create a local pool:: +2. Create a dedicated pool (optional - to avoid `/var/lib/libvirt/storage`):: export POOL_NAME=morph_local - mkdir -p ~/.libvirt/images - sudo virsh pool-define-as $POOL_NAME --type dir --target ${HOME}/.libvirt/images - sudo virsh pool-autostart $POOL_NAME - sudo virsh pool-start $POOL_NAME + POOL_PATH="~/.libvirt/images" + mkdir -p "${POOL_PATH}" + sudo virsh pool-define-as ${POOL_NAME} --type dir --target "${POOL_PATH}" + sudo virsh pool-autostart ${POOL_NAME} + sudo virsh pool-start ${POOL_NAME} Use the local development environment @@ -47,20 +44,19 @@ Use the local development environment 3. Build and start the VMs:: - export VAGRANT_DEFAULT_PROVIDER=virtualbox # Use `libvirt` for QEmu - vagrant up # Add `--no-parallel` on low resources + vagrant up --provider=libvirt 4. Then, add the Vagrant SSH configuration to your user's ``~/.ssh/config`` file:: install -d ~/.ssh ; vagrant ssh-config >> ~/.ssh/config - Latest Morph honors the ``SSH_CONFIG_FILE`` environment variable (`since 3f90aa88 (March 2020, v 1.5.0) <https://github.com/DBCDK/morph/commit/3f90aa885fac1c29fce9242452fa7c0c505744ef#diff-d155ad793bd62e6ea4c44ba985049ecb13a4f4f32f799791b2bce695a16c0101>`_), so in the future this should get a bit more convenient. + Latest Morph honors the ``SSH_CONFIG_FILE`` environment variable (`since 3f90aa88 (March 2020, v 1.5.0) <https://github.com/DBCDK/morph/commit/3f90aa885fac1c29fce9242452fa7c0c505744ef#diff-d155ad793bd62e6ea4c44ba985049ecb13a4f4f32f799791b2bce695a16c0101>`_), so in the future this should get a bit more convenient. -6. Create a ``public-keys/users.nix`` file with your SSH key (see ``public-keys/users.nix.example`` for the format) so you'll be able to log in after deploying the new configuration:: +5. Create a ``public-keys/users.nix`` file with your SSH key (see ``public-keys/users.nix.example`` for the format) so you'll be able to log in after deploying the new configuration:: $EDITOR public-keys/users.nix -7. Then, build and deploy our software to the Vagrant VMs:: +6. Then, build and deploy our software to the Vagrant VMs:: morph build grid.nix morph push grid.nix @@ -69,4 +65,4 @@ Use the local development environment vagrant up --no-destroy-on-error # Add `--no-parallel` on low resources 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. +You should now be able to log in with the users and keys you set in your ``users.nix`` file.