LXC in Slackware
Following directions from: lxc for Slackware
14.2. I haven’t tested on Slackware 15 yet. You will have to set this up
while running as root
.
Create the file
'/etc/default/lxc-net'
and add the lineUSE_LXC_BRIDGE="true"
to it.Create the directory
'/var/lib/misc'
Start the service:
# /usr/libexec/lxc/lxc-net start
Create a config file:
# cat >slac-xlc.con <<“EOF”
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
EOF
- Create the container:
# arch=x86_64 release=14.2 MIRROR=http://mirrors.us.kernel.org/slackware lxc-create -n Slackware64-14.2 -t slackware -f slack-xlc.conf
- Start the container for the first time:
# lxc-start -n Slackware64-14.2
- Login to the container:
# lxc-console -n Slackware64-14.2
or
# lxc-attach -n Slackware64-14.2
The difference between these two methods is that using the first you will require a username and password (root and root, in this case) and with the latter you won’t.
The first thing you will need to do is set up the container to connect to the network. Edit
'/etc/rc.d/rc.inet1.conf'
and update theUSE_DHCP
entry for'eth0'
toUSE_DHCP[0]="yes"
.Restart the container and verify connectivity.
# lxc-stop -n Slackware64-14.2 && lxc-start -n Slackware64-14.2
- Login to the container and use ‘ping’ to verify connectivity.
Tags: slackware, lxc, containers, motd