diff --git a/how-to/How-To-Setup-the-nc-env-Virtual-Machine.md b/how-to/How-To-Setup-the-nc-env-Virtual-Machine.md new file mode 100644 index 0000000..7ada3ef --- /dev/null +++ b/how-to/How-To-Setup-the-nc-env-Virtual-Machine.md @@ -0,0 +1,77 @@ +# How To Setup the nc-env Virtual Machine + +## Introduction + +While it is advised to run nc-env directly in your machine, we also provide a virtual machine image +with a pre-configured nc-env environment. + +It is a Ubuntu Desktop system, that means that you have a graphical interface in it. + +## Pre-requisites + +A machine where you can run LXD daemon (Linux or macOS, as Windows only supports the LXD client), with at least 30 GB of free space. + +## Downloads + +Download the virtual machine and the storage volume from: + +https://chat.x51-hserver.com/s/aajB2E9PeKSAXqR + + +## Configure your host + +1. Install lxd. See the official [documentation](https://linuxcontainers.org/lxd/getting-started-cli/#installing-a-package). +2. Initialize lxd. See the official [documentation](https://linuxcontainers.org/lxd/docs/latest/howto/initialize/). +3. Create a storage pool called `nc-env-vm-pool`. + + If you have a free device or partition: + + ``` + $ lxc storage create nc-env-vm-pool zfs source=/dev/ zfs.pool_name=nc-env-vm-pool + ``` + + Otherwise: + + ``` + $ fallocate -l 30GB nc-env-vm-pool.disk + ## Find the first unused device + $ sudo losetup -f + /dev/loop19 + $ sudo losetup /dev/loop19 nc-env-vm-pool.disk + $ lxc storage create nc-env-vm-pool zfs source=/dev/loop19 zfs.pool_name=nc-env-vm-pool + ``` + +4. Create the profile `prf-nc-env-vm`: + + ``` + $ lxc profile create nc-env-vm-prf + $ lxc profile set nc-env-vm-prf boot.autostart false + $ lxc profile set nc-env-vm-prf limits.memory 6GiB + $ lxc profile set nc-env-vm-prf limits.cpu 4 + $ lxc profile device add nc-env-vm-prf root disk path=/ size=20GB pool=nc-env-vm-pool + $ lxc profile device add nc-env-vm-prf eth0 nic nictype=bridged parent=lxdbr0 name=eth0 + ``` + +5. Import the virtual machine: + + ``` + $ lxc import nc-env-vm.tar.bz2 + ``` + +6. Import the volume called `nc-env-vm-storage` and attach it to the virtual machine + + ``` + $ lxc storage volume import nc-env-vm-pool nc-env-vm-storage.tar.bz2 + $ lxc storage volume attach nc-env-vm-pool nc-env-vm-storage nc-env-vm + ``` + +7. Start the virtual machine and open a graphical console into it + + ``` + $ lxc start nc-env-vm + $ lxc console --type vga nc-env-vm + ``` + + + +You are now ready to create your first container-based Nextcloud environment!