How do I access my LXD storage without SSH?

My goal is to run a local instance of Launchpad on LXD. I have created a container as follows, but cannot SSH onto that container:

$ lxc launch ubuntu:16.04 lpdev -p default -p $USER
$ ssh -A $USER@
user@ Permission denied (publickey).

From the instructions:

In order to be able to ssh into the container, you need to add your public key to your local .ssh/authorized_keys configuration. Also make sure that both .ssh (700) and authorized_keys (600) have the correct permissions.

I assume this means I need to add my HOST public key to the CONTAINER authorized_keys. But how do I access that container location? (Clearly not with SSH!)

FWIW I have not mounted host $HOME as container $HOME:

    type: disk
    source: $HOME/Documents
    path: $HOME/Documents

I suspect that I should be doing something like this instead?

    type: disk
    source: $HOME/Documents/lxd
    path: $HOME

…and then I would be modifying $HOME/Documents/lxd/.ssh/authorized_keys, which the container would interpret as $HOME/.ssh/authorized_keys ?

In this case, your best bet is to:

  • lxc profile create launchpad
  • lxc profile edit launchpad

And then in the profile set user.user-data to a valid chunk of cloud-init data.
Something kinda like:

  - name: ubuntu
      - lp:your-username

Then you can lxc launch ubuntu:16.04 lpdev -p default -p launchpad

Or I guess put your cloud-init config in your $USER profile for the same effect.

If you just want to do it manually, then run lxc exec lpdev bash to get a shell and do what you want in the container.

Great! I just discovered lxc exec .. bash in the LXD docs, but now I understand the profile boilerplate from the Launchpad docs a bit better! Thanks!