Incus Container to run hermes-agent

Published on
Last updated on
Technical
AI

Incus

install packages

Just follow the official document to install incus

Terminal window
apt install incus incus-base

config nftables rules

  • one inet table with 2 chain

    • postrouting for nat
    • input to allow port 53 for dns to incus containers/VMs, port 67 for DHCPv4 to assign containers/VMs ip address
    #!/usr/sbin/nft -f
    flush ruleset
    table inet filter {
    chain postrouting {
    type nat hook postrouting priority 100;
    oifname "eth0" masquerade
    }
    chain input {
    udp dport 53 accept
    udp dport 67 accept
    }
    }

Configure sysctl

Terminal window
sysctl net.ipv4.conf.all.forwarding=1

and add to /etc/sysctl.d/10-incus-inotify.conf for persistence

Terminal window
net.ipv4.conf.all.forwarding=1

Initial containers

  • create container
    Terminal window
    incus launch images:debian/13 hermes-agent
    incus list
  • other config for the container
Terminal window
incus exec hermes-agent -- /bin/bash
## enter into the container
root@hermes-agent:~# apt install openssh-server vim git curl xz-utils
## other packages or configurations ....

add user

Terminal window
useradd -m -d /data/hermes -s /bin/bash hermes
passwd hermes
# add user to /etc/sudoers
hermes
### install hermes-agent inside container
- Install hermes agent
```sh
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
  • config model
  • config wexin
    Terminal window
    cd .hermes/hermes-agent
    source venv/bin/activate
    uv pip install pip
    pip install aiohttp cryptography qrcode
    hermes gateway setup
    ## choose wexin or whatsapp or discord or telegram to config
Back to Blog