2

My linux host is ubuntu 14.04 x64. I tried to create a centos lxc container

sudo lxc-create -n centos -t centos

but return errors

Host CPE ID from /etc/os-release:
'yum' command is missing
lxc_container: container creation template for centos failed
lxc_container: Error creating container centos
Adrian
  • 45
  • 1
  • 2
  • 6

2 Answers2

3

Yum is the package manager used in Centos. I don't know why it is needed to create the container before the container is started. It certainly would be used inside the container after it is running Centos.

In any case, I was able to create a Centos container on an Ubuntu 14.04 host by installing yum on the host. It is available in the Ubuntu repositories. Do:

apt-get install yum

on your Ubuntu host. Then you can run lxc-create. I had no problems with it after installing yum.

Grunthos
  • 339
  • 1
  • 6
0

When you build containers with root user (you are using sudo) you need the tools that are used for the container, outside, in the host for BUILD the base distro container. so you need install yum in your Ubuntu server (and if you use lxc in a Fedora distro, you will need debootstrap for build an Ubuntu container...)

But, when you build unprivileged containers with your user (without sudo) the images for containers are more simple and download a package, but remember, ONLY for unprivileged containers.

Yonsy Solis
  • 284
  • 1
  • 9