Asterisk with LXC Container
Virtualization gives customers the possiblity to execute their own applications. Usage of containers allows to isolate the applications and the entire OS images from the other processes which are running on a host system.
This tutorial shows how to get started with the Soft-PBX Astrisk within a LXC container.
Prerequisites
Resources
You can find an example of Asterisk LXC Container here:
Configuration
Download the container
Open
GUI and go to System → Virtualization
Click “+” to add container
By settings, choose type, create a description and select storage. Root file system will be set automatically
If you want to enable networking, go to “Networking”, select routed or bridged by the Network Interface and press Apply
You should see a following screen (if you chose extended storage, the path will have storage1 instead of storage0:
/mnt/storage1/lxc/guest0
)
Transfer the downloader container (you can use WinSCP) to the router and put in /mnt/storage0/lxc
Unpack the container:
tar –xvf jessie.tar –C ./guest0
Check access rights using
ls –l
If the created folder has rights 644, change them* to 755:
chmod 755 -R guest0
The extracted container contains rootfs directory. You need to copy the content of it to the specified root file system. Go to jessie folder:
cd guest0/lxc/jessie
-
Information about container can be accesed by typing
lxc-info –n guest0
Now you can attach to the container by typing
lxc-attach –n guest0