Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

LXC strange ubuntu user provisioning

$
0
0
My google-foo is failing me and I can't seem to find documentation that explains what I'm doing wrong :/

I have a number of LXC/LXD containers running on an ubuntu 16.04 server.
I try to script creating new containers with something like the following:

Code:

#!/bin/bash


set -ex


lxc launch 'ubuntu:16.04' awesomelxc
lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu

Running this script gives:

Code:

+ lxc launch ubuntu:16.04 awesomelxc
Creating awesomelxc
Starting awesomelxc
+ lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu
groupmod: group 'ubuntu' does not exist

How ever the group exists after the script finishes and I can run the following:

Code:

lxc exec --mode=non-interactive awesomelxc -- groupmod -n awesomegrp ubuntu
If I do a groupadd instead of groupmod in my script then the awesomelxc group is added, but so is ubuntu, only at the next available GID.

What gives? When are the ubuntu group and ubuntu user provisioned? And why can I not script both the lxc launch and the lxc exec commands in the same script?

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>