2014-10-18 34 views
6

我想在lxc 1.0.5和Ubuntu 14.04中创建一个没有“rootfs”的容器。如何创建没有rootfs的LXC容器

我之前在lxc的早期版本中做过。在以前的版本中,如果我们使用不带“-t”选项的lxc-create,它将创建一个没有“rootfs”的容器。

,所以我尝试:

lxc-create -n foo 

,我得到这个错误:

lxc_container: Error creating container foo 

我读新LXC-创建手册页。新manpage说:

 
     -t template 
       'template' is the short name of an existing 'lxc-template' 
       script that is called by lxc-create, eg. busybox, debian, 
       fedora, ubuntu or sshd. Refer to the examples in 
       /usr/local/share/lxc/templates for details of the expected 
       script structure. Alternatively, the full path to an 
       executable template script can also be passed as a parameter. 
       "none" can be used to force lxc-create to skip rootfs 
       creation. 

我试试吧:

lxc-create -n foo -t none 

,我再次得到错误:

lxc_container: No such file or directory - bad template: none 
lxc_container: bad template: none 
lxc_container: Error creating container foo 

我到底做错了什么?

回答

11

当现实发生变化时,你难道不讨厌它吗?但是文档没有?

尝试使用-t/bin/true