安装OpenBMC维护的qemu
x86机器,ubuntu 22 LTS
1.
git clone https://github.com/openbmc/qemu.git
git 不下来的可以试试git clone https://github.com/openbmc/qemu
2.
cd qemu
3.
git submodule update --init dtc
4.
mkdir build
5.
cd build
6.
sudo apt-get install libslirp-dev
7.
../configure --target-list=arm-softmmu --enable-slirp
出现一些问题报错在尝试下述步骤后删除qemu重复1-6:
sudo apt-get install libsdl2-2.0-0 libsdl2-dev
sudo apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev
sudo apt-get install binutils-dev libboost-all-dev autoconf libtool libssl-dev
sudo apt-get install libpixman-1-dev python3 python-pip
此处部分内容参考自:https://blog.csdn.net/nightmarezzh/article/details/123502926
8.
make
9.编译好的qemu-system-arm在arm-softmmu文件夹下,进入该文件夹后可以查看支持的相应机器
./qemu-system-arm -M help
./qemu-system-arm -machine help
10. 以master用户为例,创建软链接,让qemu-system-arm全局可用
sudo ln -s /home/master/qemu/build/arm-softmmu/qemu-system-arm /usr/bin
成功后可以直接使用 qemu-system-arm -M help,不必再在指定路径用 ./
本地启动romulus镜像
sudo qemu-system-arm -m 256 -M romulus-bmc -nographic -drive file=path,format=raw,if=mtd -net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostname=qemu
其中256是指虚拟机内存大小,romulus-bmc是指机型,nographic为无窗口运行,path是指romulus的镜像文件,raw为指定格式,mtd为执行文件类型,-net nic添加一块虚拟的网卡
具体参考:ubuntu下qemu使用:图文详解_ubuntu qemu_MasterHu88的博客-CSDN博客
登录
root
0penBmc