To assist others who may struggle with setup, I’ve documented my experience transitioning from a Docker-based configuration to a more stable manual installation of Debian 12 in an LXC container for use with a Coral TPU. The previous method using Proxmox, LXC, Docker, and Codeproject was unreliable and had a lengthy boot process, which was not ideal for AI detection tasks with Blue Iris. Here are the steps I followed for a successful setup.
Installation Steps
Proxmox Host Configuration
-
Create the Container’s Root Group:
groupadd -g 100000 Codeproject
-
Set Up Udev Rules for Coral TPU:
Create a file named60-coraltpu.rules
in/etc/udev/rules.d/
and add the following lines:SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9302", GROUP="100000" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", GROUP="100000"
LXC Container Creation
- Create an Unprivileged LXC Container:
- Use Debian 12 with 4 CPU cores and 4 GB RAM (initially required for installation; resources can be adjusted later).
- Configure Networking as Needed.
Identify the Coral TPU Device
- On the Proxmox host, run:
This command will help identify the bus number of your Coral device (e.g.,lsusb
Bus 004 Device 002: ID 18d1:9302 Google Inc.
).
Modify LXC Configuration
- Edit the LXC configuration file to include the USB device:
Add these lines, replacingnano /etc/pve/lxc/<lxcid>.conf
<BUS_ID>
with your actual bus ID:usb0: host=1a6e:089a,usb4=1 # coral ID pre-load usb1: host=18d1:9302,usb4=1 # coral ID post-load lxc.mount.entry: /dev/bus/usb/<BUS_ID> dev/bus/usb/<BUS_ID> none bind,optional,create=dir
Inside the Container
-
Enable SSH Access:
Modify the SSH configuration to allow root login:sed -i /"^PermitRootLogin.*$"/d /etc/ssh/sshd_config echo "PermitRootLogin yes" >> /etc/ssh/sshd_config systemctl restart sshd
-
Retrieve the Container’s IP Address:
ip -c -4 -brief address show
-
Install Required Packages:
Download and install Microsoft package repository:wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb apt update && apt upgrade apt install unzip dotnet-sdk-7.0 sudo psmisc curl xz-utils jq
-
Install Codeproject AI Server:
Download and unpack the Codeproject AI server:wget https://www.codeproject.com/KB/Articles/5322557/codeproject.ai-server_2.6.5_Ubuntu_x64.zip unzip codeproject.ai-server_2.6.5_Ubuntu_x64.zip rm codeproject.ai-server_2.6.5_Ubuntu_x64.zip dpkg -i codeproject.ai-server_2.6.5_Ubuntu_x64.deb rm codeproject.ai-server_2.6.5_Ubuntu_x64.deb pushd "/usr/bin/codeproject.ai-server-2.6.5/" && bash start.sh && popd cd /usr/bin/codeproject.ai-server-2.6.5 && bash start.sh
-
Monitor Installation Logs:
Check logs in your browser until installation completes; you may need to terminate the process in your SSH session once it appears stalled. -
Install Coral Module:
Navigate to the module directory and run the setup script:cd /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral && sudo bash ../../setup.sh
-
Enable Services:
Enable the Codeproject AI server service:systemctl enable codeproject.ai-server
-
Set Coral Module to Autostart:
Editmodulesettings.json
to set autostart value to true:nano /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral/modulesettings.json
-
Reboot and Test:
After rebooting, you should experience no disconnection issues that were present with Docker.
Performance Outcome
With this setup, I achieved a response time of approximately 29ms for detecting tiny objects, demonstrating significant improvement over previous configurations that utilized Docker.
This streamlined approach not only enhances reliability but also reduces latency issues associated with Docker setups, making it an effective solution for AI detection tasks using Coral TPUs in Proxmox environments.