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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-9-13 10:39:09 | 显示全部楼层 |阅读模式
virsh console 报错2 e6 {. f4 K# u8 s* U
error: internal error: cannot find character device <null>
/ \8 C7 n1 w  u( NError "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)9 c2 ]7 x  S+ {8 N% R& {3 h
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 | 显示全部楼层
解决办法:
  q) y+ g% n" Z1 N9 R6 p* u通过virsh edit 修改xml文件,添加如下信息,即可:
2 Z2 U; T1 g1 y- }0 a: c    <interface type='bridge'>
' s. K7 A1 a! D2 S" {" W      <mac address='52:54:00:af:49:04'/>, L) ^" m# D6 S5 Z" ?3 H
      <source bridge='vpc-connection'/>- T/ S5 S$ c/ X5 V% u& c# ?
      <target dev='peer-175.73'/>
+ h* k" I& `. A2 |$ N' M( C' V      <model type='virtio'/>
( k2 ?9 {6 G- g- @2 m      <driver name='qemu'/>
" {% m" D/ O5 {* ^9 w      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>+ p  h1 [) Q7 s$ t
    </interface>
5 b4 R3 F& I# x9 m# \$ [    <serial type='pty'>
- j3 h* o1 ~# ^0 y. U1 L/ D8 t9 B      <target port='0'/>
: c! X% y7 d" s5 D    </serial>
# a4 Y. k: f) R    <console type='pty'>$ S! _0 J; W" g  g
      <target type='serial' port='0'/>, l% Q, a/ T& p- J3 ^, F" `; q5 A
    </console>* p# l* x; w& u0 J
    <channel type='spicevmc'>
) V. h. r, Y) L- \      <target type='virtio' name='com.redhat.spice.0'/>
! M6 B/ O( w& @+ Q0 N' S. w. M      <address type='virtio-serial' controller='0' bus='0' port='1'/>/ A  H) Z8 R3 f, L  b; r9 j1 L$ u
    </channel>
  t) U- {2 e, F: }* j5 K7 y修改完成后保存:
& L( e7 U" k9 i8 X& mvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确4 \( G# R  R9 i& k: F

* l# ?: R3 X6 s- v" Q" s
6 F& Z; ]7 l6 {9 x3 E; t重启kvm虚机:
, z/ u2 c/ y3 Dvirsh destroy xxx
. u1 C: t( O4 z; Nvirsh start xxx& P" M7 V3 b2 O" C8 O

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:30 | 显示全部楼层
解决办法:
" O; |! `$ G. H6 G" o; k通过virsh edit 修改xml文件,添加如下信息,即可:
4 \% {. G; F) {    <interface type='bridge'>
: `+ N& J6 V! p5 Z- l      <mac address='52:54:00:af:49:04'/>0 a0 O$ A# X9 S* W4 N) w
      <source bridge='vpc-connection'/>' b+ A, _3 Z3 g. A
      <target dev='peer-175.73'/>
& q! P& W1 X6 g      <model type='virtio'/>
2 H0 D) L/ [& v2 l. u, ^      <driver name='qemu'/>
8 L3 F% I3 r9 V# B! h$ |      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>: l& t7 w2 }4 z! \( L, `
    </interface>
5 m5 D4 G/ h: [% _8 e$ j" C" b    <serial type='pty'>! T6 w5 d, |+ f) U/ l6 e  j$ [
      <target port='0'/>) P! b# w# s! C1 x
    </serial>' @7 S9 b0 [6 [
    <console type='pty'>
  V! K; G3 r. _+ c, J      <target type='serial' port='0'/>
! `) G1 W5 H" R9 G* ^; I* h0 g    </console>
; G; Y( O6 e3 N2 z, {    <channel type='spicevmc'>' z% b$ E- A$ ^
      <target type='virtio' name='com.redhat.spice.0'/>
0 L! B0 }- P" A  R1 @1 H      <address type='virtio-serial' controller='0' bus='0' port='1'/>
6 `3 @* v2 C  @    </channel>; Q; {9 g3 O4 z% F( |
修改完成后保存:
& l( L- f! m  u( k, Pvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
+ H/ H; e( Q1 I* l- \: |
9 E( H, E- @9 d. n2 X: a
/ X  w+ @% x9 Z6 k; H7 r重启kvm虚机:
5 w# _* u! o% B/ uvirsh destroy xxx& R+ z0 q: p/ j: B0 |( M, N4 H
virsh start xxx+ \& V/ ?1 l- S+ Y8 d2 K" P( H5 e

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:34 | 显示全部楼层
解决办法:
- G# ~: Z5 k' P) B: V0 x; \% c通过virsh edit 修改xml文件,添加如下信息,即可:9 d% r7 |1 X9 v+ y. b% M* J" u, g
    <interface type='bridge'>2 V9 V* f7 Z% Q) o5 w* u5 X$ R" X
      <mac address='52:54:00:af:49:04'/>
& @8 \) K  a4 p) N$ Z      <source bridge='vpc-connection'/>  c, q7 u# e: p
      <target dev='peer-175.73'/>
  G, ^. K6 k4 ^, u# Q: S) l, ?      <model type='virtio'/>5 j4 ^! b1 {; d8 O3 S, T9 m! I
      <driver name='qemu'/>
2 D4 x# i& U4 Q) {0 G      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
1 G# d7 I% t& G- k) [3 ]    </interface>
# b( v  j; h. s) [& y! o    <serial type='pty'>' e# L- j/ q( \; m9 F
      <target port='0'/>
1 t+ W( a: w! w2 f) C$ {    </serial>
0 a5 |0 P# b3 }' t    <console type='pty'>: ]3 r% i( ?7 z; \, s6 v* i
      <target type='serial' port='0'/>3 i: s4 g% y$ O( D8 y& x
    </console>
0 ^7 S, a( y- q  g    <channel type='spicevmc'>
$ h: N: c, @2 K$ r      <target type='virtio' name='com.redhat.spice.0'/>7 h# w9 u8 E5 I+ N& U# c4 j
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
0 p9 n1 }4 |  \7 {8 T# H4 k: P$ G    </channel>' o& O, M0 q( a& l! E
修改完成后保存:% Z# ]  }) w9 j% j( z
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确4 Q( y% y! c- c) J/ }' f8 ~
% s/ ^( c9 h6 T% d2 A

/ E0 Q* |7 z' L3 A' k. t& X+ J+ ^1 _重启kvm虚机:' w8 \: x8 v+ M" Q+ p0 I/ c0 v
virsh destroy xxx1 @" L3 z& S# H8 S( l5 J
virsh start xxx+ v$ B/ Z9 C% e0 _# }* ^  _
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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