# lxc connection plugin - sudo first?

**URL:** <https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215>\
**Category:** Ansible Project\
**Created:** [April 7, 2018, 12:28pm UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215 "2018-04-07T12:28:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Hector](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@Richard\_Hector](https://forum.ansible.com/u/Richard_Hector)\
**Post date:** [April 7, 2018, 12:28pm UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215/1 "2018-04-07T12:28:41Z")

</div>

Hi all,

I'm trying to use the lxc connection plugin, but it says that my  
container isn't running. Presumably that's because ansible isn't running  
as root. Is there a way to tell it to sudo before connecting?

I'm aware of course of how to sudo \_afterwards\_, ie on the target  
system, to do anything useful, but I need to connect first.

I need to do this to set up the container for ssh, so I can continue  
with that later.

Thanks,

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Hector](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@Richard\_Hector](https://forum.ansible.com/u/Richard_Hector)\
**Post date:** [April 10, 2018, 9:47am UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215/2 "2018-04-10T09:47:53Z")

</div>

I can't see how to use this at all without being root.

Is it considered acceptable to email the plugin author directly?

Thanks,  
Richard

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 10, 2018, 9:57am UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215/3 "2018-04-10T09:57:34Z")

</div>

> I can't see how to use this at all without being root.

Add your user to the lxd group (your distro might use another group name for access)

---

<div class="post-metadata">

**Author:** ![Richard\_Hector](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@Richard\_Hector](https://forum.ansible.com/u/Richard_Hector)\
**Post date:** [April 10, 2018, 10:23am UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215/4 "2018-04-10T10:23:52Z")

</div>

> > I can't see how to use this at all without being root.
> 
> Add your user to the lxd group (your distro might use another group name  
> for access)

I have no lxd group; I'm not using lxd. Lxc only. Perhaps this plugin  
actually requires lxd? I suspect not, though; there's also an lxd plugin.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 10, 2018, 10:46am UTC](https://forum.ansible.com/t/lxc-connection-plugin-sudo-first/27215/5 "2018-04-10T10:46:41Z")

</div>

> > > I can't see how to use this at all without being root.
> > 
> > Add your user to the lxd group (your distro might use another group name  
> > for access)
> 
> I have no lxd group; I'm not using lxd. Lxc only. Perhaps this plugin  
> actually requires lxd? I suspect not, though; there's also an lxd plugin.

Ah I see, I'm preoccupied by lxd at the moment so they have come synonyms.
