trentdocs_website/site/lxd_container_foo/index.html

327 lines
11 KiB
HTML
Raw Permalink Normal View History

2018-02-05 17:40:06 -08:00
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>LXD Container Foo - Trent Docs</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="../css/highlight.css">
<script>
// Current page data
var mkdocs_page_name = "LXD Container Foo";
var mkdocs_page_input_path = "lxd_container_foo.md";
var mkdocs_page_url = "/lxd_container_foo/";
</script>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../js/modernizr-2.8.3.min.js"></script>
<script type="text/javascript" src="../js/highlight.pack.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Trent Docs</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="..">Home</a>
</li>
<li class="toctree-l1">
<a class="" href="../apt_pinning_artful_aardvark_packages_in_xenial_xerus/">Apt Pinning Artful Aardvark Packages in Xenial Xerus</a>
</li>
<li class="toctree-l1">
<a class="" href="../lxd_container_home_server_networking_for_dummies/">LXD Container Home Server Networking For Dummies</a>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">LXD Container Foo</a>
<ul class="subnav">
<li class="toctree-l2"><a href="#more-notes-and-tips-for-using-lxd">More Notes and Tips for Using LXD</a></li>
<ul>
<li><a class="toctree-l3" href="#lxd-server-and-clients">LXD Server and Clients</a></li>
</ul>
</ul>
</li>
<li class="toctree-l1">
<a class="" href="../how_to_reassign_a_static_ip_address_with_dnsmasq/">How To Reassign A Static Ip Address with dnsmasq</a>
</li>
<li class="toctree-l1">
<a class="" href="../serve_and_share_apps_from_your_phone_with_fdroid/">Serve And Share Apps From Your Phone With Fdroid</a>
</li>
<li class="toctree-l1">
<a class="" href="../nspawn/">Nspawn</a>
</li>
<li class="toctree-l1">
<a class="" href="../gentoo_lxd_container/">Gentoo LXD Container</a>
</li>
<li class="toctree-l1">
<a class="" href="../mastodon_on_arch/">Mastodon on Arch</a>
</li>
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
<li class="toctree-l1">
<a class="" href="../freebsd_jails_on_freenas/">FreeBSD Jails on FreeNAS</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_redis_nspawn/">Quick Dirty Redis Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_postgresql_nspawn/">Quick Dirty Postgresql Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1">
<a class="" href="../misc_tips_troubleshooting/">Misc Tips, Trouble Shooting</a>
</li>
<li class="toctree-l1">
<a class="" href="../self_signed_certs/">Self Signed Certs</a>
</li>
<li class="toctree-l1">
<a class="" href="../selfoss_on_centos7/">Selfoss on Centos7</a>
</li>
<li class="toctree-l1">
<a class="" href="../stupid_package_manager_tricks/">Stupid Package Manager Tricks</a>
</li>
2018-02-10 23:31:16 -08:00
<li class="toctree-l1">
<a class="" href="../stupid_kvm_tricks/">Stupid KVM Tricks</a>
</li>
2018-02-05 17:40:06 -08:00
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Trent Docs</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>LXD Container Foo</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="more-notes-and-tips-for-using-lxd">More Notes and Tips for Using LXD</h1>
<h3 id="lxd-server-and-clients">LXD Server and <em>Clients</em></h3>
<h5 id="your-lxd-hosts-can-establish-a-secure-client-server-relationship-very-quickly-and-easily">Your LXD hosts can establish a secure client-server relationship very quickly and easily.</h5>
<pre><code class="bash"># First enable networking on Both the server and client:
lxc config set core.https_address [::]:8443
# Then on the server, set a password:
lxc config set core.trust_password &lt;something-secure&gt;
# Then on the client, add the server as a remote,
# and enter the password you just created for it:
lxc remote add &lt;server&gt; &lt;ip address&gt;
</code></pre>
<h5 id="now-from-the-perspective-of-the-client-machine-the-server-is-just-another-remote-same-as">Now from the perspective of the client machine, the server is just another remote, same as:</h5>
<ul>
<li><strong>local</strong> (the default)</li>
<li><strong>ubuntu</strong> (where ubuntu images come from), and </li>
<li><strong>images</strong> (where lxc images of other distros come from).</li>
<li><strong>clyde</strong> (your host named clyde)</li>
</ul>
<pre><code class="bash"># command to list remotes
# returns local, images, ubuntu, etc.
lxc remote list
# command to list containers on a remote
lxc list &lt;remote&gt;:
# i.e. for a remote named &quot;black&quot;
lxc list black:
# command to list images on a remote
# i.e. for a remote name &quot;images&quot;
lxc image list images:
# or for a remote named &quot;ubuntu&quot;
lxc image list ubuntu:
# or for a specific image
lxc image list ubuntu:16.04 # or
lxc image list ubuntu:fdceb4d263b9
</code></pre>
<h5 id="now-you-can-move-containers-around-between-servers-and-clients">Now you can move containers around between servers and clients.</h5>
<pre><code class="bash"># launch an ubuntu container from the ubuntu remote
lxc launch ubuntu:16.04 &lt;optional name&gt;
# or from a remote named &quot;black&quot;
lxc launch black:069b95ed3a60 &lt;optional name&gt;
# to list the images that black has available
lxc image list black:
# copy a container from a server named &quot;black&quot;
# to your local client
lxc copy black:jerry &lt;optional name to copy to&gt;
# or from &quot;local&quot; back to &quot;black&quot;
lxc copy jerry black:&lt;optional name to copy to&gt;
# or move
lxc move black:jerry &lt;optional name to copy to&gt;
# or change the default remote from &quot;local&quot; to &quot;black&quot;
lxc remote set-default black
# and then reverse the syntax
# copy a container from a server named &quot;black&quot;
# to your local client
lxc copy jerry local:&lt;optional name to copy to&gt;
# or from &quot;local&quot; back to &quot;black&quot;
lxc copy local:jerry &lt;optional name to copy to&gt;
</code></pre>
<h5 id="or-remote-control-another-lxd-server">Or remote control another LXD server</h5>
<pre><code class="bash"># bash shell on container named &quot;jim&quot; running on
# a remote server named &quot;black&quot;
lxc exec black:jim bash
# copy that
lxc copy black:jim black:francine
# snapshot
lxc snapshot black:jim
# delete a snapshot from a remote container
# first get the containers info to see what
# snapshots it has
lxc info black:jim
# and then delete
lxc delete black:jim/snap0
# or rollback/restore,
# slightly different syntax vs &quot;delete&quot;
lxc restore black:jim snap0
</code></pre>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../how_to_reassign_a_static_ip_address_with_dnsmasq/" class="btn btn-neutral float-right" title="How To Reassign A Static Ip Address with dnsmasq">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../lxd_container_home_server_networking_for_dummies/" class="btn btn-neutral" title="LXD Container Home Server Networking For Dummies"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../lxd_container_home_server_networking_for_dummies/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../how_to_reassign_a_static_ip_address_with_dnsmasq/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme.js"></script>
<script src="../search/require.js"></script>
<script src="../search/search.js"></script>
</body>
</html>