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
Next revision Both sides next revision
технология_lxc [2020/06/22 20:26]
val [Настройка lxc для запуска дочерней системы в контейнере]
технология_lxc [2022/02/10 14:49]
val [Создание ветки дочерней системы]
Line 3: Line 3:
   * [[http://​ru.wikipedia.org/​wiki/​LXC|LXC wiki]]   * [[http://​ru.wikipedia.org/​wiki/​LXC|LXC wiki]]
   * [[https://​help.ubuntu.com/​lts/​serverguide/​lxc.html|Ubuntu-Руководство по Ubuntu Server-Виртуализация]]   * [[https://​help.ubuntu.com/​lts/​serverguide/​lxc.html|Ubuntu-Руководство по Ubuntu Server-Виртуализация]]
 +  * [[https://​linuxcontainers.org/​lxc/​getting-started/​|LXC Getting started]]
  
  
Line 31: Line 32:
         gateway 192.168.X.1         gateway 192.168.X.1
         ​         ​
-#        ​bridge_ports eth0 +        ​bridge_ports eth0
-#        bridge_ports enp0s3+
  
 #        bridge_stp off #        bridge_stp off
Line 60: Line 60:
  
 ==== Создание ветки дочерней системы ==== ==== Создание ветки дочерней системы ====
 +
 +=== Debian ===
 <​code>​ <​code>​
 debian# lxc-create -t debian -n www debian# lxc-create -t debian -n www
 </​code>​ </​code>​
  
 +=== Ubuntu ===
 +<​code>​
 +ubuntu# lxc-create -t download -n server -- --no-validate -d ubuntu -r focal -a amd64
 +</​code>​
 ==== Установка ПО в дочерней системе ==== ==== Установка ПО в дочерней системе ====
 <​code>​ <​code>​
Line 103: Line 109:
 </​code><​code>​ </​code><​code>​
 ... ...
-#​lxc.network.link = empty+
 lxc.net.0.type = veth lxc.net.0.type = veth
 lxc.net.0.link = br0 lxc.net.0.link = br0
Line 111: Line 117:
  
 lxc.start.auto = 1 lxc.start.auto = 1
-... 
 </​code><​code>​ </​code><​code>​
 root@server:​~#​ lxc-ls -f root@server:​~#​ lxc-ls -f
Line 123: Line 128:
  
 root@server:​~#​ lxc-attach -n www -- ps ax root@server:​~#​ lxc-attach -n www -- ps ax
 +  или
 +root@server:​~#​ ps -eo pid,cmd,lxc | grep www
 +
 root@server:​~#​ lxc-attach -n www -- /bin/bash root@server:​~#​ lxc-attach -n www -- /bin/bash
  
Line 131: Line 139:
 root@server:​~#​ systemctl start lxc@www root@server:​~#​ systemctl start lxc@www
  
- 
-debian9# systemctl edit lxc@server 
- 
-  или 
- 
-debian9# mkdir /​etc/​systemd/​system/​lxc@www.service.d/​ 
-debian9# cat /​etc/​systemd/​system/​lxc@www.service.d/​kill_signal_fix.conf 
-</​code><​code>​ 
-[Service] 
-KillSignal=SIGRTMIN+3 
-</​code><​code>​ 
 root@server:​~#​ systemctl stop lxc@www root@server:​~#​ systemctl stop lxc@www
 </​code>​ </​code>​
технология_lxc.txt · Last modified: 2024/05/14 16:10 by val