lxc-create should provide you with a default config file if not specified one

Bug #823862 reported by Marc Cluet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

lxc-create fails silently if no config file is specified, and finding a sane one is not an easy task.

It would be extremely useful if lxc-create or a wrapper script could provide a default sane config.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to submit this bug.

It would be nice if we could provide a default config, but we can't do that until we guarantee that we have a known network setup. Since wireless cannot be bridged and we haven't decided whether we are willing to depend on libvirt-bin, this would have to mean:
   1. create bridge lxcbr0
   2. set up NAT from lxcbr0 to default route
   3. choose a private subnet and run dnsmasq on lxcbr0

Note lxc-create does not fail silently - it actually produces a loud warning, provides two sample config files, and demands input before continuing. Witness:

root@sergelap:/sys/fs/cgroup/cpu# lxc-create -t ubuntu -n n1

Warning:
-------
Usually the template option is called with a configuration
file option too, mostly to configure the network.
eg. lxc-create -n foo -f lxc.conf -t debian
The configuration file is often:

lxc.network.type=macvlan
lxc.network.link=eth0
lxc.network.flags=up

or alternatively:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

For more information look at lxc.conf (5)

At this point, I assume you know what you do.
Press <enter> to continue ...

Note also that sample configurations are offered with the package.

I'm going to mark this low priority, rather than wishlist, because I do believe such a default would help tremendously with adoption by new users.

Changed in lxc (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Actually, based on the usability improvement, I marked it medium.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu4

---------------
lxc (0.7.5-3ubuntu4) precise; urgency=low

  * add a default bridge for lxc to use. (LP: #801002)
  * Add debian/lxc.conf, which gets installed as /etc/lxc/lxc.conf as a
    sample, usable, default config. (LP: #823862)
  * Add precise to the list of distros
  * Add -updates and -security to /etc/apt/sources.list after debootstrap
    for container creation (LP: #820715)
 -- Serge Hallyn <email address hidden> Thu, 10 Nov 2011 16:00:44 -0600

Changed in lxc (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.