找回密码
 注册
查看: 350|回复: 0

kvm虚机添加console方式获取vnc连接

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-9-22 15:00:01 | 显示全部楼层 |阅读模式
在xml文件中添加如下信息:
! o% ]. r' U' C# @- b* p<serial type='file'>; W% U. }3 |' ]% ~; C
      <source path='/var/lib/nova/instances/windows2019/console.log'/>4 p- U3 B# s1 E+ U! Y
      <target port='0'/>
/ t  V& g) {8 {) |2 ~      <alias name='serial0'/>
5 _# x! m" m5 d2 x$ I    </serial>
  p# c" R1 e! _- x- a$ J( U1 h( l    <serial type='pty'>
% R; k9 P  _3 l( X$ T' Z      <source path='/dev/pts/0'/>
/ Q3 B) N& |! R+ Y* z      <target port='1'/>
  w  @7 T# m. n5 b$ L+ D% ^      <alias name='serial1'/>8 Z9 t; S6 {; V2 C2 \
    </serial>
: v0 o$ N! V$ n    <console type='file'>$ e5 [/ b; A7 h# K& d
      <source path='/var/lib/nova/instances/windows2019/console.log'/>
3 i7 X/ {( L" P# k5 d      <target type='serial' port='0'/>0 t: o0 m( y4 }5 e
      <alias name='serial0'/>
( |1 d" w, ^. I6 D  v7 ]    </console>
: S' w3 ~' ?: X    <input type='tablet' bus='usb'>7 ~3 f* M" g* z. c4 ]: |
      <alias name='input0'/>0 \6 c3 [/ W3 x0 {! ?2 y8 c
    </input>
! n- N% ?( x9 u    <input type='mouse' bus='ps2'/>
+ E  A2 O: l2 S! w    <graphics type='vnc' port='5909' autoport='yes' listen='0.0.0.0' keymap='en-us'>
2 A9 L/ j9 N& R( U, r! Z- z% K0 l5 i      <listen type='address' address='0.0.0.0'/>
2 T# H7 p4 H: _. g" f( M. Z& u( k# S    </graphics>
/ H& F/ w0 _. @, c# z' j3 ]  Z0 D/ V
保存退出:
3 N. O$ ~4 E# W1 g+ \
& p8 c/ h4 D. V' gvirsh destroy 虚机0 P& \/ o/ ?; a( |8 d& Q4 L

5 F* U6 {! ?* L& hvirsh start 虚机即可正常使用。6 L8 ?2 x1 s' j6 k2 J

2 y  I9 j% p0 G) Z, q
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:52 , Processed in 0.015726 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表