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
Last revision Both sides next revision
tools:lxc [2022/09/01 22:37]
darron [Configure]
tools:lxc [2024/04/28 18:36]
darron [Initialise]
Line 12: Line 12:
  
 <code> <code>
-apt-get install lxc lxc-templates bridge-utils cgroupfs-mount conntrack iptables+apt-get install lxc lxc-templates bridge-utils cgroupfs-mount conntrack iptables debootstrap
 /etc/init.d/cgroupfs-mount start /etc/init.d/cgroupfs-mount start
 </code> </code>
Line 31: Line 31:
 ==systemd== ==systemd==
 <code> <code>
 +systemctl disable lxc-monitord.service
 +systemctl mask lxc-monitord.service
 systemctl disable lxc-net.service systemctl disable lxc-net.service
 systemctl disable lxc.service systemctl disable lxc.service
Line 38: Line 40:
  
 <code> <code>
-sed -i 's/LXC_AUTO="true"/LXC_AUTO="false"/ /etc/default/lxc +sed -i 's/LXC_AUTO="true"/LXC_AUTO="false"/g' /etc/default/lxc 
-sed -i 's/USE_LXC_BRIDGE="true"/USE_LXC_BRIDGE="false"/ /etc/default/lxc-net+sed -i 's/USE_LXC_BRIDGE="true"/USE_LXC_BRIDGE="false"/g' /etc/default/lxc-net
 </code> </code>
  
Line 85: Line 87:
 iptables -t raw -F iptables -t raw -F
 iptables -t nat -F iptables -t nat -F
-/usr/sbin/conntrack -F+conntrack -F
  
 # raw:PREROUTING # raw:PREROUTING
Line 135: Line 137:
  
 <code> <code>
 +mkdir -p /var/cache/lxc/debian
 wget "https://ftp-master.debian.org/keys/release-10.asc" wget "https://ftp-master.debian.org/keys/release-10.asc"
 gpg --no-default-keyring --keyring /var/cache/lxc/debian/archive-key.gpg --import release-10.asc gpg --no-default-keyring --keyring /var/cache/lxc/debian/archive-key.gpg --import release-10.asc
Line 151: Line 154:
 <code> <code>
 lxc-create -n terminator -t debian -- -r bullseye -a armhf lxc-create -n terminator -t debian -- -r bullseye -a armhf
 +</code>
 +
 +Install bookworm
 +
 +<code>
 +lxc-create -n cracker -t debian -- -r bookworm -a armhf
 </code> </code>
 === Configure === === Configure ===
Line 260: Line 269:
  
 Now we can start and stop the container, attach to it, etc. Now we can start and stop the container, attach to it, etc.
 +
 +===Runit===
 +
 +Start container and login as root
 +<code>
 +lxc-start -F -n container
 +</code>
 +
 +Install runit. It will ask you to enter a phrase and after installation reboot.
 +
 +<code>
 +apt install runit-init
 +reboot
 +</code>
 +
 +Login to tidy up.
 +
 +<code>
 +lxc-attach -n container
 +cd /etc/service
 +rm getty-tty*
 +</code>