2022-10-05 14:35:21 +01:00
2022-10-05 23:26:32 +01:00
2022-10-08 01:08:50 +01:00

lxc

Setup

sudo usermod -a -G lxd $(whoami)

Containers

List

lxc list

Get Info

lxc info containername

Create

lxc launch ubuntu containername

Stop

lxc stop containername

Exec bash on container

lxc exec $containername bash

Exec multiple commands

lxc exec "container name" -- bash -c "apt update -y && apt upgrade -y"

delete a container

lxc rm "container name"
#if force required
lxc rm "container name" --force

Configuration

Edit

lxc config edit "container name"

Set value

#Example
lxc config set "container name" "security.nesting" "true"

Profile Management

lxc profile remove "container name" "profile name to remote" 
lxc profile assign "container name" "profile name to assign" 

Profiles

macvlan only

  1. create copy from default
  2. edit new profile
devices:
  eth0:
    nictype: macvlan
    parent: "physical ethernet name"
    type: nic
Description
No description provided
Readme 29 KiB
Languages
Shell 100%