找回密码
 注册
查看: 4780|回复: 3

error: internal error: cannot find character device <null> virsh console报

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-9-13 10:39:09 | 显示全部楼层 |阅读模式
virsh console 报错* V  h: i, m' Y" ?6 k8 Y6 @% y
error: internal error: cannot find character device <null>& |/ R+ D- I# T1 z6 d9 Y
Error "internal error cannot find character device" when trying to connect a domain's consoleSymptom% virsh console test2 Connected to domain test2 Escape character is ^] error: internal error cannot find character device (null)% e9 d- l- y$ }( C2 K
InvestigationThe error tells there is no serial console configured for the domain.SolutionSetup serial console in the domain's XML.1) Add the following XML in domain's XML (using "virsh edit") NOTE: It's necessary to write this in the <devices>-Section. <serial type='pty'>   <target port='0'/> </serial> <console type='pty'>   <target type='serial' port='0'/> </console>2) Setup console in guest kernel command line, you can login into the guest to edit /boot/grub/grub.conf directly, or using tool "virt-edit". Append following to the guest kernel command line: console=ttyS0,1152003) % virsh start vm --console

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:12 | 显示全部楼层
解决办法:9 i, S. z8 J. U. u( L
通过virsh edit 修改xml文件,添加如下信息,即可:
8 d# e( E' f; f' q; g    <interface type='bridge'>6 A0 A) P$ Z( j$ W2 Y
      <mac address='52:54:00:af:49:04'/>
3 q% d9 X0 \# w! g* B; n7 s6 [      <source bridge='vpc-connection'/>
  j2 {1 G2 K' o1 t! \( Z      <target dev='peer-175.73'/>
, [( w1 @- n) u" `* L$ v, {1 Q      <model type='virtio'/>* t  v0 h2 P; V) H
      <driver name='qemu'/>
8 {9 R) g7 v  |9 e( ?$ {      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>1 B8 `* L/ [# w2 e) ^2 U* h8 u
    </interface>. \" i: I. j9 d( b* k: ], p
    <serial type='pty'>+ d8 w/ V: w- _0 W# ?- ]
      <target port='0'/>; g  U) M* c3 Z
    </serial>: G$ |6 z- h% S: a
    <console type='pty'>+ Y3 m- T9 d  N- \4 O* }  I* r$ t
      <target type='serial' port='0'/>2 a% U# X# U% e5 J* V0 H$ p
    </console>
% {& Q  T, i* l3 P3 ~+ X    <channel type='spicevmc'>) n0 V) f% u# E  T
      <target type='virtio' name='com.redhat.spice.0'/>
  Z9 N' T1 M2 M7 b- T      <address type='virtio-serial' controller='0' bus='0' port='1'/>
. r+ m3 Q: N6 c8 ~+ {    </channel>/ v; I, k6 K; `5 O# L+ A
修改完成后保存:
8 F/ p, w- K9 }5 R+ D9 ^5 ~+ I% r5 `vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
; z2 X% \! o+ A. O& ^! L) S4 r* N) ^3 r$ W" L* E( r2 z
/ p; {, g" h$ O4 p: X
重启kvm虚机:2 W$ r; p2 k# J# |
virsh destroy xxx- \; J5 u" Y/ I' K, B- g3 L
virsh start xxx
; ]& ^+ B8 X" r, h- _+ z1 `  `

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:30 | 显示全部楼层
解决办法:* S3 ^! B; z4 N% c, S5 `* f
通过virsh edit 修改xml文件,添加如下信息,即可:2 m/ h. N( t, U# n9 I4 c+ [! i8 @. b
    <interface type='bridge'>
  L* U; X+ Q5 P1 ]5 Z2 S. [. Z; P      <mac address='52:54:00:af:49:04'/>0 E  B4 K, @) U- N+ A; A6 o/ o
      <source bridge='vpc-connection'/>
4 @8 `% D; ~% C* e* l! g, Q      <target dev='peer-175.73'/>
/ W- R% D1 o; g0 G9 u$ {      <model type='virtio'/>
0 b# _3 _" R. x  x  z# |      <driver name='qemu'/>3 ?5 U% w# H- X: x
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
4 @$ _9 }2 L, K- g9 {  s% f    </interface>
5 |8 I9 I) p; h* X( l1 u* i4 q    <serial type='pty'>
0 s0 C0 k( ^9 D      <target port='0'/>$ n# v8 ]; z- N1 L
    </serial>+ B! B. t' X8 S8 ?8 A" y
    <console type='pty'>  o( G9 L( A( z, @1 S3 n# W
      <target type='serial' port='0'/>! E8 c+ q8 Y$ [& q* g
    </console>0 m) J+ P* g( p" E
    <channel type='spicevmc'>; B; y' j3 z2 N% D4 Q
      <target type='virtio' name='com.redhat.spice.0'/>
) n4 j" A- l( L9 P+ c% B% @      <address type='virtio-serial' controller='0' bus='0' port='1'/>4 S( |% m7 J  P' @+ Q# l* U1 w
    </channel>
9 e) J, H! h. I; A; v8 W4 e修改完成后保存:0 x2 ^' t1 b. _: W
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
# U, f0 I3 N- n- }6 |+ y3 ~' d- b. }) c* V% K4 L% ]1 T% G9 k! L4 f  H
+ X& a3 v  P: ]7 r, ?# B- {+ c
重启kvm虚机:
6 G; x, i# R7 p; Y7 z, Xvirsh destroy xxx3 {. M8 y/ \7 o( W
virsh start xxx4 E5 i! |* I5 j! o1 f* Y

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:34 | 显示全部楼层
解决办法:: l' |8 m* `% l0 ?
通过virsh edit 修改xml文件,添加如下信息,即可:( X. p. e. A. x3 v
    <interface type='bridge'>( n" n$ t& F+ Z8 {+ z- g( R. G( @
      <mac address='52:54:00:af:49:04'/>7 L/ T7 G* s/ d
      <source bridge='vpc-connection'/>3 E7 @& ]5 C* j! v: F# G8 I1 b% W% y
      <target dev='peer-175.73'/>5 o0 U. M3 C2 Y) U+ f5 v/ @# E
      <model type='virtio'/>/ U  L3 L: m9 v) t$ @( r
      <driver name='qemu'/>
6 Z5 {0 R# r4 o2 y+ ^2 B) J      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
: \2 i, ~4 S! r  ]4 A    </interface>, C+ b9 ~9 o) ]8 u+ O
    <serial type='pty'>
, d5 h2 |! N2 C/ \1 M/ o      <target port='0'/>$ E$ v# _& ~1 U1 t+ G
    </serial>  s7 L. r3 n* y' T) D: o  c
    <console type='pty'>
3 n% u5 b. C2 N  k* M  @' v      <target type='serial' port='0'/>
0 M$ Y7 D; y8 L    </console>
5 |9 E1 z7 x$ G) V6 [    <channel type='spicevmc'>
8 j  l5 Z5 r# T' P      <target type='virtio' name='com.redhat.spice.0'/>4 m# |; [. L/ ~1 w  Z$ q
      <address type='virtio-serial' controller='0' bus='0' port='1'/>6 W4 c9 ~" d/ d" m; g* C' G/ H. |
    </channel>
- ?& k* L) T0 @# Z& j! v修改完成后保存:$ c0 B) d8 f. G4 W7 G
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确/ N5 M3 X5 x1 V- S, t) ^( M  ^- w

3 s; q" b2 E) n9 y1 g
" ~, q( Y+ c1 D0 e  p( B" ~  {6 C9 C7 I重启kvm虚机:
& L. n/ p/ @3 X, ovirsh destroy xxx5 u1 k5 E- u. A* N
virsh start xxx
8 m; b7 Q  }! o
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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