我在没有 GUI 的 Linux 上运行 QEMU。
使用 QEMU 运行启动我的自定义内核后,我无法通过按 Ctrl+C 杀死并返回到主机。
有没有办法回到主机操作系统?
Cir*_*郝海东 83
Ctrl-A X
对于-nographic
刚进入:
Ctrl-A X
Run Code Online (Sandbox Code Playgroud)
意思是
或者:
进入 QEMU 监视器,Ctrl-A C
然后输入:
quit
Run Code Online (Sandbox Code Playgroud)
并按回车键。另见:https : //stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses
使用 QEMU 监视器(与 相同Ctral-A C
)telnet
:
qemu-system-x86_64 -monitor telnet::45454,server,nowait -serial mon:stdio
Run Code Online (Sandbox Code Playgroud)
并在主机终端上:
telnet localhost 45454
Run Code Online (Sandbox Code Playgroud)
然后quit
从那里。
-serial mon:stdio
需要保持 Ctrl+C 工作:https : //stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc -to/49751144#49751144
正常情况下从来宾关闭虚拟机,例如,powerdown
如果可以,使用来自 Linux 来宾 shell的命令。这或当然会通过正常的关闭顺序而不是立即杀死 VM,但有时它只是最简单的方法。
然而,它不适用于所有机器:https : //stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve
在 Ubuntu 17.10、QEMU 2.10.1 中测试。
好的,找到解决方案了。
归档时间: |
|
查看次数: |
58052 次 |
最近记录: |