I am installing a VM from a Debian12 iso (actually it is DebianEdu 12).
After this, I am trying to install incus-agent inside the VM.
I am using the script from this snippet:
which is based on these instructions (renaming lxd to incus):
The script: install-incus-agent-in-debian.sh
#!/bin/bash -x
# See: https://discuss.linuxcontainers.org/t/install-lxd-agent-manually-on-custom-os/11826
cat > /lib/systemd/system/incus-agent-9p.service << EOF
[Unit]
Description=Incus - agent - 9p mount
Documentation=https://linuxcontainers.org/incus
ConditionPathExists=/dev/virtio-ports/org.linuxcontainers.incus
After=local-fs.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/sbin/modprobe 9pnet_virtio
ExecStartPre=/bin/mkdir -p /run/incus_config/9p
ExecStartPre=/bin/chmod 0700 /run/incus_config/
ExecStart=/bin/mount -t 9p config /run/incus_config/9p -o access=0,trans=virtio
[Install]
WantedBy=multi-user.target
EOF
cat > /lib/systemd/system/incus-agent.service << EOF
[Unit]
Description=Incus - agent
Documentation=https://linuxcontainers.org/incus
ConditionPathExists=/dev/virtio-ports/org.linuxcontainers.incus
Requires=incus-agent-9p.service
After=incus-agent-9p.service
Before=cloud-init.target cloud-init.service cloud-init-local.service
DefaultDependencies=no
[Service]
Type=simple
WorkingDirectory=/run/incus_config/9p
ExecStart=/run/incus_config/9p/incus-agent
Restart=on-failure
RestartSec=5s
StartLimitInterval=60
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
EOF
systemctl enable incus-agent-9p.service
systemctl enable incus-agent.service
systemctl start incus-agent-9p.service
systemctl start incus-agent.service
For convenience, the script can also be downloaded with:
wget https://t.ly/EOxxX -O install-incus-agent.sh
The problem is that the service incus-agent fails to start (the service incus-agent-9p is running). When I try to execute manually the command: /run/incus_config/9p/incus-agent I get the error message:
bash: /run/incus_agent/incus-agent: Permission denied
# or
/run/incus_config/9p/incus-agent: 30: exec: /run/incus_agent/incus-agent: Permission denied
This is a different issue (I guess) from what is being discussed here, but maybe they are related. Anyway, I am not a systemd expert and need some help on fixing this.