From 4ed2aba56adc7c2790448d23cf45c14d13a3b8e5 Mon Sep 17 00:00:00 2001
From: Trent Palmer
Date: Mon, 5 Feb 2018 17:40:06 -0800
Subject: [PATCH] new file: docs/lxd_container_foo.md
---
docs/index.md | 1 +
docs/lxd_container_foo.md | 99 ++++++
mkdocs.yml | 1 +
site/404.html | 5 +
.../index.html | 5 +
site/arch_postgresql_nspawn/index.html | 5 +
site/arch_redis_nspawn/index.html | 5 +
.../index.html | 5 +
.../index.html | 5 +
site/freebsd_jails_on_freenas/index.html | 5 +
site/gentoo_lxd_container/index.html | 5 +
.../index.html | 9 +-
site/index.html | 8 +-
site/lxd_container_foo/index.html | 316 ++++++++++++++++++
.../index.html | 9 +-
site/mastodon_on_arch/index.html | 5 +
site/misc_tips_troubleshooting/index.html | 5 +
site/nspawn/index.html | 5 +
site/search.html | 5 +
site/search/search_index.json | 39 ++-
site/self_signed_certs/index.html | 5 +
site/selfoss_on_centos7/index.html | 5 +
.../index.html | 5 +
site/sitemap.xml | 40 ++-
24 files changed, 574 insertions(+), 23 deletions(-)
create mode 100644 docs/lxd_container_foo.md
create mode 100644 site/lxd_container_foo/index.html
diff --git a/docs/index.md b/docs/index.md
index f534afe..d9210e3 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -4,6 +4,7 @@ Obviously, the commit history will reflect the time when these documents are wri
* [Apt Pinning Artful Aardvark Packages in Xenial Xerus](apt_pinning_artful_aardvark_packages_in_xenial_xerus.md)
* [LXD Container Home Server Networking For Dummies](lxd_container_home_server_networking_for_dummies.md)
+* [LXD Container Foo](lxd_container_foo.md)
* [How To Reassign A Static Ip Address with dnsmasq](how_to_reassign_a_static_ip_address_with_dnsmasq.md)
* [Serve And Share Apps From Your Phone With Fdroid](serve_and_share_apps_from_your_phone_with_fdroid.md)
* [Nspawn Containers](nspawn.md)
diff --git a/docs/lxd_container_foo.md b/docs/lxd_container_foo.md
new file mode 100644
index 0000000..2b94db9
--- /dev/null
+++ b/docs/lxd_container_foo.md
@@ -0,0 +1,99 @@
+# More Notes and Tips for Using LXD
+
+### LXD Server and _Clients_
+
+#####Your LXD hosts can establish a secure client-server relationship very quickly and easily.
+
+```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
+
+# Then on the client, add the server as a remote,
+# and enter the password you just created for it:
+lxc remote add
+```
+
+
+#####Now from the perspective of the client machine, the server is just another remote, same as:
+
+ * **local** (the default)
+ * **ubuntu** (where ubuntu images come from), and
+ * **images** (where lxc images of other distros come from).
+ * **clyde** (your host named clyde)
+
+
+```bash
+# command to list remotes
+# returns local, images, ubuntu, etc.
+lxc remote list
+
+# command to list containers on a remote
+lxc list :
+# i.e. for a remote named "black"
+lxc list black:
+
+# command to list images on a remote
+# i.e. for a remote name "images"
+lxc image list images:
+# or for a remote named "ubuntu"
+lxc image list ubuntu:
+# or for a specific image
+lxc image list ubuntu:16.04 # or
+lxc image list ubuntu:fdceb4d263b9
+```
+
+#####Now you can move containers around between servers and clients.
+
+```bash
+# launch an ubuntu container from the ubuntu remote
+lxc launch ubuntu:16.04
+# or from a remote named "black"
+lxc launch black:069b95ed3a60
+# to list the images that black has available
+lxc image list black:
+
+# copy a container from a server named "black"
+# to your local client
+lxc copy black:jerry
+# or from "local" back to "black"
+lxc copy jerry black:
+# or move
+lxc move black:jerry
+
+# or change the default remote from "local" to "black"
+lxc remote set-default black
+# and then reverse the syntax
+# copy a container from a server named "black"
+# to your local client
+lxc copy jerry local:
+# or from "local" back to "black"
+lxc copy local:jerry
+```
+
+#####Or remote control another LXD server
+
+```bash
+# bash shell on container named "jim" running on
+# a remote server named "black"
+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 "delete"
+lxc restore black:jim snap0
+```
diff --git a/mkdocs.yml b/mkdocs.yml
index ce647e6..f02b6d0 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -6,6 +6,7 @@ pages:
- 'Home': index.md
- 'Apt Pinning Artful Aardvark Packages in Xenial Xerus': apt_pinning_artful_aardvark_packages_in_xenial_xerus.md
- 'LXD Container Home Server Networking For Dummies': lxd_container_home_server_networking_for_dummies.md
+ - 'LXD Container Foo': lxd_container_foo.md
- 'How To Reassign A Static Ip Address with dnsmasq': how_to_reassign_a_static_ip_address_with_dnsmasq.md
- 'Serve And Share Apps From Your Phone With Fdroid': serve_and_share_apps_from_your_phone_with_fdroid.md
- 'Nspawn': nspawn.md
diff --git a/site/404.html b/site/404.html
index b9c2fcc..44fc6ca 100644
--- a/site/404.html
+++ b/site/404.html
@@ -57,6 +57,11 @@
Your LXD hosts can establish a secure client-server relationship very quickly and easily.
+
# 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 <something-secure>
+
+# Then on the client, add the server as a remote,
+# and enter the password you just created for it:
+lxc remote add <server> <ip address>
+
+
+
Now from the perspective of the client machine, the server is just another remote, same as:
+
+
local (the default)
+
ubuntu (where ubuntu images come from), and
+
images (where lxc images of other distros come from).
+
clyde (your host named clyde)
+
+
# command to list remotes
+# returns local, images, ubuntu, etc.
+lxc remote list
+
+# command to list containers on a remote
+lxc list <remote>:
+# i.e. for a remote named "black"
+lxc list black:
+
+# command to list images on a remote
+# i.e. for a remote name "images"
+lxc image list images:
+# or for a remote named "ubuntu"
+lxc image list ubuntu:
+# or for a specific image
+lxc image list ubuntu:16.04 # or
+lxc image list ubuntu:fdceb4d263b9
+
+
+
Now you can move containers around between servers and clients.
+
# launch an ubuntu container from the ubuntu remote
+lxc launch ubuntu:16.04 <optional name>
+# or from a remote named "black"
+lxc launch black:069b95ed3a60 <optional name>
+# to list the images that black has available
+lxc image list black:
+
+# copy a container from a server named "black"
+# to your local client
+lxc copy black:jerry <optional name to copy to>
+# or from "local" back to "black"
+lxc copy jerry black:<optional name to copy to>
+# or move
+lxc move black:jerry <optional name to copy to>
+
+# or change the default remote from "local" to "black"
+lxc remote set-default black
+# and then reverse the syntax
+# copy a container from a server named "black"
+# to your local client
+lxc copy jerry local:<optional name to copy to>
+# or from "local" back to "black"
+lxc copy local:jerry <optional name to copy to>
+
+
+
Or remote control another LXD server
+
# bash shell on container named "jim" running on
+# a remote server named "black"
+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 "delete"
+lxc restore black:jim snap0
+
diff --git a/site/search/search_index.json b/site/search/search_index.json
index e36fdac..37909a8 100644
--- a/site/search/search_index.json
+++ b/site/search/search_index.json
@@ -2,7 +2,7 @@
"docs": [
{
"location": "/",
- "text": "Welcome to Trent Docs\n\n\nGit Repo For These Docs\n\n\nObviously, the commit history will reflect the time when these documents are written.\n\n\n\n\nApt Pinning Artful Aardvark Packages in Xenial Xerus\n\n\nLXD Container Home Server Networking For Dummies\n\n\nHow To Reassign A Static Ip Address with dnsmasq\n\n\nServe And Share Apps From Your Phone With Fdroid\n\n\nNspawn Containers\n\n\nGentoo LXD Container\n\n\nMastodon on Arch\n\n\nDebian Nspawn Container On Arch For Testing Apache Configurations\n\n\nDynamic Cacheing Nginx Reverse Proxy For Pacman\n\n\nFreeBSD Jails on FreeNAS\n \n\n\nQuick Dirty Redis Nspawn Container on Arch Linux\n\n\nQuick Dirty Postgresql Nspawn Container on Arch Linux\n\n\nMisc Tips, Trouble Shooting\n\n\nSelf Signed Certs\n\n\nSelfoss on Centos7",
+ "text": "Welcome to Trent Docs\n\n\nGit Repo For These Docs\n\n\nObviously, the commit history will reflect the time when these documents are written.\n\n\n\n\nApt Pinning Artful Aardvark Packages in Xenial Xerus\n\n\nLXD Container Home Server Networking For Dummies\n\n\nLXD Container Foo\n\n\nHow To Reassign A Static Ip Address with dnsmasq\n\n\nServe And Share Apps From Your Phone With Fdroid\n\n\nNspawn Containers\n\n\nGentoo LXD Container\n\n\nMastodon on Arch\n\n\nDebian Nspawn Container On Arch For Testing Apache Configurations\n\n\nDynamic Cacheing Nginx Reverse Proxy For Pacman\n\n\nFreeBSD Jails on FreeNAS\n \n\n\nQuick Dirty Redis Nspawn Container on Arch Linux\n\n\nQuick Dirty Postgresql Nspawn Container on Arch Linux\n\n\nMisc Tips, Trouble Shooting\n\n\nSelf Signed Certs\n\n\nSelfoss on Centos7",
"title": "Home"
},
{
@@ -12,7 +12,7 @@
},
{
"location": "/#git-repo-for-these-docs",
- "text": "Obviously, the commit history will reflect the time when these documents are written. Apt Pinning Artful Aardvark Packages in Xenial Xerus LXD Container Home Server Networking For Dummies How To Reassign A Static Ip Address with dnsmasq Serve And Share Apps From Your Phone With Fdroid Nspawn Containers Gentoo LXD Container Mastodon on Arch Debian Nspawn Container On Arch For Testing Apache Configurations Dynamic Cacheing Nginx Reverse Proxy For Pacman FreeBSD Jails on FreeNAS Quick Dirty Redis Nspawn Container on Arch Linux Quick Dirty Postgresql Nspawn Container on Arch Linux Misc Tips, Trouble Shooting Self Signed Certs Selfoss on Centos7",
+ "text": "Obviously, the commit history will reflect the time when these documents are written. Apt Pinning Artful Aardvark Packages in Xenial Xerus LXD Container Home Server Networking For Dummies LXD Container Foo How To Reassign A Static Ip Address with dnsmasq Serve And Share Apps From Your Phone With Fdroid Nspawn Containers Gentoo LXD Container Mastodon on Arch Debian Nspawn Container On Arch For Testing Apache Configurations Dynamic Cacheing Nginx Reverse Proxy For Pacman FreeBSD Jails on FreeNAS Quick Dirty Redis Nspawn Container on Arch Linux Quick Dirty Postgresql Nspawn Container on Arch Linux Misc Tips, Trouble Shooting Self Signed Certs Selfoss on Centos7",
"title": "Git Repo For These Docs"
},
{
@@ -100,6 +100,41 @@
"text": "Once you assign the containers static ip addresses for their eth1 \ninterfaces, you can use the /etc/hosts file on each container to make them\naware of where the other containers and the host machine are. For instance, if you want the container quick-joey to talk directly\nto the host machine, which will be at the ip address of lxdbr1 , start a shell\non the container quick-joey lxc exec quick-joey bash and edit /etc/hosts # /etc/hosts\n10.151.18.1 mothership Or you have a container named fat-cinderella , that needs to be able to talk\ndirectly quick-joey . lxc exec fat-cinderella bash\nvim /etc/hosts # /etc/hosts\n10.151.18.123 quick-joey etcetera",
"title": "the /etc/hosts file"
},
+ {
+ "location": "/lxd_container_foo/",
+ "text": "More Notes and Tips for Using LXD\n\n\nLXD Server and \nClients\n\n\nYour LXD hosts can establish a secure client-server relationship very quickly and easily.\n\n\n# First enable networking on Both the server and client:\nlxc config set core.https_address [::]:8443\n\n# Then on the server, set a password:\nlxc config set core.trust_password \n\n# Then on the client, add the server as a remote,\n# and enter the password you just created for it:\nlxc remote add \n\n\n\n\nNow from the perspective of the client machine, the server is just another remote, same as:\n\n\n\n\nlocal\n (the default)\n\n\nubuntu\n (where ubuntu images come from), and \n\n\nimages\n (where lxc images of other distros come from).\n\n\nclyde\n (your host named clyde)\n\n\n\n\n# command to list remotes\n# returns local, images, ubuntu, etc.\nlxc remote list\n\n# command to list containers on a remote\nlxc list :\n# i.e. for a remote named \"black\"\nlxc list black:\n\n# command to list images on a remote\n# i.e. for a remote name \"images\"\nlxc image list images:\n# or for a remote named \"ubuntu\"\nlxc image list ubuntu:\n# or for a specific image\nlxc image list ubuntu:16.04 # or\nlxc image list ubuntu:fdceb4d263b9\n\n\n\n\nNow you can move containers around between servers and clients.\n\n\n# launch an ubuntu container from the ubuntu remote\nlxc launch ubuntu:16.04 \n# or from a remote named \"black\"\nlxc launch black:069b95ed3a60 \n# to list the images that black has available\nlxc image list black:\n\n# copy a container from a server named \"black\"\n# to your local client\nlxc copy black:jerry \n# or from \"local\" back to \"black\"\nlxc copy jerry black:\n# or move\nlxc move black:jerry \n\n# or change the default remote from \"local\" to \"black\"\nlxc remote set-default black\n# and then reverse the syntax\n# copy a container from a server named \"black\"\n# to your local client\nlxc copy jerry local:\n# or from \"local\" back to \"black\"\nlxc copy local:jerry \n\n\n\n\nOr remote control another LXD server\n\n\n# bash shell on container named \"jim\" running on\n# a remote server named \"black\"\nlxc exec black:jim bash\n\n# copy that\nlxc copy black:jim black:francine\n\n# snapshot\nlxc snapshot black:jim\n\n# delete a snapshot from a remote container\n# first get the containers info to see what\n# snapshots it has\nlxc info black:jim\n# and then delete\nlxc delete black:jim/snap0\n\n# or rollback/restore,\n# slightly different syntax vs \"delete\"\nlxc restore black:jim snap0",
+ "title": "LXD Container Foo"
+ },
+ {
+ "location": "/lxd_container_foo/#more-notes-and-tips-for-using-lxd",
+ "text": "",
+ "title": "More Notes and Tips for Using LXD"
+ },
+ {
+ "location": "/lxd_container_foo/#lxd-server-and-clients",
+ "text": "",
+ "title": "LXD Server and Clients"
+ },
+ {
+ "location": "/lxd_container_foo/#your-lxd-hosts-can-establish-a-secure-client-server-relationship-very-quickly-and-easily",
+ "text": "# First enable networking on Both the server and client:\nlxc config set core.https_address [::]:8443\n\n# Then on the server, set a password:\nlxc config set core.trust_password \n\n# Then on the client, add the server as a remote,\n# and enter the password you just created for it:\nlxc remote add ",
+ "title": "Your LXD hosts can establish a secure client-server relationship very quickly and easily."
+ },
+ {
+ "location": "/lxd_container_foo/#now-from-the-perspective-of-the-client-machine-the-server-is-just-another-remote-same-as",
+ "text": "local (the default) ubuntu (where ubuntu images come from), and images (where lxc images of other distros come from). clyde (your host named clyde) # command to list remotes\n# returns local, images, ubuntu, etc.\nlxc remote list\n\n# command to list containers on a remote\nlxc list :\n# i.e. for a remote named \"black\"\nlxc list black:\n\n# command to list images on a remote\n# i.e. for a remote name \"images\"\nlxc image list images:\n# or for a remote named \"ubuntu\"\nlxc image list ubuntu:\n# or for a specific image\nlxc image list ubuntu:16.04 # or\nlxc image list ubuntu:fdceb4d263b9",
+ "title": "Now from the perspective of the client machine, the server is just another remote, same as:"
+ },
+ {
+ "location": "/lxd_container_foo/#now-you-can-move-containers-around-between-servers-and-clients",
+ "text": "# launch an ubuntu container from the ubuntu remote\nlxc launch ubuntu:16.04 \n# or from a remote named \"black\"\nlxc launch black:069b95ed3a60 \n# to list the images that black has available\nlxc image list black:\n\n# copy a container from a server named \"black\"\n# to your local client\nlxc copy black:jerry \n# or from \"local\" back to \"black\"\nlxc copy jerry black:\n# or move\nlxc move black:jerry \n\n# or change the default remote from \"local\" to \"black\"\nlxc remote set-default black\n# and then reverse the syntax\n# copy a container from a server named \"black\"\n# to your local client\nlxc copy jerry local:\n# or from \"local\" back to \"black\"\nlxc copy local:jerry ",
+ "title": "Now you can move containers around between servers and clients."
+ },
+ {
+ "location": "/lxd_container_foo/#or-remote-control-another-lxd-server",
+ "text": "# bash shell on container named \"jim\" running on\n# a remote server named \"black\"\nlxc exec black:jim bash\n\n# copy that\nlxc copy black:jim black:francine\n\n# snapshot\nlxc snapshot black:jim\n\n# delete a snapshot from a remote container\n# first get the containers info to see what\n# snapshots it has\nlxc info black:jim\n# and then delete\nlxc delete black:jim/snap0\n\n# or rollback/restore,\n# slightly different syntax vs \"delete\"\nlxc restore black:jim snap0",
+ "title": "Or remote control another LXD server"
+ },
{
"location": "/how_to_reassign_a_static_ip_address_with_dnsmasq/",
"text": "How To Reassign a Static ip address with dnsmasq\n\n\nOn your router you can assign static ip addresses for various machines\nin your network, by writing the reservations in the file \n/etc/dnsmasq.conf\n.\n\n\nThese will be in the form as below.\n\n\ndhcp-host=,\n\n\nSo here's how you transfer an existing static ip address assignment to\na new client machine. Begin by editting the file \n/etc/dnsmasq.conf\n on\nyour router, and update the mac address associated with the intended\nip address.\n\n\nNext, temporarily stop dnsmasq.\n\n\nsystemctl stop dnsmasq\n\n\n\n\nNext shutdown networking on the new client machine. Shutting the machine down might work,\nor the command \ndhclient -v -r\n might get the job done (you will lose the connection).\n\n\nNow on the router, edit the file \n/var/lib/misc/dnsmasq.leases\n, and delete the pre-existing\nlease for the old client machine that will no longer exist.\n\n\nRestart dnsmasq on the router,\n\nand then restart networking on the new client machine.",
diff --git a/site/self_signed_certs/index.html b/site/self_signed_certs/index.html
index f8f39eb..399b321 100644
--- a/site/self_signed_certs/index.html
+++ b/site/self_signed_certs/index.html
@@ -64,6 +64,11 @@