Creating chroot environment with an ISO file.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Creating chroot environment with an ISO file.
# 1  
Old 08-24-2012
Creating chroot environment with an ISO file.

I decided to try creating a chroot environment with a BT5r2 iso file. I'm just wanting to run Backtrack from inside Debian without having to reboot into my other partition or use vmware.

I found some documentation on how to do this with BT4 at this link:

http://www.offensive-security.com/ba...-prefinal-iso/

I followed these directions perfectly down this far:

Code:
mkdir -p /root/BUILD 
mv bt4.iso /root/BUILD 
cd /root/BUILD/ 
mkdir mnt 
mount -o loop BT5.iso mnt/ 
mkdir extract-cd rsync --exclude=/casper/filesystem.squashfs -a mnt/ 
extract-cd mkdir squashfs 
mount -t squashfs -o loop 
mnt/casper/filesystem.squashfs squashfs 
mkdir edit 
cp -a squashfs/* edit/ 
cp /etc/resolv.conf edit/etc/ 
cp /etc/hosts edit/etc/ 
cp /etc/fstab edit/etc/ 
mount --bind /dev/ edit/dev 
chroot edit 
apt-get update 
apt-get upgrade

I had already gotten a bt command-line prompt, but when I ran apt-get upgrade I received this error:

Code:
Can not write log, openpty() failed (/dev/pts not mounted?) 
Setting up libc-bin (2.11.1-0ubuntu7.10) ...  Can not write log, openpty() failed (/dev/pts not mounted?) 
(Reading database ... 231201 files and directories currently installed.) 
Preparing to replace libc6 2.11.1-0ubuntu7.8 (using .../libc6_2.11.1-0ubuntu7.10_i386.deb) ... 
/var/lib/dpkg/tmp.ci/preinst: line 312: [: 3.3-2.slh.2-aptosid-686: integer expression expected 
/var/lib/dpkg/tmp.ci/preinst: line 28: 3.3-2.slh.2-aptosid-686: syntax error: invalid arithmetic operator (error token is ".3-2.slh.2-aptosid-686") 
dpkg: error processing /var/cache/apt/archives/libc6_2.11.1-0ubuntu7.10_i386.deb (--unpack):  
subprocess new pre-installation script returned error exit status 1  
/bin/df: cannot read table of mounted file systems: No such file or directory  
Errors were encountered while processing:   
/var/cache/apt/archives/libc6_2.11.1-0ubuntu7.10_i386.deb   
E: Sub-process /usr/bin/dpkg returned an error code (1)

I found some documentation of this error at this link.

As suggested I tried this after getting inside Backtrack:

Code:
# mount -o bind /dev /mnt/dev
# mount -t proc none /mnt/proc

The same problem remained.

Even though this link was for a phone I tried this from inside Backtrack as well:

Code:
# mount -t devpts devpts /dev/pts 
# mount -t proc proc /proc 
# mount -t sysfs sysfs /sys

I'm at a loss at this point so any advice would be much appreciated.

Mod's feel free to move this.

Last edited by Azrael; 08-24-2012 at 04:09 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Iso - remaster script trying to start chroot run commands then exit but host system gets messed up

The script works and creates a modified iso fine until I added the chrootbeg and chrootend functions and executed them. I'm sorry if I did something wrong this is my first post. I uploaded entire bash script for reference or in case you want to run it to debug it is called isoremast.txt. ... (5 Replies)
Discussion started by: paulhoffusa
5 Replies

2. Red Hat

Chroot: cannot execute /bin/sh: No such file or directory

Hi Expert, I'm having grub problem here: grub> root (hd0,0): Filesystem type is ext2 grub> setup Error 11 : Unrecognized Device String I try install boot loader follow the instruction from 26.2. Booting into Rescue Mode It says : select Continue, it attempts to mount your file... (4 Replies)
Discussion started by: justbow
4 Replies

3. Solaris

Creating soalris 9 ISO image with use of downloaded OS

Hi Folks, I have downloaded OS on one of my server and i want to create bootable solaris 9 ISO image with use of this...I need to use this image to other server.,Could you please let us know how we will create ISO image with below OS image.. # cd solaris_9 # ls -alrt total 128 drwxr-xr-x ... (3 Replies)
Discussion started by: susindram
3 Replies

4. UNIX for Advanced & Expert Users

Creating a Custom ISO with Options

Here is the scenario: At work I have been ask to create a custom ISO using UBUNTU as the chosen distro, install our prerequisted packages and present the customer with a choice of options of enabling and disabling services and just in general custom choices that I want to present to the user... (2 Replies)
Discussion started by: metallica1973
2 Replies

5. Red Hat

How to make boot.iso image from rhel6 installation dvd iso ?

Hello Everyone, Can anyone let me know how to make minimal boot.iso from rhl6 installation dvd iso image. I have a dvd image with me but i want to make just a minimal boot media. Somehow it is not shipped with dvd iso. I know we can download boot.iso from redhat site but is there any anyway we... (5 Replies)
Discussion started by: Rohit Bhanot
5 Replies

6. Linux

Creating .iso from DVD problem ( looking for alternatives / suggestions )

I want to be able to copy DVD disks directly to an ISO file from the command line (via bash script). I have such a script that I have refined over time that works quite well about 80% of the time. About two DVD's out of ten will not burn to an iso file, and the script hangs on one of the... (4 Replies)
Discussion started by: jvsrvcs
4 Replies

7. Debian

creating a boot CD (iso file) to debian5

Hi guys, I have used mkbootdisk to create (with -iso option) an iso file for centos servers. I think this commands are only available for redhat's family. Debian brings mkbootbut it only support floppies and not iso format. My question is, is possible to create an iso file on a debian5 server,... (4 Replies)
Discussion started by: iga3725
4 Replies

8. UNIX for Advanced & Expert Users

Chroot jail environment puzzle

I have a simple sandbox program which runs a command as user "nobody" in a chroot jail. It sets resource limits with setrlimit, changes the user id with setuid, changes the root dir with chroot, and then calls exec to execute the command given as command line parameters. It is of course a... (8 Replies)
Discussion started by: john.english
8 Replies

9. AIX

chroot environment

Hi!! I'm currently running AIX 4.3.3 and i'm trying to setup a chroot environment for the users who use SFTP, i spend a lot time SFTW but i can't make it work. I got openssh3.9p1 whit the chroot patch. Any help is greatly appreciated. (0 Replies)
Discussion started by: samurai79
0 Replies
Login or Register to Ask a Question