I found this: Running virtual machines with LXD 4.0 - #113 by tomp
It seems that the option boot.priority=2
makes things better:
lxc config device add VM-name cdrom \
disk source=/home/user/pathtoiso/isoname.iso boot.priority=2
But still, the text installer of Debian does not seem to work.
The graphical installer seems to work correctly.