userdoc:guest_lxc_container

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
userdoc:guest_lxc_container [2020/05/16 15:40]
abelbeck [Command via a Container]
userdoc:guest_lxc_container [2020/05/24 17:14]
mkeuter [Optional]
Line 130: Line 130:
 ===== Destroy All Containers ===== ===== Destroy All Containers =====
  
-If you want disable all LXC container support, or start fresh, from the CLI:+If you want to disable all LXC container support, or start fresh, from the CLI:
  
 !!Warning ->!!  This action is not undoable, All LXC containers and download caches will be deleted! !!Warning ->!!  This action is not undoable, All LXC containers and download caches will be deleted!
Line 163: Line 163:
 Pi-hole is a perfect example to use with AstLinux within a LXC.  Begin as with the "Quick Start Guide" but use the name ''pi-hole''. Pi-hole is a perfect example to use with AstLinux within a LXC.  Begin as with the "Quick Start Guide" but use the name ''pi-hole''.
  
-__Enable Pi-hole LXC:__ +First, it is assumed the ''lxcbr0'' interface is setup per the above **Quick Start Guide** -> Enable LXC Support.
-\\ +
- +
-  * Define ''LXC_BRIDGE0'' in ''user.conf'' using a physical or VLAN interface +
-  * Assign ''lxcbr0'' to an internal interface in the **Network tab** +
-  * Reboot+
  
 Then from the CLI: Then from the CLI:
Line 255: Line 250:
      
   printf "Waiting for container network to become active... "   printf "Waiting for container network to become active... "
-  lxc-attach lynx -u $rand_uid -- fping -q -r15 8.8.4.4+  lxc-attach lynx -u $rand_uid -- fping -q -r15 $ping_ip
   printf "OK\n"   printf "OK\n"
      
Line 267: Line 262:
  
 !!Tip ->!! If you edit ''/var/lib/lxc/lynx/config'' and assign a manual IP address, the container starts very quickly, whereas using DHCP it takes 4-6 seconds to establish the network. !!Tip ->!! If you edit ''/var/lib/lxc/lynx/config'' and assign a manual IP address, the container starts very quickly, whereas using DHCP it takes 4-6 seconds to establish the network.
 +
 +Test it!
 +
 +  /mnt/kd/bin/lynx https://www.astlinux-project.org
  
 \\  \\ 
Line 278: Line 277:
 lxc.cgroup.memory.limit_in_bytes = 512M lxc.cgroup.memory.limit_in_bytes = 512M
 #lxc.cgroup.cpu.shares = 256 #lxc.cgroup.cpu.shares = 256
-lxc.cgroup.cpuset.cpus = 1+# Define which cores (e.g. 0 to 3) are allowed to use comma separated (not the count of cores!) 
 +lxc.cgroup.cpuset.cpus = 1,3
 </code> </code>
  
 \\  \\ 
  • userdoc/guest_lxc_container.txt
  • Last modified: 2023/06/15 09:03
  • by abelbeck