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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-9-22 15:00:01 | 显示全部楼层 |阅读模式
在xml文件中添加如下信息: 4 R, j( @' m3 r
<serial type='file'>& V' ~1 ^* D+ @; ^( s) _
      <source path='/var/lib/nova/instances/windows2019/console.log'/>7 s3 [/ P3 M% b/ t
      <target port='0'/>6 l$ X3 o1 `' x) P0 E% \& d' m
      <alias name='serial0'/>
+ ^- I2 a! c, u9 Q    </serial>
# H% ?9 w1 m7 g  C, L4 s/ g! |% |    <serial type='pty'>
% [6 c5 p0 ^: k6 v9 S- a      <source path='/dev/pts/0'/>
5 p; Q8 m4 e( \0 ~1 o      <target port='1'/>. e& F0 q" ]8 x$ U4 N; d* D
      <alias name='serial1'/>: v" P$ V- o* c8 T  y
    </serial>
( G/ ~: T: c  v/ J$ o( @; M: e6 _- h    <console type='file'>
* F9 U0 l- b7 f" |  ?% q! T2 Y      <source path='/var/lib/nova/instances/windows2019/console.log'/>
# d: e* y" o0 w% r4 R      <target type='serial' port='0'/>
' \* f- g$ W2 d1 {+ o' Y6 f+ f/ v      <alias name='serial0'/>
% s. K3 k1 z- S" W6 }    </console>
* K" ~8 o5 w, Q$ m6 T) U    <input type='tablet' bus='usb'>
& V, Q) _% q7 S5 W3 M& y! J7 M      <alias name='input0'/>% ~: C6 E" ~- _! `2 T
    </input>/ A+ w6 f6 j% B, E. K
    <input type='mouse' bus='ps2'/>
; q4 }1 l/ k" m; j7 s    <graphics type='vnc' port='5909' autoport='yes' listen='0.0.0.0' keymap='en-us'>
2 c* D" N4 d7 k3 i+ H# \      <listen type='address' address='0.0.0.0'/>
( O' s8 S9 {0 r8 T2 v& @- @    </graphics>
' P* W: Q* P  [8 g4 i, G5 U/ f1 ]
9 d* h6 i2 p$ M: h# Q6 D8 O3 A保存退出:
( l* m$ h7 k; x" K& W$ ]
( X" L/ ~$ {# o, B/ X3 L- I$ jvirsh destroy 虚机
- p" j3 E: M- C# L
' U9 _3 M" P' G+ J8 _0 \/ h4 N- ?- N& gvirsh start 虚机即可正常使用。+ T3 N# B! c6 V$ d! z
9 L# I; V2 X4 I+ p, E
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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