|
| 1 | +# Local OVA installation |
| 2 | + |
| 3 | +In this section, we describe how to create a virtual machine (VM) in Open Virtual Appliance (OVA) format with the Wazuh server, dashboard, and indexer components pre-installed. To build it locally, we will use the `wazuh_local_ova` module from the [Wazuh Virtual Machines](https://github.com/wazuh/wazuh-virtual-machines/tree/main/wazuh_local_ova) repository. |
| 4 | + |
| 5 | +You need a system with a minimum of 4 CPU cores and 8 GB of RAM to build the virtual machine. Ensure that these dependencies are installed on the system: |
| 6 | + |
| 7 | +- Virtual Box |
| 8 | +- Vagrant |
| 9 | +- Git |
| 10 | +- Python |
| 11 | + - Make sure `pip` and `hatch` are installed for Python |
| 12 | + |
| 13 | + |
| 14 | +## Create the Wazuh VM |
| 15 | + |
| 16 | +To create the Wazuh OVA locally, we will use the `wazuh_local_ova` module. This module is written in Python and has the following options: |
| 17 | + |
| 18 | +| Option | Short | Description | Required | Default | |
| 19 | +|--------|-------|-------------|----------|---------| |
| 20 | +| `--name` | `-n` | Name of the generated `.ova` file | No | `wazuh-local-ova` | |
| 21 | +| `--output` | `-o` | Directory where the `.ova` file will be stored | No | Current directory | |
| 22 | +| `--packages_url_path` | `-p` | Path to the file containing the package download URLs | **Yes** | - | |
| 23 | +| `--checksum` | `-c` | Generate a `.sha512` file for the OVA | No | `False` | |
| 24 | + |
| 25 | +The file specified in `--packages_url_path` must contain the URLs of the Wazuh core component packages. Below is an example of the file content with the different supported package nomenclatures: |
| 26 | + |
| 27 | +```yaml |
| 28 | +wazuh_manager_amd64_deb: "http://example.com/wazuh-manager-amd64.deb" |
| 29 | +wazuh_manager_arm64_deb: "http://example.com/wazuh-manager-arm" |
| 30 | +wazuh_manager_amd64_rpm: "http://example.com/wazuh-manager-amd64.rpm" |
| 31 | +wazuh_manager_arm64_rpm: "http://example.com/wazuh-manager-arm.rpm" |
| 32 | +wazuh_indexer_amd64_deb: "http://example.com/wazuh-indexer-amd64.deb" |
| 33 | +wazuh_indexer_arm64_deb: "http://example.com/wazuh-indexer-arm" |
| 34 | +wazuh_indexer_amd64_rpm: "http://example.com/wazuh-indexer-amd64.rpm" |
| 35 | +wazuh_indexer_arm64_rpm: "http://example.com/wazuh-indexer-arm.rpm" |
| 36 | +wazuh_dashboard_amd64_deb: "http://example.com/wazuh-dashboard-amd64.deb" |
| 37 | +wazuh_dashboard_arm64_deb: "http://example.com/wazuh-dashboard-arm" |
| 38 | +wazuh_dashboard_amd64_rpm: "http://example.com/wazuh-dashboard-amd64.rpm" |
| 39 | +wazuh_dashboard_arm64_rpm: "http://example.com/wazuh-dashboard-arm.rpm" |
| 40 | +... |
| 41 | +``` |
| 42 | + |
| 43 | +Follow the steps below to create the Wazuh virtual machine: |
| 44 | + |
| 45 | +1. Clone the Wazuh Virtual Machines repository and select the Wazuh version you want to install in the OVA, in this case `5.0.0`: |
| 46 | + |
| 47 | + ```bash |
| 48 | + git clone https://github.com/wazuh/wazuh-virtual-machines && cd wazuh-virtual-machines/ && git checkout v5.0.0 |
| 49 | + ``` |
| 50 | + |
| 51 | +2. Execute the following command to build the OVA image: |
| 52 | + |
| 53 | + ```bash |
| 54 | + hatch run local-ova:create -p \<path to the urls file\> |
| 55 | + ``` |
| 56 | + |
| 57 | + This command will set up the execution environment, configure the Vagrant VM and export the OVA image. |
| 58 | + |
| 59 | + You can also customize the name and output directory of the OVA file using the `--name` and `--output` options. For example: |
| 60 | + |
| 61 | + ```bash |
| 62 | + hatch run local-ova:create -p \<path to the urls file\> -n custom-wazuh-ova -o /path/to/output/directory |
| 63 | + ``` |
| 64 | + |
| 65 | + To see all available options, you can use the `-h` or `--help` flag: |
| 66 | + |
| 67 | + ```bash |
| 68 | + hatch run local-ova:create --help |
| 69 | + ``` |
0 commit comments