Newbie - LXC usage

Hi all,

Im new with LXC and I have the following question, Inside a LXC I would like to install some applications , but I would like to have access to this application from my linux host, with out the need to access the lxc, is this is posible?

thanks all.

I guess it depends what you mean by “without access”. You can install a piece of software “blah” in container c1 and then run it from the host with “lxc-attach -n c1 blah” (or “lxc exec c1 blah” if using LXD).

If you don’t want to attach to the container at all, then you could attempt to run the binary directly from the container’s filesystem, but that’s very unlikely to work as needed libraries and other files won’t resolve on the host’s filesystem.

Can you give a more concrete example of an application you may want to run in a container and describe how exactly you want to access it? You’d get a more concrete answer likewise I guess

  • from your LXC/LXD host or over your local (or even world wide) network?
  • is your host a headless server or does it come with a Desktop?
  • is the app a web application or a Desktop application like Libreoffice or gimp?

Hi all, sorry for the delay, what I want to do is to install Ansible for automation in a lxc and with I will try to secure my playbooks so the customer will not be able to change or read them, but the idea is that they can execute the scripts inside my lxc.

thanks all!