Running NCM in chroot mode

Contents

 

Steps involved in running your NCM Server in Chroot Mode

 

1. For Mounting partition execute the below commands

The root partition of the Linux system that you are trying to chroot into needs to be mounted first. To find out the device name assigned by the kernel, run:

# lsblk

Then create a directory for mounting the root partition to, and mount it:

# mkdir /NCM/test1

# mount /dev/sda1 /NCM/test1

 

 

 

2. For enabling chroot execute the below commands

Mount the temporary API filesystems:

# cd /NCM/test1

# mount -t proc proc proc/

# mount --rbind /sys sys/

# mount --rbind /dev dev/

# mount --rbind /run run/
 

To use an internet connection in the chroot environment copy over the DNS details:
 

# cp /etc/resolv.conf etc/resolv.conf

To change root into a bash shell:

# chroot /NCM/test1 /bin/bash
 

After chrooting it may be necessary to load the local bash configuration:
 

# source /etc/profile

# source ~/.bashrc
 

 

 

 

 

3. Exit from the chroot environment

To exit the chroot environment, use the following command:

#exit

Last, unmount the temporary filesystems and the root partition:

#cd /

#umount --recursive /NCM/test1

 

Note:-

If you get the below error message while executing proc command:
 

Error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Then, execute the following command:

mount -t proc none /proc

 

Reference:-

  1. https://wiki.archlinux.org/index.php/change_root#Exit_from_the_chroot_environment

  2. https://superuser.com/questions/487695/java-wont-run-under-chroot-cause-it-can-not-find-shared-libraries

Was this article helpful?