0

I am trying to emulate Raspberry-pi/Raspbian with QEMU on my linux subsystem. I followed this link and did the following steps

$ mkdir ~/qemu_vms/
Download/copy Raspbian Wheezy to ~/qemu_vms/
Download kernel-qemu to ~/qemu_vms/
$ sudo apt-get install qemu-system
$ file ~/qemu_vms/2013-02-09-wheezy-raspbian.img
From the output of the file command, take the partition 2 'startsector' value an multiply by 512, and use this figure as the offset value in the mount command below.
$ sudo mount ~/qemu_vms/2013-02-09-wheezy-raspbian.img -o offset=62914560 /mnt
$ sudo nano /mnt/etc/ld.so.preload
Comment out the line in the file (use a # as the first character of the line) and save the file (CTRL+X, then "Y" for yes).
$ sudo umount ~/qemu_vms/2013-02-09-wheezy-raspbian.img /mnt

When i ran last command in the above commands, my output was

umount: /mnt: not mounted.

What does this mean? Anyways, thinking i was on the right track, I proceeded and did the following steps

$ cd ~/qemu_vms/
$ qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda ~/qemu_vms/2013-02-09-wheezy-raspbian.img -redir tcp:5022::22

but instead of QEMU giving me a root shell, I got an error with following output

qemu-system-arm: -redir: invalid option

Where exactly am I making a mistake and how can I complete this process successfully?

Incase this process depends on my Linux subsystem, here is the my ubuntu version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

What i currently have in the folder qemu_vms are 2013-02-09-wheezy-raspbian.img and kernel-qemu which i got from here

It would be great if someone could provide a solution to the issue!

1
  • umount: /mnt: not mounted because /mnt is redundant in you umount command: You first unmount the image, then the image's mountpoint. – berndbausch Feb 25 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.