Prepare configuration
Code:
gedit /usr/local/lib/lxc/templates/lxc-fedora
Navigate to line 230. In the function copy_configuration is a cat to the config file, and a cat to the fstab file of the container. The fstab's EOF file is missing, so the script itself gets into the fstab.
To correct this, simply write EOF to line 230.
Code:
cat <<EOF > $config_path/fstab
+proc $rootfs_path/proc proc nodev,noexec,nosuid 0 0
+devpts $rootfs_path/dev/pts devpts defaults 0 0
+sysfs $rootfs_path/sys sysfs defaults 0 0
EOF
If already here, at line 112, add the releasever variable, which is missing.
Code:
YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck --releasever=$release"
About /etc/rc.sysinit and /etc/rc.d/rc.sysinit ... these are not part of the default fedora install any more, but the script refers to them on line 68.
On line 113 to the PKG_LIST variable for yum, add initscripts legacy, and whatever is appropriate: mc openssh-server ...
Save that lxc-template, or save as /root/lxc-fedora
To fix a configuration path error, link /var/lib/lxc to /usr/local/var/lib/lxc
Code:
cd /usr/local
mkdir var
cd var
mkdir lib
cd lib
ln -s /var/lib/lxc
Container Installation from scratch.
Execute, the saved fedora-lxc template. X marks the release. Eg 14 for Fedora 14. fcX will be the name of the container.
Code:
./lxc-fedora -R X -n fcX
/var/lib/lxc/... is the default location of the containers.