-1

I have a custom centos, where we made some changes, and I would like to create a LXC from that template. Is it possible ?

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
Hassan Wh
  • 97
  • 3
  • 13

1 Answers1

0

Possible? Yes. depending on the custom centos and if you need to run it privileged or not, it can get really complicated. The basics are easy though.

For lxc v1 , you just need to create config file for container in /var/lib/lxc or whatever your lxc path is and untar the rootfs somewhere lxc can access, set its path in config and try to run it.

It would be best if you first make a normal centos container, look where it has config,rootfs , what file permissions it has, network config and so on. Then you just try to mirror its config for your own image.

if it doesn't start right away , try starting in foreground (-F ) and/or look in logfile .

For lxd it is mostly the same, but you need to create the image and put it in your local repository. It is mostly covered in https://osso.nl/blog/lxc-create-image-debian-squeeze/