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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-9-22 15:00:01 | 显示全部楼层 |阅读模式
在xml文件中添加如下信息:   W+ H  W0 Z9 k5 C
<serial type='file'>9 s# B$ _! F. `% h* g
      <source path='/var/lib/nova/instances/windows2019/console.log'/>
+ b2 h' k& p5 L  o3 ?) \      <target port='0'/>
1 h( S1 ?0 S+ \( m0 ?9 J8 O" P      <alias name='serial0'/>6 m! h* y1 P8 }: s
    </serial>. J. H( c# O% I) N6 j- s1 W
    <serial type='pty'>! ~4 j+ m; g. b4 s7 }! m
      <source path='/dev/pts/0'/>
9 @+ s  O" X: f9 r. I% Y      <target port='1'/>) G; q; q9 L' z3 @) `  V. X
      <alias name='serial1'/>  p$ e  X, X3 M! W2 p% L5 O# n
    </serial>
1 k/ p1 O! @0 N; I    <console type='file'>
  M4 S; Q. B1 E% K# E      <source path='/var/lib/nova/instances/windows2019/console.log'/>$ ]* E/ M" y- |( f) `5 I8 D
      <target type='serial' port='0'/>& t8 V2 A+ z7 r
      <alias name='serial0'/>: W$ E8 `. q  k, E# s  \4 R
    </console>. }, n) R  Z0 m( U" a, h2 V# e% N
    <input type='tablet' bus='usb'>3 y3 d% B8 Y: U
      <alias name='input0'/># ], ^, j$ P4 u- ^, a" ?
    </input>
1 L7 C6 L1 f1 ?. e/ R/ B    <input type='mouse' bus='ps2'/>% K4 ?1 S# J% i
    <graphics type='vnc' port='5909' autoport='yes' listen='0.0.0.0' keymap='en-us'>
  n2 T; g- N7 g! f6 O0 C      <listen type='address' address='0.0.0.0'/>
3 S$ b0 w2 g8 u4 P. w8 @  t    </graphics>" i8 F' {3 p4 P8 x, [
) m0 ~% i* S; c5 [% c
保存退出:, _( h5 v% v& N
8 R! j6 h1 f: ?8 U- v$ b
virsh destroy 虚机" x8 k3 v( k3 S2 t
4 ^. |. s! j" \! M4 e
virsh start 虚机即可正常使用。
0 a% K, W  S7 A5 j! |8 Y/ M; f+ S( j; h7 u2 O2 E- i6 o1 o
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:27 , Processed in 0.017429 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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