免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3266 | 回复: 4
打印 上一主题 下一主题

[KVM] 求助:kvm启动虚拟机,控制台失去响应 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-01-05 18:33 |只看该作者 |倒序浏览
本帖最后由 zhengb302 于 2013-01-05 18:34 编辑

如题,自己写了个脚本来启动虚拟机,能启动成功,但执行脚本的那个终端失去响应。其实还是可以响应的,只是输入的字符看不到,按Enter键却能照样执行。比如在执行脚本之后,敲入 ls ,在控制台上看不到,光标也不会移动,但按Enter键之后,却能列出文件列表。脚本内容如下:

#!/bin/bash

# start debian6

MEMSIZE=384
VMDIR=$(dirname $0)
DISKFILE=$VMDIR/debian6.img
MACADDR=52-54-00-12-34-56

kvm -m $MEMSIZE -drive file=$DISKFILE,media=disk \
        -net nic,macaddr=$MACADDR -net tap,ifname=tap0,script=no \
        -boot order=c -no-fd-bootchk -nographic -daemonize

论坛徽章:
0
2 [报告]
发表于 2013-01-05 20:07 来自手机 |只看该作者
help, help

论坛徽章:
0
3 [报告]
发表于 2013-01-06 08:18 |只看该作者
本帖最后由 zhengb302 于 2013-01-06 08:22 编辑

嘿嘿,经过尝试,发现使用 -display none 参数代替 -nographic 就没这个问题了。附上这两个参数的说明:

-display type
           Select type of display to use. This option is a replacement for the old style -sdl/-curses/... options. Valid values for type are

           sdl Display video output via SDL (usually in a separate graphics window; see the SDL documentation for other possibilities).

           curses
               Display video output via curses. For graphics device models which support a text mode, QEMU can display this output using a
               curses/ncurses interface. Nothing is displayed when the graphics device is in graphical mode or if the graphics device does not
               support a text mode. Generally only the VGA device models support text mode.

           none
               Do not display video output. The guest will still see an emulated graphics card, but its output will not be displayed to the QEMU
               user. This option differs from the -nographic option in that it only affects what is done with video output; -nographic also
               changes the destination of the serial and parallel port data.

           vnc Start a VNC server on display <arg>

-nographic
           Normally, QEMU uses SDL to display the VGA output. With this option, you can totally disable graphical output so that QEMU is a simple
           command line application. The emulated serial port is redirected on the console. Therefore, you can still use QEMU to debug a Linux
           kernel with a serial console.

论坛徽章:
2
狮子座
日期:2014-01-17 09:09:212015年迎新春徽章
日期:2015-03-04 09:58:11
4 [报告]
发表于 2013-01-06 14:16 |只看该作者
哦,知道原因吗?

论坛徽章:
0
5 [报告]
发表于 2013-01-06 16:50 |只看该作者
回复 4# cnvbird


    不知道,我估计跟这一行文字相关:The emulated serial port is redirected on the console.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP