Welcome to the Linux Foundation Forum!

Lab 3.1 chroot not working as expected

I am running Lab 3.1 in a Oracle VM VirtualBox. When I run
sudo chroot /mnt/chroot-ubuntu-xenial/ /bin/bash
I get
chroot: failed to run command '/bin/bash': No such file or directory

How can I resolve this?

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Answers

  • Posts: 2,434

    Hi @holfstephacy,

    What happens if you try running /bin/sh instead?

    Regards,
    -Chris

  • Posts: 32

    you need to copy all the /bin/bash dependencies into your chroot directory before you chroot into that directory otherwise you cannot run anything in the directory

  • Posts: 2,434

    Hi @bdkdavid,

    Provided that the debootstrap command was successfully executed, there would be no need to copy anything into the directory. That is what the debootstrap is doing for you - it populates the filesystem, files and tools of the new isolated/chrooted environment.

    Regards,
    -Chris

  • Posts: 1

    sudo chroot /mnt/chroot-ubuntu-xenial/http://archive.ubuntu.com/ubuntu/ /bin/bash

    this is the solution

  • Posts: 1
    edited February 2023

    Try to run the following command:

    sudo chroot /mnt/chroot-ubuntu-xenial/http:/archive.ubuntu.com/ubuntu/ /bin/bash

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training