Changes

Jump to: navigation, search

LXD

6,543 bytes removed, 4 months ago
Network Troubleshooting
<languages/>
{{Subpages|GPU Acceleration,GPU Acceleration (NVIDIA),What are subuids and subgids?,Administration Tutorial,Features and Concepts}}
<translate>
== Introduction == <!--T:1-->
Do you want to configure a new storage pool? (yes/no) [default=yes]: ##i##↵
Name of the new storage pool [default=default]: ##i##↵
Name of the storage backend to use (btrfs, dir, lvm) [default=btrfs]: ##i##dir↵dir ↵
Would you like to connect to a MAAS server? (yes/no) [default=no]: ##i##↵
Would you like to create a new local network bridge? (yes/no) [default=yes]: ##i##↵
What should the new bridge be called? [default=lxdbr0]: ##i##↵
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: ##i##↵
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: ##i##none↵none ↵
Would you like LXD to be available over the network? (yes/no) [default=no]: ##i##↵
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] ##i##↵
<!--T:16-->
As you can see, we chose all the default ''except'' for:;storage pool: We opted for using a directory-based container storage rather than [[Special:MyLanguage/btrfs|btrfs]] volumes. Directory-based may be the default option during LXD configuration -- it depends if you have btrfs-tools installedor not.;IPv6 address: It is recommended you turn this off unless you are specifically wanting to play with IPv6 in your containers. It may cause {{c|dhcpcd }} in your container to only retrieve an IPv6 address if you leave it enabled. This is great if you have IPv6 working -- otherwise, you'll get a dud IPv6 address and no IPv4 address, and thus no network.
{{Warning|As explained above, turn off IPv6 NAT in LXD unless you specifically intend to use it!It can confuse {{c|dhcpcd}}.}}
Now, we should be able to run {{c|lxc image list}} and get a response from the LXD daemon:
<translate>
=== First Containeer Container === <!--T:24-->
<!--T:25-->
# ##i##lxc list
+---------------+---------+------+-----------------------------------------------+------------+-----------+
{{!}} NAME {{!}} STATE {{!}} IPV4 {{!}} IPV6 {{!}} TYPE {{!}} SNAPSHOTS {{!}}
+---------------+---------+------+-----------------------------------------------+------------+-----------+
{{!}} testcontainer {{!}} RUNNING {{!}} {{!}} fd42:8063:81cb:988c:216:3eff:fe2a:f901 (eth0) {{!}} PERSISTENT {{!}} {{!}}
<translate>
<!--T:32-->What happened is that LXD set up a DHCP server for us (dnsmasq) running on our private container network, and automatically offers IP addresses to our containers. It also configured iptables for us to NAT the connection so that outbound Internet access should magically work.Time You should also be able to have some fun!see this IPv4 address listed in the container list when you type {{c|lxc list}} on your host system. === Network Troubleshooting === Note that if you are having issues with your container getting an IPv4 address via DHCP, make sure that you turn IPv6 off in LXD. Do thisby running:
</translate>
{{console|body=
%testcontainer% ###i##ego synclxc network edit lxdbr0
}}
<translate>
 
