运行qemu虚拟机报错Could not initialize SDL(No available video device)

运行代码:

qemu-system-x86_64 -pflash bios.bin -hda fat:rw:hda-contents -net none

报错:

vvfat hda-contents chs 1024,16,63
WARNING: Image format was not specified for 'json:{"fat-type": 0, "dir": "hda-contents", "driver": "vvfat", "floppy": false, "rw": true}' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
Could not initialize SDL(No available video device) - exiting

原因:

由于 QEMU 需要一个视频设备来显示其图形输出,而在一个没有图形界面的服务器上(如大多数 Ubuntu 服务器),这个需求无法满足。

解决办法:

解决这个问题的一个方法是使用 QEMU 的无头模式(headless mode),这意味着 QEMU 将运行在没有图形输出的模式下。可以通过添加 -nographic 选项来启用这个模式。

qemu-system-x86_64 -pflash bios.bin -hda fat:rw:hda-contents -net none -nographic

qemu无头模式常用命令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值