Score:0

chroot failed to run command

nl flag

Now after 2 days of pulling my hair it is obvious for me that on other ubuntu machine I can chroot into a VM client (VBOX).

I am trying to chroot from live media to a ubuntu VM client.
I mounted:

mount /dev/sda1 /mnt
mount -o bind /dev /mnt/dev
mount -o bind /dev/pts /mnt/dev/pts
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys

chroot /mnt /bin/bash

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

this image is no longer relevant

I check /bin/bash and *bash is there

enter image description here

Below is an example with chroot on other machines with any live distros to any client (linux-based only).

enter image description here

Did I miss something? Did I missed any libs on first machine? I chrooted with ubuntu live and every time worked flawlessly. Thanks, guys!

Update: Finally works, some libs were missing.

Solved

mook765 avatar
cn flag
What is the meaning of `/dev/sda1 /mnt`, shouldn't it be `mount /dev/sda /mnt`? Your recent mountpoint is not `/mnt` but `/mnt/sda1` as indicated in the screenshot, so it looks as if you didn't setup your chroot correctly.
Brad Thompson avatar
nl flag
thanks, mook765, typo when I posted, corrected now. No, should not be sda (block device) should be sda1 (partition). Why lsblk shows /mnt/sda1 I do not know yet.
zabiullah avatar
cn flag
once try chroot /mnt (dont use /bin/bash after that).
Brad Thompson avatar
nl flag
I did that before, same error
zabiullah avatar
cn flag
ok then try this, mount -o bind /lib /mnt/lib and mount -o bind /lib64 /mnt/lib64
Brad Thompson avatar
nl flag
this is what I was thinking once to create fresh jail. I will try that and let you guys know
Brad Thompson avatar
nl flag
now it is complaining about libtermcap.so.2. ldd /bin/bash does not ask for that. I do not understand how can work on other machine (same ubuntu)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.