Chroot onto ARM based image
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
I'm trying to do some work on an image for a raspberry pi, but I don't have access to the pi itself, just the SD card that runs the OS.
I'd like to chroot onto the pi's SD card (mainly to run some pip commands), but I'm getting errors with bash :
chroot: failed to run command âÂÂ/bin/bashâÂÂ: Exec format error
I assume this is because the programs are compiled for the pi's processor and not mine.
The only thought I have is changing the $PATH
to point to my /bin
, but I can't imagine that being good practice or safe in any way
Is there a way to make this work?
sd-card chroot
add a comment |Â
up vote
1
down vote
favorite
I'm trying to do some work on an image for a raspberry pi, but I don't have access to the pi itself, just the SD card that runs the OS.
I'd like to chroot onto the pi's SD card (mainly to run some pip commands), but I'm getting errors with bash :
chroot: failed to run command âÂÂ/bin/bashâÂÂ: Exec format error
I assume this is because the programs are compiled for the pi's processor and not mine.
The only thought I have is changing the $PATH
to point to my /bin
, but I can't imagine that being good practice or safe in any way
Is there a way to make this work?
sd-card chroot
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to do some work on an image for a raspberry pi, but I don't have access to the pi itself, just the SD card that runs the OS.
I'd like to chroot onto the pi's SD card (mainly to run some pip commands), but I'm getting errors with bash :
chroot: failed to run command âÂÂ/bin/bashâÂÂ: Exec format error
I assume this is because the programs are compiled for the pi's processor and not mine.
The only thought I have is changing the $PATH
to point to my /bin
, but I can't imagine that being good practice or safe in any way
Is there a way to make this work?
sd-card chroot
I'm trying to do some work on an image for a raspberry pi, but I don't have access to the pi itself, just the SD card that runs the OS.
I'd like to chroot onto the pi's SD card (mainly to run some pip commands), but I'm getting errors with bash :
chroot: failed to run command âÂÂ/bin/bashâÂÂ: Exec format error
I assume this is because the programs are compiled for the pi's processor and not mine.
The only thought I have is changing the $PATH
to point to my /bin
, but I can't imagine that being good practice or safe in any way
Is there a way to make this work?
sd-card chroot
sd-card chroot
asked Feb 16 at 16:32
![](https://lh5.googleusercontent.com/-BO8B82i2_3s/AAAAAAAAAAI/AAAAAAAAADE/rFZk81Re8II/photo.jpg?sz=32)
![](https://lh5.googleusercontent.com/-BO8B82i2_3s/AAAAAAAAAAI/AAAAAAAAADE/rFZk81Re8II/photo.jpg?sz=32)
Brydon Gibson
1284
1284
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
It is possible.
You need to install qemu-user-static
on your x86/x86_64 computer:
sudo apt-get install qemu-user-static
Let's assume that your rootfs is mounted to /mnt
.
Then try:
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
cd /mnt
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts
#sudo rm /mnt/etc/ld.so.preload # not sure about this
sudo chroot .
Can you expand on theld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?
â Brydon Gibson
Feb 16 at 17:34
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It is possible.
You need to install qemu-user-static
on your x86/x86_64 computer:
sudo apt-get install qemu-user-static
Let's assume that your rootfs is mounted to /mnt
.
Then try:
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
cd /mnt
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts
#sudo rm /mnt/etc/ld.so.preload # not sure about this
sudo chroot .
Can you expand on theld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?
â Brydon Gibson
Feb 16 at 17:34
add a comment |Â
up vote
0
down vote
It is possible.
You need to install qemu-user-static
on your x86/x86_64 computer:
sudo apt-get install qemu-user-static
Let's assume that your rootfs is mounted to /mnt
.
Then try:
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
cd /mnt
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts
#sudo rm /mnt/etc/ld.so.preload # not sure about this
sudo chroot .
Can you expand on theld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?
â Brydon Gibson
Feb 16 at 17:34
add a comment |Â
up vote
0
down vote
up vote
0
down vote
It is possible.
You need to install qemu-user-static
on your x86/x86_64 computer:
sudo apt-get install qemu-user-static
Let's assume that your rootfs is mounted to /mnt
.
Then try:
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
cd /mnt
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts
#sudo rm /mnt/etc/ld.so.preload # not sure about this
sudo chroot .
It is possible.
You need to install qemu-user-static
on your x86/x86_64 computer:
sudo apt-get install qemu-user-static
Let's assume that your rootfs is mounted to /mnt
.
Then try:
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
cd /mnt
sudo mount --bind /dev dev/
sudo mount --bind /sys sys/
sudo mount --bind /proc proc/
sudo mount --bind /dev/pts dev/pts
#sudo rm /mnt/etc/ld.so.preload # not sure about this
sudo chroot .
edited Feb 16 at 17:59
answered Feb 16 at 16:37
N0rbert
16.6k33378
16.6k33378
Can you expand on theld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?
â Brydon Gibson
Feb 16 at 17:34
add a comment |Â
Can you expand on theld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?
â Brydon Gibson
Feb 16 at 17:34
Can you expand on the
ld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?â Brydon Gibson
Feb 16 at 17:34
Can you expand on the
ld.so.preload
? Would it only be a bad idea because it may load something that I need in the chroot?â Brydon Gibson
Feb 16 at 17:34
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1006846%2fchroot-onto-arm-based-image%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password