User Tools

Site Tools


технология_lxc

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
технология_lxc [2025/02/01 10:11]
val [Создание ветки дочерней системы]
технология_lxc [2026/10/15 09:59] (current)
val [Настройка lxc для запуска дочерней системы в контейнере]
Line 8: Line 8:
 ===== Debian/​Ubuntu ===== ===== Debian/​Ubuntu =====
  
 +  * Сервис SalesPlatform Vtiger CRM Russian [[Сервис SalesPlatform Vtiger CRM Russian#​Информация по установке в LXC]]
 ===== Подготовка родительской (host) системы ===== ===== Подготовка родительской (host) системы =====
  
Line 83: Line 84:
  
 debian# ls /​var/​cache/​lxc debian# ls /​var/​cache/​lxc
 +
 +debian13# lxc-create -t download -n www -- -d debian -r trixie -a amd64
 </​code>​ </​code>​
  
Line 109: Line 112:
 root@server:​~#​ cp /​etc/​ssh/​sshd_config /​var/​lib/​lxc/​www/​rootfs/​etc/​ssh/​sshd_config root@server:​~#​ cp /​etc/​ssh/​sshd_config /​var/​lib/​lxc/​www/​rootfs/​etc/​ssh/​sshd_config
  
-root@server:​~# ###cp /​etc/​resolv.conf /​var/​lib/​lxc/​www/​rootfs/​etc/​resolv.conf+root@server:​~#​ cp --remove-destination ​/​etc/​resolv.conf /​var/​lib/​lxc/​www/​rootfs/​etc/​resolv.conf
  
 root@server:​~#​ chroot /​var/​lib/​lxc/​www/​rootfs /bin/bash root@server:​~#​ chroot /​var/​lib/​lxc/​www/​rootfs /bin/bash
Line 117: Line 120:
 www:/# apt purge isc-dhcp-client www:/# apt purge isc-dhcp-client
  
-www:/# apt install nano vim iputils-ping+www:/# apt install nano vim iputils-ping ​ssh
 </​code>​ </​code>​
  
 ==== Настойка сетевых параметров дочерней системы ==== ==== Настойка сетевых параметров дочерней системы ====
 <​code>​ <​code>​
 +www:/# rm /​etc/​systemd/​network/​*.network
 +
 www:/# cat /etc/hosts www:/# cat /etc/hosts
 </​code><​code>​ </​code><​code>​
Line 153: Line 158:
 lxc.net.0.ipv4.gateway = 192.168.X.1 lxc.net.0.ipv4.gateway = 192.168.X.1
  
-#​lxc.start.auto = 1  # now - systemctl enable lxc@www 
  
 lxc.cgroup2.cpuset.cpus = 0-0 lxc.cgroup2.cpuset.cpus = 0-0
Line 175: Line 179:
  
 root@server:​~#​ lxc-attach -n www -- /bin/bash root@server:​~#​ lxc-attach -n www -- /bin/bash
- +root@www:~# ###​systemctl disable --now systemd-networkd
-root@server:~# ssh 192.168.X.20+
  
 root@server:​~#​ lxc-stop -n www root@server:​~#​ lxc-stop -n www
Line 185: Line 188:
  
 root@server:​~#​ systemctl enable lxc@www --now root@server:​~#​ systemctl enable lxc@www --now
 +
 +root@server:​~#​ ssh 192.168.X.20
 </​code>​ </​code>​
технология_lxc.1738393908.txt.gz · Last modified: 2025/02/01 10:11 by val