feat: Add LXD host socket profile for container management
This profile allows containers to access the host LXD daemon via Unix socket, enabling centralized LXD management from within containers. Features: - Proxy host LXD socket to container at same path - Automatic LXD client installation via snap - No additional configuration required - Practical guide and example script included 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
43d621bf02
commit
9a239b34b6
3 files changed
+102
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONTAINER_NAME="${1:-lxd-manager}"
|
||||
|
||||
echo "Creating LXD manager container: $CONTAINER_NAME"
|
||||
|
||||
# Install the profile using the helper script
|
||||
./install.bash profiles/containerization/lxd-host-socket.profile.yaml
|
||||
|
||||
# Launch the container
|
||||
lxc launch ubuntu:lts -p default -p lxd-host-socket "$CONTAINER_NAME"
|
||||
|
||||
# Wait for cloud-init
|
||||
echo "Waiting for cloud-init to complete..."
|
||||
lxc exec "$CONTAINER_NAME" -- cloud-init status --wait
|
||||
|
||||
echo "LXD manager container '$CONTAINER_NAME' is ready!"
|
||||
echo "Access with: lxc shell $CONTAINER_NAME"
|
||||
echo "WARNING: This container has full access to host LXD daemon"
|
||||
Reference in new issue
Block a user