显示选项
◇ -nographic:默认情况下,qemu使用SDL来显示VGA输出;而此选项用于禁止图形接口,此时,qemu类似一个简单的命令行程序,其仿真串口设备将被重定向到控制台;
◇ -curses:禁止图形接口,并使用curses/ncurses作为交互接口;
◇ -alt-grab:使用Ctrl+Alt+Shift组合键释放鼠标;
◇ -ctrl-grab:使用右Ctrl键释放鼠标;
◇ -sdl:启用SDL;
◇ -spice option[,option[,…]]:启用spice远程桌面协议;其有许多子选项,具体请参照qemu-kvm的手册;
◇ -vga type:指定要仿真的VGA接口类型,常见类型有:
cirrus:Cirrus Logic GD5446显示卡;
std:带有Bochs VBI扩展的标准VGA显示卡;
vmware:VMWare SVGA-II兼容的显示适配器;
qxl:QXL半虚拟化显示卡;与VGA兼容;在Guest中安装qxl驱动后能以很好的方式工作,在使用spice协议时推荐使用此类型;
none:禁用VGA卡;
例如:
# qemu-kvm -name test -m 128 -smp 2 -drive file=/root/cirros-0.3.5-x86_64-disk.img,if=virtio,media=disk,cache=writeback,format=qcow2 -nographic -vga cirrus
◇ -vnc
例如:
# qemu-kvm -name test -m 128 -smp 2 -drive file=/root/cirros-0.3.5-x86_64-disk.img,if=virtio,media=disk,cache=writeback,format=qcow2 -vnc 10.0.0.2:0,password -monitor stdio
QEMU 0.12.1 monitor – type ‘help’ for more information
(qemu) change vnc password
Password: *****
(qemu) system_powerdown
(qemu)
display[,option[,option[,…]]]:默认情况下,qemu使用SDL显示VGA输出;使用-vnc选项,可以让qemu监听在VNC上,并将VGA输出重定向至VNC会话;使用此选项时,必须使用-k选项指定键盘布局类型;其有许多子选项,具体请参照qemu-kvm的手册;
display:
(1)host:N
172.16.100.7:1, 监听于172.16.100.7主的5900+N的端口上
(2) unix:/path/to/socket_file
(3) none
options:
password: 连接时需要验正密码;设定密码通过monitor接口使用change
reverse: “反向”连接至某处于监听状态的vncview上;
-monitor stdio:表示在标准输入输出上显示monitor界面
例如:
# qemu-kvm -name test -m 128 -smp 2 -drive file=/root/cirros-0.3.5-x86_64-disk.img,if=virtio,media=disk,cache=writeback,format=qcow2 -vnc 10.0.0.2:0,password -monitor stdio
QEMU 0.12.1 monitor – type ‘help’ for more information
(qemu) change vnc password
Password: *****
(qemu) system_powerdown
(qemu)
-nographic
Ctrl-a, c: 在console和monitor之间切换
Ctrl-a, h: 显示帮助信息
例如:
# qemu-kvm -name test -m 128 -smp 2 -drive file=/root/cirros-0.3.5-x86_64-disk.img,if=virtio,media=disk,cache=writeback,format=qcow2 -nographic
ctrl + a + c