0

I am unable to create a Ubuntu container using lxc 1.0.0.apha1 version on Ubuntu 13.04 raring. Is there anything obvious that I am missing here

root@ubuntu:~# lxc-ls --fancy
NAME  STATE  IPV4  IPV6  AUTOSTART
----------------------------------

root@ubuntu:~# lxc-version
lxc version: 1.0.0.alpha1

root@ubuntu:~# lxc-create -t ubuntu -n u_1
getopt: unrecognized option '--rootfs=/usr/lib/x86_64-linux-gnu/lxc'
lxc-create: container creation template for u_1 failed

lxc-create: Error creating container u_1
root@ubuntu:~#

Installed lxc 1.0.0.aplha1 on Ubuntu 13.04 using the following command

root@ubuntu:~# apt-get install -y liblxc0/raring-backports python3-lxc/raring-backports lxc/raring-backports
Santhosh
  • 891
  • 3
  • 12
  • 31
  • Have you tried 13.10 by any chance ? Is it 13.04 related? – Rico Mar 29 '14 at 06:37
  • 1
    I concur with @rico — I wouldn't recommend 13.04. Use 12.04 LTS (it's LTS, so it's very well supported). If you need something bleeding edge, use 13.10, or better, 14.04 (which will very soon become the new stable LTS). – jpetazzo Apr 01 '14 at 22:43

3 Answers3

0

Alpha version is generally not stable. In last year LXC changed quite a lot, Ubuntu 14.04 ships with lxc 1.0.5, and this command should work:

$ lxc-create -t ubuntu -n u_1

(creates container from ubuntu template with name u_1 in directory /var/lib/lxc/u_1)

Tombart
  • 30,520
  • 16
  • 123
  • 136
0

I really like LXC but I don't like lxc-create. Depending on a script to generate a rootfs, seems wrong to me (script can fail, they must be maintained, etc.) Docker are building a huge database of root file systems, optimised for container usage, and they can be used with LXC. Checkout dlrootfs to avoid using lxc-create again.

rmonjo
  • 2,675
  • 5
  • 30
  • 37
0

Watching a Udemy tutorial on Ansible (I am linux newb) where it said to launch this command (--type ubuntu) (--name db1)

lxc-create -t ubuntu -n db1

Got this error:

lxc-create: db1: utils.c: get_template_path: 901 No such file or directory - bad template: Ubuntu
lxc-create: db1: lxccontainer.c: __lxcapi_create: 1798 Template "Ubuntu" not found
lxc-create: db1: tools/lxc_create.c: main: 317 Failed to create container db1

Fixed with this

sudo lxc-create -t download -n db1 -- -d ubuntu -r jammy -a amd64 

You can change the last 2 too fit your needs. I needed jammy and amd64.

My Ubuntu 22.04.2 (jammy) amd 64 is on VirtualBox. LXC version 5. Got idea from here ubuntu

Also installed lxd but in don't know if it was usefull

apt install lxd-installer
Bogdan
  • 321
  • 1
  • 6