Practical use of LXC in Arch Linux in March of 2013

I’m writing this for myself in hopes that it benefits somebody else. The guides that I’ve found on LXC have been either unholy scatterbrained or just out of date.

Starting from scratch.

If you’re fairly new to arch as I am, keep in mind that if you hit your head on anything especially involving networking, reboot your system.  You may have had a system upgrade and had not yet rebooted.

Do not expect to understand LXC before you’ve thoroughly read this man page. . It’s short.

Get the stuff you need


pacman -Syy lxc bridge-utils

Set up your bridge


Edit /etc/network.d/bridge as



Now issue these commands

systemctl disable dhcpcd@eth0 # For boot time
systemctl stop dhcpcd@eth0  # For right now
systemctl enable netcfg@br0 # for boot time
systemctl start netcfg@br0 # for right now
systemctl enable dhcpcd@br0 # for boot time
systemctl start dhcpcd@br0 # for right now

For whatever reason this ^ isn’t working on startup for me.  I’ll revisit this.

Install a Debian Container

Get debootstrap

Get Yaourt


You need yaourt to install debootstrap


Follow the steps in this section here:


debootstrap lets you install a fresh debian system to a directory


yaourt -S debootstrap

Fix the create script

The create script doesn’t work.  Edit /usr/share/lxc/templates/lxc-debian to change



arch=’amd64′  # or whatever your architecture may be.

Now make it.

lxc-create -t debian -n mysupercoolcontainer

Wait! Stuff is still broke!

You can’t start your container until you weirdly remount your /, (per these comments

mount / –make-rprivate # Don’t sue me, I haven’t researched what this is, it might break everything.

Now start your container

lxc-start -n mysupercoolcontainer -d # -d makes it run as a daemon instead of forcing a console on your terminal.

Get in there

lxc-console -n mysupercoolcontainer # You’re in, you know what to do.


About andyortlieb

I often find myself figuring out some niche oddities, only to find myself stuck on those same problems a year later due to my wide yet thin activity in certain topics related to my career and hobbies. This blog is where I document these nuances (or nuisances) to ease my pain the second time around, and hopefully that of some other fellow desperate internet scouts.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s