/LXD_containers

Common LXD IntelligentRoboticsLab's containers.

LXD_containers

Common LXD IntelligentRoboticsLab's containers.

Useful resources

Cheatsheet

  • Launch a container from an image: lxc launch [img-name] [cont-name] -p [profile-name]

  • List: lxc list

  • Start: lxc start [cont-name]

  • Shell: lxc exec [cont-name] -- su --login ubuntu

  • Share a directory: lxc config device add [cont-name] shareddir1 disk path=/root/[dest_dir] source=/home/[username]/[origin_dir]

  • Rm a shared directory: lxc config device remove [cont-name] shareddir1

  • Clone a container: lxc copy [source-cont] [target-cont]

  • Connection through ssh (Permission denied (publickey)): https://www.digitalocean.com/community/questions/error-permission-denied-publickey-when-i-try-to-ssh

  • Add TIAGo's network profile to your container:

    
      lxc profile create macvlan
      lxc profile edit macvlan
     

    Paste the following:

    
     config:
       user.network-config: |
         version: 1
           config:
             - type: physical
               name: eth0
               subnets:
                 - type: dhcp
                   ipv4: true
     description: LXD profile with LAN connection
     devices:
       eth0:
         name: eth0
         nictype: macvlan
         parent: [eth-name]
         type: nic
       root:
         path: /
         pool: default
         type: disk
     name: macvlan
     used_by:
     

    Add the profile to the container:

    lxc profile add [cont-name] macvlan 
  • Default network config:

     devices:
      eth0:
        name: eth0
        nictype: bridged
        parent: [network interface created in the initial process]
        type: nic
    

Image list