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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-9-13 10:39:09 | 显示全部楼层 |阅读模式
virsh console 报错
& W$ V3 k2 ?& N/ @% qerror: internal error: cannot find character device <null>0 ?6 H6 x* M4 _: O
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)
7 p: U; r# Q' X1 o5 k4 u, C4 L( ~* mInvestigationThe 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 | 显示全部楼层
解决办法:, e: Q+ F( b+ H5 H+ I
通过virsh edit 修改xml文件,添加如下信息,即可:
0 K: f# m- F' ]4 ^+ p2 Z    <interface type='bridge'>
& B2 H* `% m4 K  U. T2 k      <mac address='52:54:00:af:49:04'/>
8 }5 K4 C6 L6 f. j, |      <source bridge='vpc-connection'/>
6 |' Y5 D' z& h; }; B( Y( w      <target dev='peer-175.73'/>5 {6 U) A" {6 u' n* @" \$ a
      <model type='virtio'/>
' a9 S" N: d8 p( ^      <driver name='qemu'/>
( h- r% [; o8 N$ A      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
/ |1 J! D6 m7 L$ e    </interface>
( w4 a, F, X; m( w6 Q: Q    <serial type='pty'>4 f% W" C& f4 F' `8 }: ?
      <target port='0'/>
+ z8 w5 |8 }9 M$ ^    </serial>' B2 j# s, c7 \9 x
    <console type='pty'>
4 B3 f- F: W: Y, @2 W      <target type='serial' port='0'/>
3 Y& G0 L! }6 i! c  s    </console>
4 q) s1 [6 s& P. ]4 x" v' j    <channel type='spicevmc'>) U# Y3 _# \+ W% X0 w: \! u
      <target type='virtio' name='com.redhat.spice.0'/>  j1 S; A4 U6 }0 X
      <address type='virtio-serial' controller='0' bus='0' port='1'/>+ a1 h9 {2 s. P6 q6 z+ q
    </channel>" Z" M4 X% |" X  I# @) g
修改完成后保存:- X3 L0 Z' o1 l$ S- G
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确! c* v& d% T* c$ _  ?7 v# E

9 i" A% Z9 A, [- x" C# K; _$ R3 ]
" z& y4 a; e  C6 y3 u, D: Y重启kvm虚机:) M/ y! B8 E. c" g" c+ y8 \
virsh destroy xxx% {- r3 X) G6 D) c* ?. S
virsh start xxx# s2 c. w* [. W" F

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:30 | 显示全部楼层
解决办法:
- F9 z; }: {+ _3 C& I  Q通过virsh edit 修改xml文件,添加如下信息,即可:
: ?% k  l# p5 ]) E6 K" `8 c    <interface type='bridge'>; }) p3 T. z& ~. i' V
      <mac address='52:54:00:af:49:04'/>- h* _4 `7 T4 d1 D- q  a8 ^9 Z1 H
      <source bridge='vpc-connection'/>+ W, |) b% \. |# z! k6 u8 V- u6 e
      <target dev='peer-175.73'/>; @; Y: t9 D: ?1 F: t/ V" g
      <model type='virtio'/>  H( v+ h, R- t; |1 C- D' A- i
      <driver name='qemu'/>
( Y0 ?+ F  H  }3 B) W) m1 f      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
) V8 Q6 ^  A2 u- R1 e4 p    </interface>
& V- m/ ~2 [! i& k4 g6 a    <serial type='pty'>, Y0 J( b8 i8 P& x
      <target port='0'/>
6 ]. a4 K8 P" ~    </serial>3 R7 _+ p& E" {/ f& Q& M4 ^
    <console type='pty'>
& Y+ ~# {2 e3 f: u' v: |4 z! f0 q, u3 e      <target type='serial' port='0'/>
, p) u) [# }7 w9 L& w) f    </console>1 l- @8 @/ t* \3 T( x8 Z$ A! f
    <channel type='spicevmc'>
3 k% K$ \9 i: G! p# _: ^      <target type='virtio' name='com.redhat.spice.0'/>
. f# V6 a: W7 H" X      <address type='virtio-serial' controller='0' bus='0' port='1'/>! C! N8 T2 u4 Y, g
    </channel>
7 \, R. w# X+ t" V修改完成后保存:
( J, o3 k7 _) Z+ v# |( Vvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
3 E, Q/ u+ A6 z8 H5 }5 R" ]( A9 s3 M( M1 {8 c1 ?; \8 T
5 i7 e% Z! [" A7 H/ c7 h2 p
重启kvm虚机:" K9 l2 R. |4 m# {% ?6 {5 `( ]$ W' R
virsh destroy xxx
9 a1 I- }* T+ Q& ^4 F7 D) p( v) H) Tvirsh start xxx- Q0 x3 ~( }  R2 P0 ~

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:34 | 显示全部楼层
解决办法:, m  s+ F5 M2 ?; ~! Z
通过virsh edit 修改xml文件,添加如下信息,即可:9 ]  E9 P; \6 S; W) l/ K0 [
    <interface type='bridge'>) O( k- ~+ @8 B. p8 f  F
      <mac address='52:54:00:af:49:04'/>
6 l/ S! H  `3 f' ]4 k6 ^! V( Q2 Y3 g      <source bridge='vpc-connection'/>! t5 Z. J5 d# D( M& ]" f& n
      <target dev='peer-175.73'/>
$ N" ^  Q% `: K; n; F      <model type='virtio'/>
! i' ]6 t: `( l      <driver name='qemu'/>
$ b# D' W) i9 B1 w+ Y      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
; [& m& d5 P% g; a    </interface>
* B! l) D2 }. N5 j" a8 X7 }# b! n    <serial type='pty'>
) C8 @% D$ ]( j. A3 d      <target port='0'/>; I4 Y3 J* `# b1 M7 E
    </serial>
) C6 f- N$ O8 }    <console type='pty'>3 f% q9 D7 w0 q. ~, X
      <target type='serial' port='0'/>* p; l5 ]" H) l( S
    </console>
  c  h8 p7 @% m2 Q, z) j3 s    <channel type='spicevmc'>
7 o& c+ y$ \. i- g5 G      <target type='virtio' name='com.redhat.spice.0'/>6 p  w- g# }' z, @
      <address type='virtio-serial' controller='0' bus='0' port='1'/>  E: N/ ?% f& K3 ^; [
    </channel>
3 I' e. c( v8 F& Y$ z修改完成后保存:
5 K/ h( l7 y/ S" Y2 R6 Dvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确! i* M5 I$ A& U
- v% g% f. C0 W# q

& O+ u8 @: @% }# r7 q2 k4 W重启kvm虚机:
& N& E0 m, S9 Qvirsh destroy xxx
, z- E: G1 F* a0 ^, qvirsh start xxx
. G. _: |$ C/ G4 f
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:39 , Processed in 0.018317 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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