diff --git a/DEVMATRIX_CUSTOM_SETUP.md b/DEVMATRIX_CUSTOM_SETUP.md new file mode 100644 index 0000000..1d03955 --- /dev/null +++ b/DEVMATRIX_CUSTOM_SETUP.md @@ -0,0 +1,295 @@ +# DevMatrix Setup - CUSTOMIZED FOR YOUR PROXMOX + +## Your Configuration Summary + +| Setting | Value | +|---------|-------| +| **Proxmox IP** | 192.168.5.200 | +| **Network Bridge** | vmbr1 | +| **HDD Storage** | pve-main2 | +| **Future NVMe Storage** | pve-main | +| **TrueNAS IP** | 192.168.5.195 | +| **TrueNAS Dataset** | NAS2 | +| **VM ID Range** | 300-320 | + +## VM Network Configuration + +| VM ID | Name | IP Address | Purpose | +|-------|------|------------|---------| +| 300 | OpenClaw-DevMatrix | 192.168.5.210 | Main development environment | +| 301 | Windows-LTSC-Test | 192.168.5.211 | Windows testing VM | +| 302 | Android-Emulator | 192.168.5.212 | Android/mobile testing | + +**Gateway:** 192.168.5.1 +**DNS:** 8.8.8.8, 1.1.1.1 + +## Storage Layout + +### Current (HDD - pve-main2) + +| VM | OS Disk | Data Disk | Total | +|----|---------|-----------|-------| +| 300 | 200GB | 200GB | 400GB | +| 301 | 100GB | - | 100GB | +| 302 | 50GB | - | 50GB | +| Reserved | - | - | 150GB | +| **Total** | **350GB** | **200GB** | **550GB** | + +### Future (NVMe - pve-main) +After migration, OS disks move to NVMe for better performance: + +| VM | OS Disk (NVMe) | Data Disk (HDD) | +|----|----------------|-----------------| +| 300 | 200GB | 200GB | +| 301 | 100GB | - | +| 302 | 50GB | - | + +## TrueNAS Integration + +### Shares to Create on TrueNAS + +Path: `NAS2/devmatrix/` + +``` +NAS2/ +└── devmatrix/ + ├── projects/ # Project storage (read/write) + ├── backups/ # Backup storage (read/write) + ├── iso-archive/ # ISO storage (read-only) + └── shared/ # Shared files (read/write) +``` + +### Mount Points in VM 300 + +| TrueNAS Path | Local Mount | Usage | +|--------------|-------------|-------| +| `/mnt/NAS2/devmatrix/projects` | `/mnt/truenas/projects` | Store projects | +| `/mnt/NAS2/devmatrix/backups` | `/mnt/truenas/backups` | Automated backups | +| `/mnt/NAS2/devmatrix/iso-archive` | `/mnt/truenas/iso-archive` | Store ISOs | +| `/mnt/NAS2/devmatrix/shared` | `/mnt/truenas/shared` | Shared files | + +--- + +## Quick Start Commands + +### Step 1: Transfer Scripts to Proxmox + +```bash +# From any machine with SSH access to Proxmox +scp setup_devmatrix_proxmox_custom.sh root@192.168.5.200:/root/ +scp setup_openclaw_dev.sh root@192.168.5.200:/root/ +scp setup_windows_vm.ps1 root@192.168.5.200:/root/ +scp setup_truenas.sh root@192.168.5.200:/root/ +``` + +### Step 2: Run Proxmox Setup + +```bash +# SSH into Proxmox +ssh root@192.168.5.200 + +# Make script executable and run +chmod +x setup_devmatrix_proxmox_custom.sh +./setup_devmatrix_proxmox_custom.sh +``` + +### Step 3: Install Ubuntu on VM 300 + +```bash +# Start VM +qm start 300 + +# Connect to console (via Proxmox web UI or CLI) +qm console 300 + +# Install Ubuntu 22.04 Server with these settings: +# - Network: DHCP (will get 192.168.5.210) +# - Username: devmatrix +# - Import SSH key from Proxmox host +``` + +### Step 4: Setup Dev Environment (Inside VM 300) + +```bash +# SSH into VM 300 +ssh devmatrix@192.168.5.210 + +# Run setup +chmod +x setup_openclaw_dev.sh +./setup_openclaw_dev.sh +``` + +### Step 5: Configure TrueNAS (Inside VM 300) + +```bash +# After setting up shares on TrueNAS web UI +chmod +x setup_truenas.sh +./setup_truenas.sh +``` + +### Step 6: Configure API Keys (YOU DO THIS) + +```bash +# Inside VM 300 +~/scripts/configure_api_keys.sh + +# Enter your: +# - Kimi API Key +# - Antigravity API Key +``` + +### Step 7: Install Windows on VM 301 + +```bash +# Start Windows VM +qm start 301 + +# Install Windows via console +# Then run setup_windows_vm.ps1 as Administrator +``` + +--- + +## Daily Use Commands + +### VM Control + +```bash +# Start/stop VMs from Proxmox +qm start 300 # Start Dev VM +qm stop 300 # Stop Dev VM +qm status 300 # Check status + +# Or from inside VM 300 +~/scripts/vm_control.sh win-start # Start Windows +~/scripts/vm_control.sh win-stop # Stop Windows +~/scripts/vm_control.sh win-status # Check Windows status +``` + +### Development + +```bash +# Access VS Code Server +http://192.168.5.210:8080 +# Password: devmatrix-setup-2024 + +# Create new project +~/scripts/create_project.sh MyApp mobile + +# Test on Windows +~/scripts/test_on_windows.sh /path/to/project + +# Backup to TrueNAS +~/scripts/backup_to_truenas.sh + +# Restore from TrueNAS +~/scripts/restore_from_truenas.sh 2024-02-16 +``` + +### Migration to NVMe (When Ready) + +```bash +# On Proxmox host, after installing NVMe and adding as 'pve-main' storage +/root/devmatrix-scripts/migrate_to_nvme.sh +``` + +--- + +## File Locations + +### On Proxmox Host + +| File | Location | Purpose | +|------|----------|---------| +| VM Info | `~/devmatrix_vm_info.txt` | Complete VM documentation | +| SSH Keys | `~/.ssh/devmatrix_id_rsa` | Private key for VM access | +| Migration Script | `/root/devmatrix-scripts/migrate_to_nvme.sh` | NVMe migration tool | +| ISOs | `/var/lib/vz/template/iso/` | VM installation media | + +### Inside VM 300 (Main Dev VM) + +| Directory | Purpose | +|-----------|---------| +| `~/projects` | Local project storage | +| `~/projects-nas` | TrueNAS project storage (symlink) | +| `~/scripts` | Helper scripts | +| `~/.openclaw` | OpenClaw configuration | +| `/mnt/truenas/` | Mounted TrueNAS shares | + +--- + +## Troubleshooting + +### Can't Access VM 300 + +```bash +# From Proxmox, check VM status +qm status 300 +qm log 300 + +# Check IP assignment +qm guest exec 300 -- ip addr show + +# Reset network if needed +qm guest exec 300 -- netplan apply +``` + +### TrueNAS Mounts Not Working + +```bash +# Check connectivity +ping 192.168.5.195 + +# List available shares +showmount -e 192.168.5.195 + +# Check mounts +df -h | grep truenas + +# Remount +sudo mount -a +``` + +### Slow Performance on HDD + +Normal for initial setup. After migration to NVMe: +- VM boot time: ~10x faster +- Disk I/O: ~5x faster +- Compilation: ~2-3x faster + +### Out of Disk Space + +```bash +# Check usage +pvesm status + +# Expand VM disk if needed +qm resize 300 scsi0 +50G + +# Then expand filesystem inside VM +sudo resize2fs /dev/sda1 +``` + +--- + +## Next Steps After Setup + +1. ✅ Install Ubuntu on VM 300 +2. ✅ Run `setup_openclaw_dev.sh` +3. ✅ Configure TrueNAS shares and run `setup_truenas.sh` +4. ✅ Add API keys with `configure_api_keys.sh` +5. ✅ Install Windows on VM 301 +6. ✅ Test everything works +7. 🚀 Start building with AI-powered development! + +--- + +## Support + +If you encounter issues: +1. Check `~/devmatrix_vm_info.txt` for reference +2. Review logs: `qm log ` +3. Run diagnostics from this guide +4. Ask me for help with specific errors! + +**Ready to set up your DevMatrix?** Start with Step 1 above! 🚀 diff --git a/DEVMATRIX_SETUP_GUIDE.md b/DEVMATRIX_SETUP_GUIDE.md new file mode 100644 index 0000000..46340c1 --- /dev/null +++ b/DEVMATRIX_SETUP_GUIDE.md @@ -0,0 +1,433 @@ +# DevMatrix Proxmox Setup - Complete Guide + +## Overview + +This guide will set up a complete autonomous development environment on your Proxmox server with: +- **VM 300**: OpenClaw DevMatrix (Ubuntu 22.04) - 32GB RAM, 16 cores +- **VM 301**: Windows 11 LTSC IoT Test VM - 16GB RAM, 8 cores +- **VM 302**: Android Emulator VM - 8GB RAM, 4 cores + +## Prerequisites + +- Proxmox VE 7.x or 8.x +- Network bridge `vmbr1` configured +- At least 56GB RAM available (32+16+8) +- At least 750GB storage available +- Root access to Proxmox host + +## Files Included + +1. `setup_devmatrix_proxmox.sh` - Main Proxmox setup script +2. `setup_openclaw_dev.sh` - Ubuntu VM environment setup +3. `setup_windows_vm.ps1` - Windows VM post-install setup + +--- + +## Step 1: Transfer Scripts to Proxmox + +### Option A: SSH (Recommended) +```bash +# From your local machine, copy scripts to Proxmox +scp setup_devmatrix_proxmox.sh root@192.168.5.200:/root/ +``` + +### Option B: Proxmox Shell +1. Go to https://192.168.5.200:8006 +2. Select your node → Shell +3. Use `wget` or `curl` to download scripts + +--- + +## Step 2: Run Proxmox Setup Script + +```bash +# SSH into Proxmox +ssh root@192.168.5.200 + +# Make script executable +chmod +x setup_devmatrix_proxmox.sh + +# Run setup +./setup_devmatrix_proxmox.sh +``` + +### What the script does: +1. ✅ Checks vmbr1 exists +2. ✅ Shows available storage - you pick one +3. ✅ Verifies VM IDs 300-302 are available +4. ✅ Checks available RAM and disk space +5. ✅ Downloads Ubuntu 22.04 Server ISO +6. ✅ Prompts for Windows ISO (you provide LTSC IoT) +7. ✅ Creates VM 300: OpenClaw DevMatrix +8. ✅ Creates VM 301: Windows LTSC Test +9. ✅ Creates VM 302: Android Emulator +10. ✅ Generates SSH keys for access +11. ✅ Saves VM info to ~/devmatrix_vm_info.txt + +### Expected Output: +``` +[DevMatrix] 🔍 Running pre-flight checks... +[DevMatrix] ✓ Network bridge 'vmbr1' found +[DevMatrix] 📦 Checking available storage... +... +[DevMatrix] 🎉 DevMatrix VMs Created Successfully! +``` + +--- + +## Step 3: Install Ubuntu on VM 300 + +### Start the VM: +```bash +qm start 300 +``` + +### Access Console: +- Proxmox Web UI → VM 300 → Console +- Or: `qm console 300` from Proxmox shell + +### Install Ubuntu 22.04 Server: +1. Select "Try or Install Ubuntu Server" +2. Language: English +3. Keyboard layout: Your preference +4. Network: DHCP (should get IP from vmbr1) +5. Proxy: Leave blank +6. Mirror: Default +7. Storage: Use entire disk +8. Profile: + - Name: `devmatrix` + - Server name: `devmatrix` + - Username: `devmatrix` + - Password: [Choose a strong password] +9. SSH: Import SSH key (copy from ~/.ssh/devmatrix_id_rsa.pub on Proxmox) +10. Featured Server Snaps: None (we'll install everything manually) +11. Wait for installation to complete +12. Reboot when prompted + +### After Reboot: +```bash +# Find VM IP address +qm guest exec 300 -- ip addr show | grep inet + +# SSH into VM from Proxmox host +ssh -i ~/.ssh/devmatrix_id_rsa devmatrix@ +``` + +--- + +## Step 4: Setup Dev Environment on VM 300 + +### Transfer setup script: +```bash +# From Proxmox host, copy script to VM +scp -i ~/.ssh/devmatrix_id_rsa setup_openclaw_dev.sh devmatrix@:/home/devmatrix/ +``` + +### Run setup: +```bash +# Inside VM (SSH session) +chmod +x setup_openclaw_dev.sh +./setup_openclaw_dev.sh +``` + +### This installs: +- OpenClaw (AI orchestrator) +- Node.js 20 +- Python + development tools +- Docker +- Flutter (mobile development) +- .NET 8 (cross-platform) +- Rust +- Go +- Wine (Windows compatibility) +- Playwright (UI testing) +- PostgreSQL & Redis +- AWS CLI & Google Cloud SDK +- Kubernetes tools (kubectl, helm) +- Terraform +- VS Code Server (web-based IDE) +- VM control scripts + +### Expected Duration: +- 15-30 minutes depending on internet speed +- Downloads ~5GB of packages + +--- + +## Step 5: Configure API Keys (YOU DO THIS) + +**⚠️ IMPORTANT: This is the ONLY step requiring your API keys** + +```bash +# Inside VM 300 +~/scripts/configure_api_keys.sh +``` + +You will be prompted for: +1. **Kimi API Key** - Get from https://kimi.moonshot.cn/ +2. **Antigravity API Key** - From your provider + +The script creates: +- `~/.openclaw/config/kimi.yaml` +- `~/.openclaw/config/antigravity.yaml` + +Files are set to 600 permissions (owner read/write only). + +### Test Configuration: +```bash +openclaw models list +``` + +--- + +## Step 6: Install Windows on VM 301 + +### Prerequisites: +You need Windows 11 Enterprise LTSC IoT ISO: +- Download from Microsoft Volume Licensing Service Center +- Or your organization's licensing portal +- Filename: `Win11_Ent_LTSC_IoT.iso` +- Place in: `/var/lib/vz/template/iso/` on Proxmox + +### Start VM: +```bash +qm start 301 +``` + +### Install Windows: +1. Connect via Proxmox Console +2. Standard Windows 11 LTSC installation +3. Region/keyboard: Your preference +4. Network: Let it connect to vmbr1 +5. Microsoft account: Skip (use offline account) +6. Username: `testuser` +7. Password: `DevMatrix2024!` (or your choice) + +### Post-Install Setup: +1. Log in as testuser +2. Open PowerShell as Administrator +3. Transfer setup script: + ```powershell + # From Proxmox, copy to VM + scp setup_windows_vm.ps1 testuser@:C:/Scripts/ + ``` +4. Run setup: + ```powershell + cd C:\Scripts + .\setup_windows_vm.ps1 + ``` + +### This installs on Windows: +- OpenSSH Server +- Remote Desktop +- Chocolatey package manager +- Git, Python, Node.js, .NET, VS Code +- Playwright for UI testing +- Test automation scripts + +### Reboot when complete. + +--- + +## Step 7: Install Android Emulator (VM 302 - Optional) + +VM 302 is pre-configured with Ubuntu. You can either: + +### Option A: Use as-is (lightweight Linux VM) +Good for testing Linux-specific code. + +### Option B: Install Android Emulator +```bash +qm start 302 +# Install Ubuntu Server +# Then install Android SDK + Emulator +``` + +--- + +## Usage Examples + +### Start Development Session: +```bash +# SSH into main dev VM +ssh -i ~/.ssh/devmatrix_id_rsa devmatrix@192.168.5.x + +# Access VS Code in browser +# http://192.168.5.x:8080 +# Password: devmatrix-setup-2024 +``` + +### Create New Project: +```bash +# Example: Create Flutter mobile app +openclaw swarm create "MyMobileApp" --type flutter --agents 4 + +# Example: Create React web app +openclaw swarm create "MyWebApp" --type react --agents 5 +``` + +### Test on Windows: +```bash +# From VM 300 +~/scripts/vm_control.sh win-start +# Wait 60 seconds +~/scripts/test_on_windows.sh /path/to/your/dotnet/project +~/scripts/vm_control.sh win-stop +``` + +### Control VMs: +```bash +# Start Windows VM +~/scripts/vm_control.sh win-start + +# Check status +~/scripts/vm_control.sh win-status + +# Stop Windows VM +~/scripts/vm_control.sh win-stop + +# Same for Android +~/scripts/vm_control.sh android-start +~/scripts/vm_control.sh android-stop +``` + +--- + +## Network Configuration + +### Default IPs (via DHCP on vmbr1): +- VM 300 (Ubuntu): Assigned by DHCP +- VM 301 (Windows): Assigned by DHCP +- VM 302 (Android): Assigned by DHCP + +### To Set Static IPs (recommended): + +**On VM 300 (Ubuntu):** +```bash +sudo nano /etc/netplan/00-installer-config.yaml +``` + +Change to: +```yaml +network: + ethernets: + ens18: + dhcp4: no + addresses: + - 192.168.5.150/24 + routes: + - to: default + via: 192.168.5.1 + nameservers: + addresses: [8.8.8.8, 1.1.1.1] + version: 2 +``` + +```bash +sudo netplan apply +``` + +**On VM 301 (Windows):** +Settings → Network → Ethernet → Edit → Manual +- IP: 192.168.5.151 +- Subnet: 255.255.255.0 +- Gateway: 192.168.5.1 +- DNS: 8.8.8.8 + +--- + +## Troubleshooting + +### VM Won't Start: +```bash +# Check logs +qm log 300 + +# Check status +qm status 300 + +# Start with verbose +qm start 300 --verbose +``` + +### Can't SSH to VM: +```bash +# Test from Proxmox +qm guest exec 300 -- ping -c 1 8.8.8.8 + +# Check IP +qm guest exec 300 -- ip addr + +# Check SSH service +qm guest exec 300 -- systemctl status ssh +``` + +### Windows VM No Network: +```powershell +# In Windows PowerShell (Admin) +Get-NetAdapter +Get-NetIPAddress +Test-NetConnection 8.8.8.8 +``` + +### Out of Disk Space: +```bash +# On Proxmox +pvesm status + +# Expand VM disk +qm resize 300 scsi0 +100G +``` + +--- + +## Security Notes + +1. **API Keys**: Only stored on VM 300, never transmitted +2. **SSH Keys**: Generated on Proxmox, private key stays on Proxmox +3. **Windows Password**: Change after setup if desired +4. **VS Code Password**: Change in ~/.config/code-server/config.yaml +5. **Firewall**: VMs use vmbr1 (presumably internal network) + +--- + +## Backup Strategy + +### Create Snapshots: +```bash +# Snapshot before major changes +qm snapshot 300 pre-experiment + +# Rollback if needed +qm rollback 300 pre-experiment +``` + +### Backup VM Configs: +```bash +# Backup to NAS/external +vzdump 300 301 302 --compress zstd --storage +``` + +--- + +## Next Steps + +1. ✅ Run Proxmox setup script +2. ✅ Install Ubuntu on VM 300 +3. ✅ Run dev environment setup +4. ✅ Add your API keys +5. ✅ Install Windows on VM 301 +6. ✅ Test the setup +7. 🚀 Start building with AI-powered development! + +--- + +## Support + +If you encounter issues: +1. Check logs: `qm log ` +2. Review this guide +3. Check OpenClaw docs: https://docs.openclaw.ai +4. Ask me for help! + +**Ready to build something amazing?** 🚀 diff --git a/DEVMATRIX_TOMORROW_CHECKLIST.md b/DEVMATRIX_TOMORROW_CHECKLIST.md new file mode 100644 index 0000000..87868db --- /dev/null +++ b/DEVMATRIX_TOMORROW_CHECKLIST.md @@ -0,0 +1,584 @@ +# DevMatrix Setup Checklist - TOMORROW'S TASKS + +## 📋 Complete Setup Guide for Tomorrow + +--- + +## ✅ PHASE 1: Gitea Setup (First Priority) + +### Step 1.1: Create Gitea Repository for Scripts + +**On your Gitea server (git.lemonlink.eu):** + +1. **Log into Gitea web UI** + - URL: `https://git.lemonlink.eu` + - Login with your admin account + +2. **Create New Repository** + - Click **+** → **New Repository** + - Owner: `impulsivefps` (or your username) + - Repository Name: `devmatrix-scripts` + - Description: `DevMatrix Proxmox/OpenClaw setup scripts` + - Visibility: ☑️ Private (recommended) + - Initialize: ☑️ Add README + - Click **Create Repository** + +3. **Upload Scripts** + + **Option A: Web Upload (Easiest)** + - Go to repository → **Upload File** + - Drag and drop these files: + - `setup_devmatrix_proxmox_custom.sh` + - `setup_openclaw_dev.sh` + - `setup_windows_vm.ps1` + - `setup_truenas.sh` + - `setup_truenas_shares.sh` + - Commit message: "Initial DevMatrix setup scripts" + - Click **Commit** + + **Option B: Command Line** + ```bash + # On your local machine where scripts are saved + mkdir devmatrix-scripts + cd devmatrix-scripts + + # Copy scripts here + cp /path/to/scripts/*.sh . + cp /path/to/scripts/*.ps1 . + + # Initialize and push + git init + git add . + git commit -m "Initial DevMatrix setup scripts" + git remote add origin https://git.lemonlink.eu/impulsivefps/devmatrix-scripts.git + git push -u origin main + ``` + +--- + +### Step 1.2: Create Gitea User for OpenClaw + +**Purpose:** This user will be dedicated to the DevMatrix environment for automated git operations. + +1. **Create New User** + - Gitea: **Site Administration** → **User Accounts** → **Create New Account** + - Username: `devmatrix-bot` + - Email: `devmatrix@yourdomain.com` + - Password: Generate strong password (save in password manager) + - ☑️ Send user registration notification (optional) + - Click **Create User** + +2. **Generate Access Token** + - Log in AS the new `devmatrix-bot` user + - Go to **Settings** → **Applications** → **Generate New Token** + - Token Name: `devmatrix-access` + - Scopes: ☑️ `repo`, ☑️ `write:packages` + - Click **Generate Token** + - **COPY THE TOKEN IMMEDIATELY** (you can't see it again!) + - Save as: `GITEA_TOKEN=your_token_here` + +3. **Add Bot User to Repository** + - Go to `devmatrix-scripts` repository + - **Settings** → **Collaborators** → **Add Collaborator** + - Username: `devmatrix-bot` + - Permission: **Write** (not Admin) + - Click **Add** + +4. **Test Access** + ```bash + # From DevMatrix VM (once it's running) + curl -H "Authorization: token YOUR_GITEA_TOKEN" \ + https://git.lemonlink.eu/api/v1/user + ``` + +--- + +## ✅ PHASE 2: TrueNAS Share Setup + +### Step 2.1: SSH into TrueNAS + +```bash +# From any machine on your network +ssh admin@192.168.5.195 + +# Switch to root +sudo -i +``` + +### Step 2.2: Run the Share Setup Script + +Copy and paste this entire script: + +```bash +#!/bin/bash +# TrueNAS Share Setup Script for DevMatrix + +set -e + +DATASET_NAME="NAS2" +SHARE_PREFIX="devmatrix" +NETWORK_ALLOW="192.168.5.0/24" + +echo "☁️ Setting up TrueNAS shares for DevMatrix..." + +# Create dataset structure +echo "📁 Creating datasets..." +if ! zfs list "$DATASET_NAME/$SHARE_PREFIX" >/dev/null 2>&1; then + zfs create "$DATASET_NAME/$SHARE_PREFIX" +fi + +for subdir in projects backups iso-archive shared; do + dataset_path="$DATASET_NAME/$SHARE_PREFIX/$subdir" + if ! zfs list "$dataset_path" >/dev/null 2>&1; then + zfs create "$dataset_path" + echo "✓ Created: $dataset_path" + fi +done + +# Set permissions +echo "🔐 Setting permissions..." +for subdir in projects backups iso-archive shared; do + mountpoint=$(zfs get -H -o value mountpoint "$DATASET_NAME/$SHARE_PREFIX/$subdir") + chown -R nobody:nogroup "$mountpoint" + chmod -R 777 "$mountpoint" +done + +# Create NFS shares +echo "🔗 Creating NFS shares..." +mountpoint_base=$(zfs get -H -o value mountpoint "$DATASET_NAME") + +for share in projects backups iso-archive shared; do + path="$mountpoint_base/$SHARE_PREFIX/$share" + if ! midclt call sharing.nfs.query "[[\"path\",\"=\",\"$path\"]]" | grep -q "$path"; then + midclt call sharing.nfs.create "{ + \"path\": \"$path\", + \"comment\": \"DevMatrix $share\", + \"hosts\": [\"$NETWORK_ALLOW\"], + \"ro\": false, + \"maproot_user\": \"root\", + \"maproot_group\": \"root\", + \"security\": [\"sys\"] + }" > /dev/null + echo "✓ NFS share: $share" + fi +done + +# Enable NFS service +if ! midclt call service.query "[[\"service\",\"=\",\"nfs\"]]" | grep -q '"state": "RUNNING"'; then + midclt call service.start "nfs" > /dev/null + midclt call service.update "nfs" '{"enable": true}' > /dev/null + echo "✓ NFS service enabled" +fi + +# Create SMB shares +echo "🖥️ Creating SMB shares..." +if ! midclt call service.query "[[\"service\",\"=\",\"cifs\"]]" | grep -q '"state": "RUNNING"'; then + midclt call service.start "cifs" > /dev/null + midclt call service.update "cifs" '{"enable": true}' > /dev/null +fi + +for share in projects backups shared; do + path="$mountpoint_base/$SHARE_PREFIX/$share" + if ! midclt call sharing.smb.query "[[\"path\",\"=\",\"$path\"]]" | grep -q "$path"; then + midclt call sharing.smb.create "{ + \"path\": \"$path\", + \"name\": \"devmatrix-$share\", + \"comment\": \"DevMatrix $share\", + \"browseable\": true, + \"readonly\": false, + \"guestok\": true + }" > /dev/null + echo "✓ SMB share: devmatrix-$share" + fi +done + +echo "" +echo "🎉 TrueNAS shares setup complete!" +echo "NFS: $mountpoint_base/$SHARE_PREFIX/{projects,backups,iso-archive,shared}" +echo "SMB: \\\\$(hostname)\\devmatrix-{projects,backups,shared}" +``` + +**After running, verify:** +```bash +# List datasets +zfs list | grep devmatrix + +# List NFS shares +midclt call sharing.nfs.query | grep path + +# List SMB shares +midclt call sharing.smb.query | grep name +``` + +--- + +## ✅ PHASE 3: Proxmox VM Creation + +### Step 3.1: Download Scripts from Gitea + +```bash +# SSH into Proxmox +ssh root@192.168.5.200 + +# Create directory +mkdir -p /root/devmatrix-setup +cd /root/devmatrix-setup + +# Download scripts from Gitea +wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_devmatrix_proxmox_custom.sh +wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_openclaw_dev.sh +wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_truenas.sh + +# Make executable +chmod +x *.sh +``` + +### Step 3.2: Run Proxmox Setup + +```bash +cd /root/devmatrix-setup +./setup_devmatrix_proxmox_custom.sh +``` + +**What this does:** +- ✅ Checks storage (pve-main2) +- ✅ Downloads Ubuntu ISO +- ✅ Creates VM 300 (32GB RAM, 16 cores, 400GB) +- ✅ Creates VM 301 (16GB RAM, 8 cores, 100GB) +- ✅ Creates VM 302 (8GB RAM, 4 cores, 50GB) +- ✅ Sets static IPs (210, 211, 212) +- ✅ Generates SSH keys + +--- + +## ✅ PHASE 4: Install Ubuntu on VM 300 + +### Step 4.1: Start VM and Install + +```bash +# On Proxmox +qm start 300 + +# Open console (via web UI or CLI) +qm console 300 +``` + +**Installation Steps:** +1. Select "Try or Install Ubuntu Server" +2. Language: English +3. Keyboard: Your layout +4. Network: ☑️ DHCP (will get 192.168.5.210) +5. Proxy: Leave blank +6. Mirror: Default (Ubuntu archive) +7. Storage: Use entire disk +8. Profile: + - Your name: `DevMatrix` + - Server name: `devmatrix` + - Username: `devmatrix` + - Password: [Choose strong password] + - ☑️ Import SSH key: Paste contents of `~/.ssh/devmatrix_id_rsa.pub` from Proxmox +9. Featured Server Snaps: None +10. Wait for install → Reboot + +### Step 4.2: Verify Network + +```bash +# After VM reboots, from Proxmox check IP +qm guest exec 300 -- ip addr show + +# Should show 192.168.5.210 +``` + +--- + +## ✅ PHASE 5: Setup Dev Environment (Inside VM 300) + +### Step 5.1: SSH and Run Setup + +```bash +# From Proxmox or your machine +ssh -i ~/.ssh/devmatrix_id_rsa devmatrix@192.168.5.210 + +# Download script from Gitea +wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_openclaw_dev.sh +chmod +x setup_openclaw_dev.sh + +# Run setup (takes 20-30 minutes) +./setup_openclaw_dev.sh +``` + +### Step 5.2: Configure TrueNAS Mounts + +```bash +# Still inside VM 300 +wget https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_truenas.sh +chmod +x setup_truenas.sh +./setup_truenas.sh + +# Verify mounts +ls -la /mnt/truenas/ +df -h | grep truenas +``` + +### Step 5.3: Configure API Keys (YOU DO THIS) + +```bash +# Inside VM 300 +~/scripts/configure_api_keys.sh + +# Enter when prompted: +# - Kimi API Key: [from kimi.moonshot.cn] +# - Antigravity API Key: [from your provider] +``` + +### Step 5.4: Configure Gitea Access + +```bash +# Inside VM 300, configure git +mkdir -p ~/.config/openclaw +cat > ~/.config/openclaw/gitea.conf << 'EOF' +GITEA_URL=https://git.lemonlink.eu +GITEA_USER=devmatrix-bot +GITEA_TOKEN=your_token_here +EOF +chmod 600 ~/.config/openclaw/gitea.conf + +# Test access +curl -H "Authorization: token your_token_here" \ + https://git.lemonlink.eu/api/v1/user +``` + +--- + +## ✅ PHASE 6: Install Windows on VM 301 + +### Step 6.1: Start and Install Windows + +```bash +# On Proxmox +qm start 301 +qm console 301 +``` + +**Installation:** +1. Standard Windows 11 LTSC IoT install +2. Network: Let it get IP (should be 192.168.5.211) +3. Account: Create `testuser` with password +4. Complete installation + +### Step 6.2: Run Windows Setup Script + +Inside Windows VM (as Administrator in PowerShell): + +```powershell +# Download script +Invoke-WebRequest -Uri "https://git.lemonlink.eu/impulsivefps/devmatrix-scripts/raw/main/setup_windows_vm.ps1" -OutFile "C:\Scripts\setup_windows_vm.ps1" + +# Run script +C:\Scripts\setup_windows_vm.ps1 +``` + +**Reboot when complete.** + +--- + +## ✅ PHASE 7: Verification & Testing + +### Step 7.1: Test VM Communication + +```bash +# From VM 300 (Ubuntu) +ping 192.168.5.211 # Windows VM +ping 192.168.5.195 # TrueNAS +ping 192.168.5.200 # Proxmox +ping git.lemonlink.eu # Gitea +``` + +### Step 7.2: Test TrueNAS Mounts + +```bash +# On VM 300 +echo "test" > /mnt/truenas/projects/test.txt +cat /mnt/truenas/projects/test.txt +rm /mnt/truenas/projects/test.txt +``` + +### Step 7.3: Test OpenClaw + +```bash +# On VM 300 +openclaw models list +openclaw status +``` + +### Step 7.4: Test Windows VM Control + +```bash +# On VM 300 +~/scripts/vm_control.sh win-start +# Wait 60 seconds +~/scripts/vm_control.sh win-status +~/scripts/vm_control.sh win-stop +``` + +--- + +## ✅ PHASE 8: Documentation & Backup + +### Step 8.1: Save Configuration + +```bash +# On Proxmox +cat > ~/devmatrix_config_summary.txt << 'EOF' +DevMatrix Configuration Summary +================================ +Date: $(date) + +PROXMOX +------- +IP: 192.168.5.200 +Storage HDD: pve-main2 +Storage NVMe: pve-main (future) + +VMS +--- +VM 300: OpenClaw-DevMatrix + - IP: 192.168.5.210 + - RAM: 32GB + - Disk: 400GB (200 OS + 200 data) + - User: devmatrix + +VM 301: Windows-LTSC-Test + - IP: 192.168.5.211 + - RAM: 16GB + - Disk: 100GB + - User: testuser + +VM 302: Android-Emulator + - IP: 192.168.5.212 + - RAM: 8GB + - Disk: 50GB + +TRUENAS +------- +IP: 192.168.5.195 +Dataset: NAS2/devmatrix +Shares: projects, backups, iso-archive, shared + +GITEA +----- +URL: https://git.lemonlink.eu +Bot User: devmatrix-bot +Repo: devmatrix-scripts + +ACCESS +------ +SSH Key: ~/.ssh/devmatrix_id_rsa +VS Code: http://192.168.5.210:8080 +EOF +``` + +### Step 8.2: Create VM Snapshots + +```bash +# On Proxmox +qm snapshot 300 clean-install +qm snapshot 301 clean-install +qm snapshot 302 clean-install +``` + +--- + +## 🎯 SUMMARY CHECKLIST + +Copy this and check off as you go: + +``` +□ PHASE 1: Gitea + □ Create repository: devmatrix-scripts + □ Upload all 5 scripts + □ Create user: devmatrix-bot + □ Generate API token + □ Add bot to repository + +□ PHASE 2: TrueNAS + □ SSH into TrueNAS + □ Run share setup script + □ Verify datasets created + □ Verify NFS/SMB shares + +□ PHASE 3: Proxmox + □ Download scripts from Gitea + □ Run setup_devmatrix_proxmox_custom.sh + □ Verify VMs created (300, 301, 302) + +□ PHASE 4: Ubuntu Install + □ Start VM 300 + □ Install Ubuntu 22.04 + □ Verify IP 192.168.5.210 + +□ PHASE 5: Dev Environment + □ SSH into VM 300 + □ Run setup_openclaw_dev.sh + □ Run setup_truenas.sh + □ Configure API keys + □ Configure Gitea access + +□ PHASE 6: Windows + □ Install Windows on VM 301 + □ Run setup_windows_vm.ps1 + □ Verify IP 192.168.5.211 + +□ PHASE 7: Testing + □ Test VM communication + □ Test TrueNAS mounts + □ Test OpenClaw + □ Test Windows control + +□ PHASE 8: Documentation + □ Save config summary + □ Create VM snapshots + □ Celebrate! 🎉 +``` + +--- + +## 🆘 TROUBLESHOOTING + +### Can't SSH to VM 300 +```bash +# From Proxmox +qm guest exec 300 -- systemctl status ssh +qm guest exec 300 -- ip addr show +``` + +### TrueNAS Mounts Fail +```bash +# On VM 300 +showmount -e 192.168.5.195 +sudo mount -a +``` + +### Windows VM Won't Start +```bash +# Check Proxmox logs +qm log 301 +qm status 301 +``` + +### OpenClaw Won't Start +```bash +# On VM 300 +openclaw status +openclaw logs +``` + +--- + +## 🚀 YOU'RE READY! + +Everything is prepared. Tomorrow just work through the checklist in order! + +**Estimated time:** 2-3 hours (mostly automated) + +**Questions?** Just ask - I'm here to help! 🦞