Changes

Jump to: navigation, search

LXD

2,116 bytes added, 2 months ago
Initialization
{{!}} funtoo {{!}} fe4d27fb31bf {{!}} no {{!}} 1.3 Release Skylake 64bit [std] 2019-06-14 {{!}} x86_64 {{!}} 279.35MB {{!}} Jun 15, 2019 at 3:09am (UTC) {{!}}
+--------+--------------+--------+--------------------------------------------+--------+----------+------------------------------+
#
}}
 
=== Final Prep ===
 
Now, we are almost ready to create our first container, but first we want to modify the default profile to contain some useful settings. LXD (like Funtoo and Gentoo) also use profiles to manage settings, and there is a default profile that
applies to all containers. Let's add the following settings to it with these commands:
 
{{console|body=
# ##i##lxc profile set default environment.LANG "en_US.UTF-8"
# ##i##lxc profile set default environment.LC_ALL "en_US.UTF-8"
# ##i##lxc profile set default environment.LC_COLLATE "POSIX"
}}
These settings simply serve the purpose of setting some default environment variables, so that when we enter the container with {{c|lxc exec}} without a login shell, it will still have all these environment settings at reasonable defaults. This will get rid of some annoying warning messages when we enter the container.
 
=== First Containeer ===
 
It is now time to launch our first container. This can be done as follows:
 
{{console|body=
# ##i##lxc launch funtoo testcontainer
Creating testcontainer
Starting testcontainer
}}
 
We can now see the container running via {{c|lxc list}}:
 
{{console|body=
# ##i##lxc list
+---------------+---------+------+-----------------------------------------------+------------+-----------+
{{!}} NAME {{!}} STATE {{!}} IPV4 {{!}} IPV6 {{!}} TYPE {{!}} SNAPSHOTS {{!}}
+---------------+---------+------+-----------------------------------------------+------------+-----------+
{{!}} testcontainer {{!}} RUNNING {{!}} {{!}} fd42:8063:81cb:988c:216:3eff:fe2a:f901 (eth0) {{!}} PERSISTENT {{!}} {{!}}
+---------------+---------+------+-----------------------------------------------+------------+-----------+
#
}}
 
By default, our new container {{c|testcontainer}} will use the default profile, which will connect an {{c|eth0}} interface in the container to NAT, and will also use our directory-based LXD storage pool. We can now enter the container as follows:
 
{{console|body=
# ##i##lxc exec testcontainer -- /bin/bash
##r##testcontainer ##bl##~ #
}}
Bureaucrats, Administrators, wiki-admins, wiki-staff
5,837
edits

Navigation menu