[SOLVED] Convert PHY Gentoo to an LXC-Container?

fireon

Distinguished Member
Oct 25, 2010
4,596
544
183
Austria/Graz
deepdoc.at
Hello,

i would like do convert an phy gentoo machine to an LXC container (KVM is not possible). What have i done?
  1. Create a new Gentoo lxc with an empty storage (ZFS)
  2. Copy whole machine from the phy server in the empty storage
  3. Delete unneeded files like dev, run, sys...
Container wouldend start. After that i copied some samplefiles from an running containers DEV folder. But this didn't help too. What is to do that i'am able to run the machine as container?

What I noticed is that the gentoocontainer from PVE would run with openrc. My phy machine have systemd.
If i start the container in foreground, i get this error:
Code:
lxc-start 123 20180624182541.614 ERROR    lxc_conf - conf.c:run_buffer:347 - Script exited with status 1
lxc-start 123 20180624182541.614 ERROR    lxc_start - start.c:lxc_init:815 - Failed to run lxc.hook.pre-start for container "123"
lxc-start 123 20180624182541.614 ERROR    lxc_start - start.c:__lxc_start:1849 - Failed to initialize container "123"
lxc-start 123 20180624182541.637 ERROR    lxc_container - lxccontainer.c:wait_on_daemonized_start:815 - No such file or directory - Failed to receive the container state
Containerconfig:
Code:
rch: amd64
cores: 8
hostname: troublemaker
memory: 4096
net0: name=eth0,bridge=vmbr0,hwaddr=DA:3F:38:B8:C6:B6,ip=dhcp,ip6=auto,tag=40,type=veth
ostype: gentoo
parent: snap03
rootfs: local-zfs:subvol-123-disk-1,acl=1,size=50G
swap: 2048
pveversion: pve-manager/5.2-2/b1d1c7f4 (running kernel: 4.15.17-3-pve)

Thanks a lot
 
Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 123 lxc pre-start with output: can't open '/etc/inittab' - No such file or directory

seems there is not /etc/inittab ?
 
I have just rebuilt the system with an fresh gentoo lxc template. I think this was the better way, fresh and new :)