首页 > 解决方案 > 错误:Ubuntu 中 Qemu 上的虚拟 Raspbian

问题描述

我正在尝试在我的 linux 子系统上使用 QEMU 模拟 Raspberry-pi/Raspbian。我按照此链接并执行了以下步骤

$ 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

当我在上述命令中运行最后一个命令时,我的输出是

umount: /mnt: not mounted.

这是什么意思?无论如何,认为我走在正确的轨道上,我继续执行以下步骤

$ 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

但是 QEMU 没有给我一个 root shell,而是我得到了以下输出的错误

qemu-system-arm: -redir: invalid option

我到底在哪里犯了错误,我怎样才能成功地完成这个过程?

如果这个过程取决于我的 Linux 子系统,这里是我的 ubuntu 版本:

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

我目前在文件夹qemu_vms中的2013-02-09-wheezy-raspbian.img内容是kernel-qemu我从这里得到的

标签: linuxassemblyraspberry-piarmqemu

解决方案


推荐阅读