Segmentation fault when building centos 5 chroot [closed]
For some legacy application I decided to use chroot with CentOS 5.
I did install CentOS 5 on virtual machine, then I boot virtual machine with live CD and using tar, I "copied" the files from the virtual disk to my (Linux laptop's) HDD.
Then I tried to chroot, but to my surprise I got "Segmentation fault".
For "host" machine I use Archlinux 64 bit 4.17.13.
CentOS 5 have kernel 2.6.9
Here some info that might be useful:
[nmmm@zenbook c5]$ file centos.5.fs/bin/bash # this is chroot
centos.5.fs/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.9, stripped
[nmmm@zenbook c5]$ file /bin/bash # this is my laptop
/bin/bash: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=42602c973215ba5b8ab5159c527e72f38e83ee52, stripped
On same laptop I use CentOS 7 chroot without any problem.
Do I need some kernel module or something?
Solution 1:
Sounds like what https://vargolino.com/wp/?p=145 is describing: Newer kernels disable LEGACY_VSYSCALL.
Try to boot your live CD with boot parameter "vsyscall=emulate". Using grml, this worked for me:
- On the boot screen, select "Isolinux prompt"
grml vsyscall=emulate
See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907918