From ffaaed2f55ecf15dff084722d5be83b899eec446 Mon Sep 17 00:00:00 2001 From: Benoit Donneaux <benoit@leastauthority.com> Date: Tue, 6 Jun 2023 10:41:22 +0000 Subject: [PATCH] Improve documentation for LibVirt Signed-off-by: Benoit Donneaux <benoit@leastauthority.com> --- morph/grid/local/README.rst | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/morph/grid/local/README.rst b/morph/grid/local/README.rst index 2246d40b..63101e77 100644 --- a/morph/grid/local/README.rst +++ b/morph/grid/local/README.rst @@ -8,20 +8,38 @@ Issues with networking that looked like guest misconfigurations vanished after c This requires `NixOS <https://nixos.org/>`_. Nix without the OS will not work. -Use the local development environment -````````````````````````````````````` -0. Add VirtualBox to your NixOs system configuration at ``/etc/nixos/configuration.nix``:: +Setup virtualisation on the host +```````````````````````````````` + +* VirtualBox + + 1. Add VirtualBox 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; - # Create a local pool for libvirt +* LibVirt + + 1. Add LibVirt to your NixOS system configuration at ``/etc/nixos/configuration.nix``:: + + virtualisation.libvirtd.enable = true; + security.polkit.enable = true; + # Enable HW acceleration if available + #boot.kernelModules = [ "kvm-amd" "kvm-intel" ]; + +2. Create a local pool for libvirt (optional):: + + export POOL_NAME=morph_local mkdir -p ~/.libvirt/images - sudo virsh pool-define-as morph_local --type dir --target ${HOME}/.libvirt/images - virsh pool-autostart morph_local - virsh pool-start morph_local + 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 + + +Use the local development environment +````````````````````````````````````` 1. Enter the morph local grid directory:: -- GitLab