Send trust password to lxd-p2c command

Hi, I am converting a huge number of VMS into LXD containers, I am using the shell :

printf 'y\PASSWORD\n' | /root/lxd-p2c https://DST_SERVERIP:8443 DST_CONTAINERNAME /

and it shows me Error: inappropriate ioctl for device all the time.
Is there are any way to send the password into the lxd-p2c command?


What you could do is use a certificate which is already trusted by LXD and put that in ~/.config/lxc/client.crt and ~/.config/lxc/client.key on the systems you’re migrating, then lxd-p2c won’t be asking for a password at all.

Thank you for your reply, but I generated a TLS cert and trusted by LXD:

But the lxd-p2c still asking for the password, is there are any requirements for the cert?

This is odd, maybe I misread the code of lxd-p2c but this should have worked…
Can you run strace -o out -f lxd-p2c URL testvm /, let it fail in that same way and then do grep client out to see if it ever looks for that client certificate somewhere?

:thinking: Only getting this result:

root@workstation:~# grep client out
1025014 write(1, "Generating a temporary client ce"..., 69) = 69

Any idea? I’m sorry to bother you again because I’m in a hurry to use this feature to migrate workloads.