-

   eugene20237

 - e-mail

 
(0)

LXD-?

, 11 2019 . 22:14 +
... :
"... :
lxc network attach bob-br container-bob eth0
lxc config device set container-bob eth0 ipv4.address 10.0.2.2"
: https://codex.so/first-lxc-container

:  
(0)

LINUX: LXD

, 26 2017 . 23:45 +
LXD - OpenVZ. :

(Stéphane Graber). , - !

: https://habrahabr.ru/company/selectel/blog/308208/
: https://linuxcontainers.org/lxd/getting-started-cli/
: https://github.com/lxc/lxd/blob/master/doc/storage-backends.md
: https://s3hh.wordpress.com/2016/05/08/using-lxd-snapshots/
(): http://vasilisc.com/lxd-2-0-series
: https://help.ubuntu.com/lts/serverguide/lxd.html
: https://github.com/lxc/lxd/blob/master/doc/configuration.md
: http://vasilisc.com/network-management-lxd-2-3
: https://bayton.org/2016/05/lxd-zfs-and-bridged-networking-on-ubuntu-16-04-lts/
: https://bitsandslices.wordpress.com/2015/08/26/autostarting-lxd-containers/
: http://askubuntu.com/questions/749063/reach-lxd-container-from-local-network
: https://github.com/lxc/lxd/issues/1363
lxd-port-forward: https://dev.justinjudd.org/justin/lxd-port-forward
uPnP: http://bartsimons.me/lxc-lxd-port-forwarding-containers-using-upnp/

, LXD. LXD Ubuntu 16.04.

0. lxd ! lxd.
apt-get install software-properties-common
add-apt-repository ppa:ubuntu-lxc/lxd-stable
apt-get update
apt-get dist-upgrade
apt-get install lxd


1. lxd system.d, init.d. - shutdown -h now . :

update-rc.d -f lxd remove
rm -f /etc/init.d/lxd
systemctl enable lxd.service
systemctl enable lxd-containers.service


2. . /usr/lib/lxd/lxd-bridge.start - LXD. , 3.

3. . uPnP. :

lxc config set _ boot.autostart 0

:
systemctl disable linux-igd.service
update-rc.d -f linux-igd remove


/etc/rc.local:

sleep 5
systemctl start linux-igd.service
lxc start _
sleep 30
lxc exec cpa -- upnpc -a 10.10.128.2 8888 8888 tcp


, uPnP (linux-igd), . 30 8888 ( - , - ). 10.10.128.2 - LXD.

4. If you dont want hard memory limit enforcement:
lxc config set my-container limits.memory.enforce soft

5. Increasing file and inode limits
Since its entirely possible we may in the future wish to run multiple LXD containers, its a good idea to already increase the number of open files and inode limits, this will prevent the dreaded too many open files errors which commonly occur with container solutions.

For the inode limits, open the /etc/sysctl.conf and add the following lines, as recommended by the LXD project:

fs.inotify.max_queued_events = 1048576
fs.inotify.max_user_instances = 1048576
fs.inotify.max_user_watches = 1048576


6. IP :
lxc network device add template-yakkety eth0 nic nictype=bridged parent=lxdbr0 name=eth0
cat | lxc config set template-yakkety raw.lxc - << EOF
lxc.network.0.ipv4 = 144.217.33.2/24
lxc.network.0.ipv4.gateway = 144.217.33.1
EOF

template-yakkety - .
, !
, :
"The recommendation is that you configure the distribution in the container to have a static IP.
On Ubuntu/Debian, that's done through /etc/network/interfaces
LXC does support setting those for you from outside the container, but most distributions will then fail to boot or will just unset that preset data."

7. :
lxc config set _ security.privileged true
- .

:  

 : [1]