Forum archive
How to run Turnkey appliances in LXD (converting Proxmox to LXD containers)
Getting started with TurnKeyLinux templates as Linux Containers in LXD.
This tutorial assumes you have a working LXD instalation (version 3.23 or greater) and does not cover setup and configuration of LXD -- there are plenty of these guides.
Pro tip 1: If possible, use the snap version of LXD to get the most current features.
# sudo snap install lxd (on ubuntu systems)
Pro tip 2: add your user to the lxd group so that you don't need to use sudo before every command (requires logging out/in to take effect)
This guide was adapted from:
https://ubuntu.com/tutorials/create-custom-lxd-images#1-overview
https://linuxcontainers.org/lxd/getting-started-cli/
https://us.images.linuxcontainers.org/
https://help.ubuntu.com/lts/serverguide/lxd.html
/docs/builds
===========================
Visit and download your desired images:
===========================
http://mirror.turnkeylinux.org/turnkeylinux/images/proxmox/
e.g.
debian-9-turnkey-core_15.0rc1-1_amd64.tar.gz
===========================
Create a metadata file:
===========================
The metadata.yaml file describes things like image creation date, name, architecture and description.
To create an LXD image, we need to provide such a file. Here’s an example of how simple metadata file should look:
# nano metadata.yaml
architecture: "x86_64"
creation_date: 1584391985 # use `date +%s` command
properties:
architecture: "x86_64"
description: "Debian Stretch Turnkey Core"
os: "debian"
release: "stretch"
After creating the metadata file, create a tarball containing this file:
# tar -cvzf metadata.tar.gz metadata.yaml
=====================================
Importing LXD images
=====================================
Next, import the two tarballs into LXD image:
# sudo lxc image import metadata.tar.gz debian-9-turnkey-core_15.0rc1-1_amd64.tar.gz --alias tkl-core-9
We can now create a new container from this image:
syntax: lxc launch <image/alias name> <new container name>
# lxc image list
# lxc launch tkl-core-9 tkldemo
====================================
Connect to terminal as root and set initial password:
====================================
# lxc exec <<container-name>> bash
Set initial root password:
root@container# passwd
root@container# exit
======================================================
Now Run inital TKL setup using ssh
(IP can be found by running 'lxc list')
======================================================
# lxc list
# ssh root@i.p.address (using root password from above)
After completing initial setup....
Connect to webmin on port 12321
Connect to web terminal on port 12320
http://i.p.address
https://i.p.address
see more at: /core
or the page for the appliance you downloaded.
Whilst I am intimately familiar with the internals of TurnKey and it's build process, when it comes to individual appliances and platforms, my knowledge tends to be broad rather than deep. So having some greater insight into specific appliances and/or software is really useful. So thanks so much for sharing.
Regarding your suggestions, I've noted them as a "feature request" on our "Issue tracker".