User Tools

Site Tools


docs:migrate-vserver-to-lxc

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
docs:migrate-vserver-to-lxc [2017/07/25 15:44] 95.208.70.15docs:migrate-vserver-to-lxc [2017/07/25 15:50] 95.208.70.15
Line 46: Line 46:
 The subuid mechanism needs the uid/gid values inside the container The subuid mechanism needs the uid/gid values inside the container
 to be recalculated and changed.  to be recalculated and changed. 
-[[http://www.fischglas.de/software/ownrecalc/|ownrecalc]] gets the job done.+[[http://www.fischglas.de/software/ownrecalc/|ownrecalc]] gets the job done 
 +smoothly. 
 + 
 +<code> 
 +if [ ! -f /usr/bin/ownrecalc ]; then 
 +    wget http://www.fischglas.de/software/ownrecalc/ownrecalc -O /usr/bin/ownrecalc 
 + chmod 755 /usr/bin/ownrecalc 
 +fi 
 +</code> 
 + 
 +Create a default container configuration: 
 + 
 +<code> 
 +if [ ! -f /var/lib/lxc/default.conf ] ; then 
 +touch /var/lib/lxc/default.conf 
 +vo -o /var/lib/lxc/default.conf 
 + 
 +cat << EOF > /var/lib/lxc/default.conf 
 +lxc.autodev = 1 
 +lxc.kmsg = 0 
 + 
 +lxc.network.type = veth 
 +lxc.network.flags = up 
 +lxc.network.name = eth0 
 + 
 +lxc.mount.auto = sys:ro proc:mixed cgroup-full:mixed 
 + 
 +lxc.cap.keep = chown net_raw dac_override dac_read_search fowner fsetid kill setgid setuid linux_immutable net_bind_service net_broadcast ipc_lock ipc_owner sys_chroot sys_ptrace sys_pacct sys_boot sys_nice sys_resource sys_tty_config lease audit_write audit_control syslog wake_alarm 
 + 
 +lxc.pts = 1024 
 + 
 +lxc.cgroup.devices.deny = a 
 + 
 +lxc.aa_profile = unconfined 
 + 
 +# --- devices --- # 
 +# /dev/null and zero 
 +lxc.cgroup.devices.allow = c 1:3 rwm 
 +lxc.cgroup.devices.allow = c 1:5 rwm 
 + 
 +# consoles 
 +lxc.cgroup.devices.allow = c 5:1 rwm 
 +lxc.cgroup.devices.allow = c 5:0 rwm 
 +lxc.cgroup.devices.allow = c 4:0 rwm 
 +lxc.cgroup.devices.allow = c 4:1 rwm 
 + 
 +# /dev/{,u}random 
 +lxc.cgroup.devices.allow = c 1:9 rwm 
 +lxc.cgroup.devices.allow = c 1:8 rwm 
 +lxc.cgroup.devices.allow = c 136:* rwm 
 +lxc.cgroup.devices.allow = c 5:2 rwm 
 + 
 +# rtc 
 +lxc.cgroup.devices.allow = c 254:0 rwm 
 + 
 +lxc.mount.entry=run run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0 
 +EOF 
 + 
 +vo -i /var/lib/lxc/default.conf 
 +fi 
 +</code> 
 + 
 +===== migrate a single vserver =====
  
  
  
docs/migrate-vserver-to-lxc.txt · Last modified: 2017/07/25 16:03 by 95.208.70.15 · Currently locked by: 114.119.150.110