[SOLVED] Services not starting with LXC? (custom images)

Nov 4, 2014
24
2
3
I was looking for an easy way to create custom LXC images, and I found one: LXD + export.

The problem I am having is that services are not starting when I start the container, at least that's what it seems like to me.

I tried to do the following:
  1. 1. Used LCD on local machine and created a Xenial image.
  2. 2. Entered bash in the container, installed a package and added a user.
  3. 3. Used LXD image export to create a tarball.
  4. 4. Unpacked the rootfs from the tarball, and made it a tarball.

What I'm left with then is a tarball that should be usable, but when I try to use it the following happens:
  1. 1. Importing and creation of container works.
  2. 2. I can enter it by using pct enter command, but not with SSH or the web console.
  3. 3. ifconfig returns nothing.

Conclusion: Services seems to not be starting(?)

Services shown in top in the container when using pct enter:
  • init
  • plymouthd
  • plymouth-upstar
  • mountall
  • bash
Using: service networking start and service ssh start I get network and SSH, and both are working.

According to the awesome Stéphane Graber, this is a way to create custom LXC images that should function like normal images.

Is this a known problem? Is it possible to fix?
 
  • Like
Reactions: fireon
Uhm, well by reading this now I realize I really screwed up and somehow manged to remove systemd and replace it with sysvinit.

*Embarrassed*:rolleyes:

The method seems to be somewhat working, but the old IP sticks.
 
Last edited: