Ubuntu下用QEMU模拟运行OpenBMC

news2025/3/26 1:35:59

1、前言

        在调试过程中,安装了很多依赖库,具体没有记录。关于kvm,也没理清具体有什么作用。本文仅记录,用QEMU成功的将OpenBMC跑起来的过程,做备忘,也供大家参考。

2、环境信息

VMware® Workstation 15 Pro

sunny@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-150-generic #167~18.04.1-Ubuntu SMP Wed May 24 00:51:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

3、虚拟化设置

进入虚拟机:

1、查看是否支持虚拟化
   sunny@ubuntu:~$ LC_ALL=C lscpu | grep Virtualization
   Virtualization:      VT-x
   Virtualization type: full

2、查看核心数,应该大于0
   sunny@ubuntu:~$ egrep -c '(vmx|svm)' /proc/cpuinfo
   4

3、安装KVM,已经安装过
   sunny@ubuntu:~$ sudo apt install qemu qemu-kvm virt-manager bridge-utils
   [sudo] password for sunny: 
   Reading package lists... Done
   Building dependency tree       
   Reading state information... Done
   bridge-utils is already the newest version (1.5-15ubuntu1).
   qemu-kvm is already the newest version (1:2.11+dfsg-1ubuntu7.42).
   qemu is already the newest version (1:2.11+dfsg-1ubuntu7.42).
   virt-manager is already the newest version (1:1.5.1-0ubuntu1.2).
   The following packages were automatically installed and are no longer required:
     gir1.2-goa-1.0 gir1.2-snapd-1
   Use 'sudo apt autoremove' to remove them.
     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

3、重启虚拟机
    sunny@ubuntu:~$ reboot

4、虚拟机起来后,将用户添加到适当的组中,启用并启动libvirt服务
    sunny@ubuntu:~$ sudo useradd -g $USER libvirt
    sunny@ubuntu:~$ sudo useradd -g $USER libvirt-kvm
    sunny@ubuntu:~$ sudo systemctl enable libvirtd.service
    sunny@ubuntu:~$ sudo systemctl start libvirtd.service
      Synchronizing state of libvirtd.service with SysV service script with         
      /lib/systemd/systemd-sysv-install.
      Executing: /lib/systemd/systemd-sysv-install enable libvirtd

4、安装QENU

1、下载源码
   sunny@ubuntu:~$ wget https://download.qemu.org/qemu-6.2.0.tar.xz

2、解压
   sunny@ubuntu:~$ tar xvJf qemu-6.2.0.tar.xz

3、在下载目录新建文件夹build
   sunny@ubuntu:~$ cd qemu-6.2.0
   sunny@ubuntu:~$ mkdir build 
   sunny@ubuntu:~$ cd build  

4、配置
   sunny@ubuntu:~$ ../configure --enable-kvm  --target-list=arm-softmmu

5、编译
   sunny@ubuntu:~$ make

6、安装
   sunny@ubuntu:~$ make install

7、查看是否安装成功
  sunny@ubuntu:~$ qemu-system-arm --version
    QEMU emulator version 6.2.0
    Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

5、启动OpenBMC

官方OpenBMC镜像下载:
https://jenkins.openbmc.org/job/latest-master/label=docker-builder,target=romulus/lastSuccessfulBuild/artifact/openbmc/build/tmp/deploy/images/romulus/obmc-phosphor-image-romulus.static.mtd

启动并登录:(用户名/密码:root/0penBmc ,0penBmc 首字母是零)

./qemu-system-arm -m 256 -M romulus-bmc -nographic \
 -drive file=./obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \
 -net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu
sunny@ubuntu:~$ qemu-system-arm -m 256 -M romulus-bmc -nographic  -drive file=./obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd  -net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu
qemu-system-arm: warning: nic ftgmac100.1 has no peer


U-Boot 2019.04 (Jan 28 2025 - 06:31:57 +0000)

SOC : AST2500-A1 
RST : Power On 
2nd Boot : Enable
LPC Mode : SIO:Enable : SuperIO-2e
Eth : MAC0: RMII/NCSI, , MAC1: RMII/NCSI, 
Model: Romulus BMC
DRAM:  192 MiB (capacity:256 MiB, VGA:64 MiB, ECC:off)
MMC:   
Loading Environment from SPI Flash... SF: Detected n25q256a with page size 256 Bytes, erase size 4 KiB, total 32 MiB
*** Warning - bad CRC, using default environment

In:    serial@1e784000
Out:   serial@1e784000
Err:   serial@1e784000
Net:   ftgmac100_probe - NCSI detected

Warning: ethernet@1e660000 (eth0) using random MAC address - be:b0:c8:9a:8c:85
eth0: ethernet@1e660000
Hit any key to stop autoboot:  0 

...

romulus login: [  OK  ] Started Hostname Service.
[  OK  ] Finished Phosphor Sysfs - Add LED.
[  OK  ] Finished Phosphor Sysfs - Add LED.
[  OK  ] Finished Phosphor Sysfs - Add LED.
[  OK  ] Finished Wait for /org/openbmc/control/power0.
[  OK  ] Finished Wait for /xyz/openbmc_project/control/host0/auto_reboot.
[  OK  ] Finished Wait for /xyz/openbmc_project/control/host0/boot/one_time.
[  OK  ] Finished Wait for /xyz/openbmc_project/control/host0/boot.
[  OK  ] Finished Wait for /xyz/openbmc_pro…control/host0/power_restore_policy.
[  OK  ] Finished Wait for /xyz/openbmc_project/control/host0/restriction_mode.
[  OK  ] Finished Wait for /xyz/openbmc_project/time/sync_method.

romulus login: root
Password: 
root@romulus:~# pwd
/home/root
root@romulus:~# ps
  PID USER       VSZ STAT COMMAND
    1 root     10896 S    {systemd} /sbin/init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [pool_workqueue_]
    4 root         0 IW<  [kworker/R-slub_]
    5 root         0 IW<  [kworker/R-netns]
    6 root         0 IW   [kworker/0:0-dev]
    7 root         0 IW<  [kworker/0:0H-kb]
    8 root         0 IW   [kworker/u2:0-ev]
    9 root         0 IW<  [kworker/R-mm_pe]
   10 root         0 IW   [rcu_tasks_rude_]
   11 root         0 IW   [rcu_tasks_trace]
   12 root         0 SW   [ksoftirqd/0]
   13 root         0 SW   [kdevtmpfs]
   14 root         0 IW<  [kworker/R-inet_]
   15 root         0 SW   [oom_reaper]
   16 root         0 IW   [kworker/u2:1-ev]
   17 root         0 IW<  [kworker/R-write]
   18 root         0 IW<  [kworker/R-kbloc]
   19 root         0 SW   [watchdogd]
   20 root         0 IW   [kworker/0:1-dev]
   21 root         0 SW   [kswapd0]
   22 root         0 IW   [kworker/0:2-dev]
   23 root         0 IW   [kworker/0:3-eve]
   24 root         0 IW   [kworker/0:4-eve]
   25 root         0 SW   [hwrng]
   26 root         0 SW   [card0-crtc0]
   27 root         0 IW<  [kworker/u3:0]
   28 root         0 IW   [kworker/u2:2-ev]
   29 root         0 IW<  [kworker/R-nbd0-]
   30 root         0 IW<  [kworker/R-nbd1-]
   31 root         0 IW<  [kworker/R-nbd2-]
   32 root         0 IW<  [kworker/R-nbd3-]
   33 root         0 IW<  [kworker/R-nbd4-]
   34 root         0 IW<  [kworker/R-nbd5-]
   35 root         0 IW<  [kworker/R-nbd6-]
   36 root         0 IW<  [kworker/R-nbd7-]
   37 root         0 IW<  [kworker/R-nbd8-]
   38 root         0 IW<  [kworker/R-nbd9-]
   39 root         0 IW<  [kworker/R-nbd10]
   40 root         0 IW<  [kworker/R-nbd11]
   41 root         0 IW<  [kworker/R-nbd12]
   42 root         0 IW<  [kworker/R-nbd13]
   43 root         0 IW<  [kworker/R-nbd14]
   44 root         0 IW<  [kworker/R-nbd15]
   45 root         0 SW   [irq/38-aspeed-v]
   46 root         0 IW<  [kworker/R-mld]
   47 root         0 IW<  [kworker/R-ipv6_]
   89 root         0 SWN  [jffs2_gcd_mtd5]
   99 root         0 IW<  [kworker/0:1H]
  120 root     15644 S    /usr/lib/systemd/systemd-journald
  156 systemd-  7536 S    /usr/lib/systemd/systemd-resolved
  157 systemd- 16348 S    /usr/lib/systemd/systemd-timesyncd
  167 root      3844 S    /usr/lib/systemd/systemd-udevd
  174 systemd-  8800 S    /usr/lib/systemd/systemd-networkd
  220 messageb  6324 S    /usr/bin/dbus-broker-launch --scope system --audit
  222 messageb  2884 S    dbus-broker --log 4 --controller 9 --machine-id d21f666aea624a3b8a37ba09a2631ee3 --max-bytes 536870912 --max-fds 40
  223 avahi     4764 S    avahi-daemon: running [romulus.local]
  224 root     15296 S    /usr/libexec/bmcwebd
  225 root      2980 S    /usr/sbin/klogd -n
  226 root      2980 S    /usr/sbin/syslogd -n
  231 root      3820 S    /usr/sbin/obmc-console-server --config /etc/obmc-console/server.ttyVUART0.conf ttyVUART0
  233 root      6016 S    phosphor-dump-monitor
  235 root     13148 S    /usr/bin/openpower-update-manager
  236 root      3620 S    btbridged
  238 root     41696 S    power_control.exe 3000 10
  239 root     15044 S    /usr/sbin/nscd
  240 root     13828 S    /usr/bin/phosphor-certificate-manager --endpoint truststore --path /etc/ssl/certs/authority --type authority --unit
  242 root     14224 S    /usr/bin/phosphor-certificate-manager --endpoint https --path /etc/ssl/certs/https/server.pem --type server --unit
  245 root     14092 S    /usr/bin/phosphor-certificate-manager --endpoint ldap --path /etc/nslcd/certs/cert.pem --type client --unit
  248 root      6020 S    /usr/bin/phosphor-gpio-monitor --path=/dev/input/by-path/platform-gpio-keys-event --key=135 --polarity=1 --target=i
  260 root     18948 S    /usr/bin/health-monitor
  262 root      9448 S    /usr/libexec/phosphor-led-sysfs/phosphor-ledcontroller
  263 root      5512 S    /usr/sbin/slpd
  265 root      6584 S    /usr/bin/phosphor-srvcfg-manager

6、登录WEB

https://127.0.0.1:2443/

7、SSH登录

sunny@ubuntu:~$ ssh -p 2222 root@127.0.0.1
    The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established.
    ECDSA key fingerprint is SHA256:1qMjJ+TbkvpF17Y8y/R9d+xVUE4lu0nN7YxZHNaQwhU.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
    root@127.0.0.1's password: 

root@romulus:~# pwd
    /home/root

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2320710.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

专题|Python贝叶斯网络BN动态推理因果建模:MLE/Bayes、有向无环图DAG可视化分析呼吸疾病、汽车效能数据2实例合集

原文链接&#xff1a;https://tecdat.cn/?p41199 作为数据科学家&#xff0c;我们始终在探索能够有效处理复杂系统不确定性的建模工具。本专题合集系统性地解构了贝叶斯网络&#xff08;BN&#xff09;这一概率图模型在当代数据分析中的创新应用&#xff0c;通过开源工具bnlea…

Java单例模式中的饿汉模式和懒汉模式

Java单例模式中的饿汉模式和懒汉模式 一、单例模式的显著特点单一实例全局访问 二、饿汉模式&#xff1a;急切的实例创建者三、懒汉模式&#xff1a;延迟的实例构建者1. 不考虑线程安全的初始版本2. 引入同步机制解决线程安全问题3. 优化性能&#xff1a;避免重复进入同步块4. …

理解操作系统(一)冯诺依曼结构和什么是操作系统

认识冯诺依曼系统 操作系统概念与定位 深⼊理解进程概念&#xff0c;了解PCB 学习进程状态&#xff0c;学会创建进程&#xff0c;掌握僵⼫进程和孤⼉进程&#xff0c;及其形成原因和危害 1. 冯诺依曼体系结构 我们常⻅的计算机&#xff0c;如笔记本。我们不常⻅的计算机&am…

Git的认识安装及创建配置本地仓库

目录 Git的作用安装Git创建Git仓库配置本地仓库git config user.name/email(添加配置)以及git config --unset.name/email(删除配置)git config --global user.name/email以及git config --global --unset user.name/email(name和email适用于当前机器的所有Git仓库中) 感谢各位…

【el-upload】el-upload组件 - list-type=“picture“ 时,文件预览展示优化

目录 问题图el-upload预览组件 PicturePreview效果展示 问题图 el-upload <el-uploadref"upload"multipledragaction"#":auto-upload"false":file-list"fileList"name"files":accept".png,.jpg,.jpeg,.JGP,.JPEG,.…

Uthana,AI 3D角色动画生成平台

Uthana是什么 Uthana 是专注于3D角色动画生成的AI平台。平台基于简单的文字描述、参考视频或动作库搜索&#xff0c;快速为用户生成逼真的动画&#xff0c;支持适配任何骨骼结构的模型。Uthana 提供风格迁移、API集成和定制模型训练等功能&#xff0c;满足不同用户需求。平台提…

面试常问系列(二)-神经网络参数初始化之自注意力机制

目录 &#xff08;一&#xff09;、transformer中的自注意力机制为什么要除以根号d&#xff1f; 1. 点积的方差问题 2. 缩放的作用 3. 类比初始化方法 4. 实验验证 5.总结 &#xff08;一&#xff09;、transformer中的自注意力机制为什么要除以根号d&#xff1f; 在Tra…

Linux冯诺依曼体系与计算机系统架构认知(8)

文章目录 前言一、冯诺依曼体系冯•诺依曼体系结构推导内存提高冯•诺依曼体系结构效率的方法你用QQ和朋友聊天时数据的流动过程与冯•诺依曼体系结构相关的一些知识 二、计算机层次结构分析操作系统(Operator System)驱动层的作用与意义系统调用接口(system call)用户操作接口…

LLM之RAG理论(十四)| RAG 最佳实践

RAG 的过程很复杂&#xff0c;包含许多组成部分。我们如何确定现有的 RAG 方法及其最佳组合&#xff0c;以确定最佳 RAG 实践&#xff1f; 论文 《Searching for Best Practices in Retrieval-Augmented Generation》给出了回答。 本文将从以下三方面进行介绍&#xff1a; 首先…

[RoarCTF 2019]Easy Calc-3.23BUUCTF练习day5(2)

[RoarCTF 2019]Easy Calc-3.23BUUCTF练习day5(2) 解题过程 查看源码 发现calc.php页面&#xff0c;访问一下 分析代码 首先获取$_GET[num]的值并赋给变量$str。然后定义了一个黑名单数组$blacklist&#xff0c;包含了一系列被禁止的字符或转义字符&#xff0c;如空格、制表…

hadoop集群配置-ssh无密登录

1.ssh-keygen -t rsa 2.ssh-copy-id hadoop1 3.ssh roothadoop1 退出 exit

MinGW与使用VScode写C语言适配

压缩包 通过网盘分享的文件&#xff1a;MinGW.zip 链接: https://pan.baidu.com/s/1QB-Zkuk2lCIZuVSHc-5T6A 提取码: 2c2q 需要下载的插件 1.翻译 找到VScode页面&#xff0c;从上数第4个&#xff0c;点击扩展&#xff08;以下通此&#xff09; 搜索---Chinese--点击---安装--o…

openharmony中hilog实证记录说明(3.1和5.0版本)

每次用这个工具hilog都有一些小用法记不清&#xff0c;需要花一些时间去查去分析使用方法&#xff0c;为了给丰富多彩的生活留出更多的时间&#xff0c;所以汇总整理共享来了&#xff0c;它来了它来了~~~~~~~~~ 开始是想通过3.1来汇总的&#xff0c;但实际测试发现openharmony…

算法刷题整理合集(七)·【算法赛】

本篇博客旨在记录自已的算法刷题练习成长&#xff0c;里面注有详细的代码注释以及和个人的思路想法&#xff0c;希望可以给同道之人些许帮助。本人也是算法小白&#xff0c;水平有限&#xff0c;如果文章中有什么错误或遗漏之处&#xff0c;望各位可以在评论区指正出来&#xf…

Android Studio控制台中文乱码解决方案

前些天发现了一个蛮有意思的人工智能学习网站,8个字形容一下"通俗易懂&#xff0c;风趣幽默"&#xff0c;感觉非常有意思,忍不住分享一下给大家。 &#x1f449;点击跳转到教程 前言&#xff1a; 在项目调试过程中&#xff0c;用华为手机调试控制台没任何问题&#x…

Cherry Studio搭建本地知识库,结合DeepSeek实现RAG

Cherry Studio搭建本地知识库&#xff0c;结合DeepSeek实现RAG CherryStudioCherryStudio 简介环境准备 模型配置本地知识创建1、新建知识库2、添加文件3、添加网址或者网站4、搜索知识库 结合DeepSeek实现RAG1、选择知识库2、进行提问 常见问题与解决方案 CherryStudio Cherr…

【Android】VehiclePropertyAccess引起CarService崩溃

VehiclePropertyAccess引起CarService崩溃 VehiclePropertyAccess VehiclePropertyAccess属性&#xff0c;用于定义车辆属性的访问权限。权限包括 读&#xff1a;READ&#xff0c;只可以读取&#xff0c;不能写入。 VehiclePropertyAccess:READ写&#xff1a;WRITE&#xf…

深度剖析:复制带随机指针的链表算法实现

在链表相关的算法中&#xff0c;复制一个带有随机指针的链表是一个经典且具有一定难度的问题。本文将深入分析一段用C语言实现的复制带随机指针链表的代码&#xff0c;通过模块化的方式详细解释每段代码的作用&#xff0c;帮助读者更好地理解这一复杂算法。 作者主页&#xf…

Java 大视界 -- Java 大数据在智慧文旅旅游目的地营销与品牌传播中的应用(150)

&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎来到 青云交的博客&#xff01;能与诸位在此相逢&#xff0c;我倍感荣幸。在这飞速更迭的时代&#xff0c;我们都渴望一方心灵净土&#xff0c;而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识&#xff0c;也…

SQLMesh SCD-2 时间维度实战:餐饮菜单价格演化追踪

场景背景&#xff1a;动态菜单价格管理 考虑某连锁餐厅的菜单管理系统&#xff0c;需要记录食品价格的历史变更轨迹。业务需求包括&#xff1a; 记录每次价格调整的时间点支持历史价格查询&#xff08;如"2020年1月2日汉堡多少钱"&#xff09;维护当前有效价格清单…