Adding default remote


(Leonid Rebeja) #1

Hello.

I want to create image server.
I added remote using ~/.config/lxc/config.yml
I created a script for generating config.yml with remote I need before installing lxd.
This way user doesn’t need to configure remotes with lxc remote add.
I can see my remote using lxc remote list.
But when I connect to remote I get a error:

Error: Get https://public_ip:8443/1.0: x509: certificate is valid for private_ip, not public_ip

When I use lxc remote add command everything works fine. But for me better to use config.yml.
Is there any way to solve this problem?

Thanks.

Client:
lxd 3.0.0

Remote
lxd 2.0.11


(Stéphane Graber) #2

That’s because you’re missing the matching server certificate in ~/.config/lxc/servercerts


(Leonid Rebeja) #3

Thank you it worked.
I have another question.
How to create remote like “ubuntu” remote?
For example, if I’m going to use the method with config.yml I need to have certificate always in sync in case if remote change the certificate.
But how I understand it’s not the case when you use “ubuntu” remote.


(Stéphane Graber) #4

Our public remotes (ubuntu, ubuntu-daily and images) all use valid TLS certificates so don’t need a copy of the certificate in servercerts.


(Leonid Rebeja) #5

Thanks.
I also fund how I can setup similar configuration (https://github.com/lxc/lxd/issues/1581)