I installed incus on a debian 12 virtual machine. After that I lauched a new container
incus launch images:debian/12 mydebian
I can enter the container and run commands and all seems to work normally.
incus exec mydebian /bin/bash
– ran some apt-get commands to setup apache2/php –
– wget in the container works to interact with apache2/php –
** exited back to the host
The apache2 service in the container is setup to listen/serve on port 5000. I tried to map the port between the host and container with the below command
incus config device add mydebian port-8012 proxy listen=tcp:0.0.0.0:8012 connect=tcp:127.0.0.1:5000
this add command returns the following error:
Error: Failed to start device “port-8012”: Failed to start device “port-8012”: Please look in /var/log/incus/mydebian/proxy.port-8012.log
when I cat /var/log/incus/mydebian/proxy.port-8012.log it is empty
If I stop the container, it will add the device but then the container won’t start
incus stop mydebian
incus config device add mydebian port-8012 proxy listen=tcp:0.0.0.0:8012 connect=tcp:127.0.0.1:5000
Command Response:
Device port-8012 added to mydebian
then when I try to start the container again. It will not start.
incus start mydebian
Command Response:
Error: Failed to start device “port-8012”: Please look in /var/log/incus/mydebian/proxy.port-8012.log
Tryincus info --show-log mydebian
for more info
again, checking /var/log/incus/mydebian/proxy.port-8012.log the file is empty
running the command:
incus info --show-log mydebian
Command Response:
Name: mydebian
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2024/06/21 09:33 UTC
Last Used: 2024/08/08 14:54 UTCLog:
I am not sure what to check or do from this point since it seems the container works without the port mapping. The logs are empty/blank after adding the device/port.
What should I do next to get connectivity between the host/container through a mapped port?