Incus Container to run hermes-agent
Published on
Last updated on
Technical
AI Incus
install packages
Just follow the official document to install incus
apt install incus incus-baseconfig nftables rules
-
one
inettable with 2 chainpostroutingfor natinputto allow port53for dns to incus containers/VMs, port67for DHCPv4 to assign containers/VMs ip address
#!/usr/sbin/nft -fflush rulesettable inet filter {chain postrouting {type nat hook postrouting priority 100;oifname "eth0" masquerade}chain input {udp dport 53 acceptudp dport 67 accept}}
Configure sysctl
sysctl net.ipv4.conf.all.forwarding=1and add to /etc/sysctl.d/10-incus-inotify.conf for persistence
net.ipv4.conf.all.forwarding=1Initial containers
-
create container
Terminal window incus launch images:debian/13 hermes-agentincus list -
add share folder between host and container
incus config device add code-agent data-reports disk source=/home/user/reports path=/data/reports shift=truecode-agent, the name of the container.data-reports, the name of the shared folder. This is only visible from the host, and it’s just any name. We need a name so that we can specify the device when we want to perform further management. disk, this is a disk device. Currently, Incus supports 12 types of devices.source=/home/user/reports, the absolute path to the source folder. We type source= and then source folder, no spaces in between. The source folder (which is on the host) must already exist.path=/data/reports, the absolute path to the folder in the container.shift=true, the setting that automagically performs the necessary UID/GID translation.
-
other config for the container
incus exec hermes-agent -- /bin/bash
## enter into the containerroot@hermes-agent:~# apt install openssh-server vim git curl xz-utils
## other packages or configurations ....add user
useradd -m -d /data/hermes -s /bin/bash hermespasswd hermes# add user to /etc/sudoershermes### install hermes-agent inside container
- Install hermes agent```shcurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash- config model
- config wexin
Terminal window cd .hermes/hermes-agentsource venv/bin/activateuv pip install pippip install aiohttp cryptography qrcodehermes gateway setup## choose wexin or whatsapp or discord or telegram to config