Artificial Intelligence has revolutionized scripting, penetration testing, and IT automation. However, using public cloud-based Large Language Models (LLMs) like ChatGPT or Claude presents a massive data privacy risk. Pasting proprietary network configurations, Active Directory scripts, or firewall rules into a public cloud service can inadvertently leak sensitive enterprise infrastructure data to third parties.

The solution for cybersecurity professionals and homelab enthusiasts is to run an air-gapped, local AI model. By deploying a self-hosted LLM inside your Proxmox Virtual Environment, you gain the analytical power of AI with zero external data telemetry. In this comprehensive guide, we will walk through provisioning an Ubuntu Server VM in Proxmox, configuring PCI passthrough for hardware acceleration, and deploying Ollama to run models like Llama 3 and Mistral entirely on your local network.

Phase 1: Hardware Requirements and Proxmox Host Preparation

Running an LLM locally requires significant computational resources. While CPU inference is possible, it is incredibly slow. For real-time code analysis, a dedicated Graphics Processing Unit (GPU) is highly recommended.

  • Memory (VRAM): To run a quantized 7B or 8B parameter model comfortably, your GPU should have at least 8GB to 12GB of VRAM (e.g., NVIDIA RTX 3060 or 4060).
  • System RAM: Allocate at least 16GB of system RAM to the virtual machine.

Enabling IOMMU for GPU Passthrough

Before creating the VM, you must enable IOMMU on the Proxmox host so it can pass the physical GPU directly to the virtual machine.

  1. Access the Proxmox node shell and edit the GRUB bootloader configuration:
    nano /etc/default/grub
  2. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add intel_iommu=on iommu=pt (or amd_iommu=on if you are using an AMD CPU).
  3. Save the file and update GRUB by running:
    update-grub
  4. Reboot your Proxmox server for the changes to take effect.
[Insert your original screenshot here: Proxmox terminal showing the modified GRUB file enabling IOMMU for PCI passthrough]

Phase 2: VM Creation and PCI Device Attachment

Next, we will create the Ubuntu Server environment that will host the AI engine.

  1. Upload the latest Ubuntu Server LTS ISO to your Proxmox storage.
  2. Create a new VM, assigning at least 4 CPU cores (set type to Host), 16GB of RAM, and a 60GB disk. Ensure the network interface is attached to your isolated lab bridge (e.g., vmbr1) to keep the AI air-gapped from production.
  3. Before starting the VM, go to the Hardware tab, click Add > PCI Device.
  4. Select your dedicated GPU from the dropdown list. Check the boxes for All Functions, ROM-Bar, and PCI-Express.
  5. Start the VM and install Ubuntu Server as normal.

Phase 3: Installing the Local AI Engine (Ollama)

Ollama is a lightweight, open-source framework that makes running local language models incredibly easy. It handles the complexities of GPU drivers and model quantization automatically.

  1. Log into your new Ubuntu Server VM via SSH.
  2. Install the proprietary GPU drivers (if using NVIDIA):
    sudo apt update && sudo apt install nvidia-driver-535 -y
  3. Reboot the VM and verify the GPU is recognized by running nvidia-smi.
  4. Run the official Ollama installation script:
    curl -fsSL https://ollama.com/install.sh | sh
  5. Once installed, download and start a high-performance coding model, such as Meta's Llama 3 or Mistral. To pull and run Llama 3, type:
    ollama run llama3
[Insert your original screenshot here: The Ubuntu terminal displaying the output of 'nvidia-smi' and the Ollama chat prompt ready for input]

Phase 4: Practical Application - Secure Code Analysis

With your local AI running, you now have a private assistant. If you are writing a custom Bash script to automate firewall rules on pfSense, or creating a Python payload in Kali Linux, you can paste the code directly into your local Ollama terminal to check for logic errors or security vulnerabilities.

Because the AI is hosted entirely on your Proxmox server with no outbound internet access required after the initial model download, your proprietary scripts remain 100% confidential. This architecture bridges the gap between advanced machine learning capabilities and strict Zero Trust enterprise security policies.