== Running systemd container on a non-systemd host == <!--T:95-->
<!--T:96-->To use systemd in the containerThen, a recent enough (>=4.6) kernel version with support for cgroup namespaces is neededchange {{c|ipv6. Funtoo's openrc has the fix nat}} to mount systemd cgroups, which is sufficient to run systemd based distributions {{c|"false"}} and restart lxd containers. and the container:
<!--T:97-->
If you want to get <code>systemd</code> hierarchy mounted automatically on system startup, using <code>/etc/fstab</code> will not work, but the
</translate>
{{Package|dev-libs/libcgroup}}
<translate> <!--T:98-->
can be used for this. First you needed to edit the <code>/etc/cgroup/cgconfig.conf</code> and add:
</translate>
{{file|name=/etc/cgroup/cgconfig.conf|body=mount {
"name=systemd" = /sys/fs/cgroup/systemd;
}
}}
<translate>
<!--T:99-->
Then you need to start the cgconfig daemon:
</translate>
{{console|body=
###i## rc-service cgconfig start
}}
<translate>
<!--T:100-->
The daemon can be started as needed, or automatically at system start by simply adding it to default group:
</translate>
{{console|body=
###i## rc-update add cgconfig default/etc/init.d/lxd restart###i## lxc restart testcontainer
}}
<translate>
<!--T:101--><hr><hr>This should resolve the issue.
=== Finishing Steps ===
== [[Special:MyLanguage/LXD/LXD in LXD|PART X - LXD in LXD]] == <!--T:10232-->  == [[Special:MyLanguage/LXD/Docker in LXD|PART Y - Docker in LXD]] == <Assuming your network is now working, you are ready to start using your new Funtoo container. Time to have some fun!--T:103-->  == [[Special:MyLanguage/LXD/FAQGo ahead and run {{c|PART Z - LXD FAQ]] == <!--T:104-->  == List of tested ego sync}} and working images == <!--T:105--> <!--T:106-->These are images from the https://images.linuxcontainers.org repository available by default in lxd. You can list all available images by typing following command (beware the list is very long)then emerge your favorite things:
</translate>
{{console|body=
#%testcontainer% ##i## lxc image list images:ego sync<nowiki>+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpine/3.3 (3 more) | ef69c8dc37f6 | yes | Alpine 3.3 amd64 (20171018_17:50) | x86_64 | 2.00MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpine/3.3/armhf (1 more) | 5ce4c80edcf3 | yes | Alpine 3.3 armhf (20170103_17:50) | armv7l | 1.53MB | Jan 3, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-----------------------------\##g##Syncing meta--+repo| alpineCloning into '/3.3var/i386 (1 more) | cd1700cb7c97 | yes | Alpine 3.3 i386 (20171018_17:50) | i686 | 1.84MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpinegit/3.4 (3 more) | bd4f1ccfabb5 | yes | Alpine 3.4 amd64 (20171018_17:50) | x86_64 | 2.04MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+-meta-------+------------------------------------------+---------+----------+-------------------------------+| alpine/3repo'.4/armhf (1 more) | 9fe7c201924c | yes | Alpine 3.4 armhf (20170111_20:27) | armv7l | 1.58MB | Jan 11, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpine/3.4/i386 (1 more) | 188a31315773 | yes | Alpine 3.4 i386 (20171018_17:50) | i686 | 1.88MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpine/3.5 (3 more) | 63bebc672163 | yes | Alpine 3.5 amd64 (20171018_17:50) | x86_64 | 1.70MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| alpine/3.5/i386 (1 more) | 48045e297515 | yes | Alpine 3.5 i386 (20171018_17:50) | i686 | 1.73MB | Oct 18, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+...+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| | fd95a7a754a0 | yes | Alpine 3.5 amd64 (20171016_17:50) | x86_64 | 1.70MB | Oct 16, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| | fef66668f5a2 | yes | Debian stretch arm64 (20171016_22:42) | aarch64 | 96.56MB | Oct 16, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| | ff18aa2c11d7 | yes | Opensuse 42.3 amd64 (20171017_00:53) | x86_64 | 58.92MB | Oct 17, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+| | ff4ef0d824b6 | yes | Ubuntu zesty s390x (20171017_03:49) | s390x | 86.88MB | Oct 17, 2017 at 12:00am (UTC) |+---------------------------------+--------------+--------+------------------------------------------+---------+----------+-------------------------------+</nowiki>}}
<translate>
 
<!--T:107-->
These are the images that are known to work with current LXD setup on Funtoo Linux:
{| class="wikitable sortable"
|-
! Image !! Init !! Status
|-
| CentOS 7 || systemd || Working
|-
| Debian Jessie (8) - EOL April/May 2020|| systemd || Working (systemd - no failed units)
|-
| Debian Stretch (9) - EOL June 2022|| systemd || Working
|-
| Fedora 26 || systemd with cgroup v2|| Not Working
|-
| Fedora 25 || systemd || Working
|-
| Fedora 24 || systemd || Working
|-
| Oracle 7 || systemd || Working (systemd - no failed units)
|-
| OpenSUSE 42.2 || systemd || Working
|-
| OpenSUSE 42.3 || systemd || Working
|-
| Ubuntu Xenial (16.04 LTS) - EOL 2021-04 || systemd || Working
|-
| Ubuntu Zesty (17.04) - EOL 2018-01 || systemd || Working
|-
| Alpine 3.3 || OpenRC || Working
|-
| Alpine 3.4 || OpenRC || Working
|-
| Alpine 3.5 || OpenRC || Working
|-
| Alpine 3.6 || OpenRC || Working
|-
| Alpine Edge || OpenRC || Working
|-
| Archlinux || systemd with cgroup v2 || Not Working
|-
| CentOS 6 || upstart || Working (systemd - no failed units)
|-
| Debian Buster || systemd with cgroup v2 || Not Working
|-
| Debian Sid || systemd with cgroup v2 || Not working
|-
| Debian Wheezy (7) - EOL May 2018 || ? || ? (more testing needed)
|-
| Gentoo || OpenRC || Working (all services started)
|-
| Oracle 6 || upstart || ? (mount outputs nothing)
|-
| Plamo 5 || ? || ?
|-
| Plamo 6 || ? || ?
|-
| Sabayon || systemd with cgroup v2 || Not Working
|-
| Ubuntu Artful (17.10) - EOL 2018-07|| systemd with cgroup v2 || Not Working
|-
| Ubuntu Core 16 || ? || ?
|-
| Ubuntu Trusty (14.04 LTS) - EOL 2019-04 || upstart || Working
|}
 
<!--T:121-->
[[Category:Containers]]
110
edits

Navigation menu