6

I'm following these instructions to make a debian.img in a ubuntu 18.04 on a virtual box build

  1. On the PC, create a folder and generate a formatted, mountable image.
  2. Install a Debian Buster linux inside the chroot environment with the debootstrap command.
  3. Upload this image (debian.img) to your web server to download it later

The link to the site here

mkdir -p webkey/tutorial
cd webkey/tutorial
dd if=/dev/zero of=debian.img bs=1024 count=614400
sudo mkfs.ext2 -F debian.img
sudo tune2fs -c0 debian.img
mkdir debian
sudo mount -o loop debian.img debian/
sudo debootstrap --verbose --foreign --arch armel buster debian http://ftp.de.debian.org/debian
sudo chroot debian
export LC_ALL=C
debootstrap/debootstrap --second-stage

I have done everything upto

sudo chroot debian

When i enter this it gives me

chroot: failed to run command '/bin/bash': No such file or directory

I have read all the posts about chroot and this error none of these solutions does not seem to work for me. Or maybe I am doing something wrong.

Thanks for your time and expertise.

5
  • 2
    Have you had a look at the second solution in your link? It seems to me to be the most likely: make sure that all of the dependencies of /bin/bash are mounted in the chroot: sudo mount -o bind /usr debian/usr, sudo mount -o bind /lib debian/lib and sudo mount -o bind /lib64 debian/lib64.
    – Kurankat
    Mar 16, 2020 at 3:25
  • echo $PATH and chroot is /usr/sbin/chroot Mar 16, 2020 at 3:59
  • I cant seem to mount with sudo mount -o bind /usr debian/usr . It say mount: debian/usr: mount point does not exist. It must be becuase that carpet is inside the debian.img maybe there is a command i can use to insert it inside the .img that I dont know I am total noob Mar 16, 2020 at 21:48
  • I had manually copy these folders to folder debian where the debian.img was and was able to run the mount chroot debian command. Thank you so much Mar 16, 2020 at 22:10
  • But on the last line of code debootstrap/debootstrap --second-stage it gives me this bash: debootstrap/debootstrap: No such file or directory. Please help me Mar 16, 2020 at 22:12

0

You must log in to answer this question.

Browse other questions tagged .