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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-9-13 10:39:09 | 显示全部楼层 |阅读模式
virsh console 报错' A' F8 Y) o5 j( E7 u
error: internal error: cannot find character device <null>
) q5 E+ L) f% B) U8 U2 z0 |( c2 OError "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)2 h6 a: o, a' _/ \+ m; ]
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 | 显示全部楼层
解决办法:
( M8 |+ N( y' E6 G# o9 f0 f5 X3 z# ^通过virsh edit 修改xml文件,添加如下信息,即可:
( g$ x$ t2 a2 J: T; v    <interface type='bridge'>& O# E+ S. ~0 P% d8 p, A, f
      <mac address='52:54:00:af:49:04'/>* A7 V  `3 ~! g+ I' v" V" N4 ]
      <source bridge='vpc-connection'/>; h  L5 O, e$ j5 Z( x2 Z
      <target dev='peer-175.73'/>3 c: b0 F6 `% I% A" z
      <model type='virtio'/>
5 m( X% A% m+ _( e( T" F      <driver name='qemu'/>
$ s! B! F( o0 e5 I      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
4 L: ?/ `0 J9 q9 R. d    </interface>- v+ L: @8 K" c
    <serial type='pty'>3 x: V/ U- Q9 [
      <target port='0'/>
$ t: m& a( d  v' S    </serial>
- V8 Y/ t3 W+ R* g    <console type='pty'>( D9 B+ p7 g+ \/ f: T- l! o
      <target type='serial' port='0'/>
, |2 d+ _- L& ~( q) x( A4 w& u; e    </console>! t5 q; Q4 l8 k4 Z+ U  _
    <channel type='spicevmc'>! x/ s2 K1 J$ k3 }- E" h5 T
      <target type='virtio' name='com.redhat.spice.0'/>1 _- p8 E, p9 u% @$ }8 L
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
: v0 Z8 }! F# N5 {. m7 `    </channel>
, G7 a1 H, `% y, j3 ^$ [3 ?修改完成后保存:& u6 Z# [! ]3 [- X! u" N: P$ z5 F
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
  E4 F1 D% R1 Z4 b9 q: T
& z; w2 ~! r5 u( S5 o+ P# `  U1 A
. D2 l& T. l# Q+ n/ w- P重启kvm虚机:5 [$ B. z: ]# T# _6 M
virsh destroy xxx8 O2 n' i  _1 A
virsh start xxx
6 a  h- `$ |" _5 y! D7 R

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:30 | 显示全部楼层
解决办法:. A3 K, T9 ^! K& n. V5 R
通过virsh edit 修改xml文件,添加如下信息,即可:
1 m3 S# W) q9 U. \& ?) F5 H: s9 f    <interface type='bridge'>- l5 `6 D3 Y+ k3 u
      <mac address='52:54:00:af:49:04'/>7 o* H% m1 Y1 @( {3 d
      <source bridge='vpc-connection'/>
8 E4 k, r) b3 t8 I      <target dev='peer-175.73'/>
) b7 m1 X  }2 H  c8 r# Y! D: }      <model type='virtio'/>4 F! X' h& c7 b& L3 Y
      <driver name='qemu'/>
: I2 A7 Q; i5 J9 J. c# A1 O! W      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>2 t; O& n5 F( e+ q, ^
    </interface>4 Y; f7 i& _) _* k+ H4 v
    <serial type='pty'>6 V( U$ k% ?1 L: ^
      <target port='0'/>* N  Y7 m  E/ n0 ]+ h: h
    </serial>6 b% x; w% V4 w" Q& u" n
    <console type='pty'>
7 R+ v+ h9 ?# {" N6 S+ L! ]      <target type='serial' port='0'/>8 q" ^  f, y/ h& g9 o$ v" t
    </console>  g; D- y) ?& h
    <channel type='spicevmc'>
- j7 p% F+ S9 W/ b) U      <target type='virtio' name='com.redhat.spice.0'/>* S2 [" b% U# L, c* E$ a) o
      <address type='virtio-serial' controller='0' bus='0' port='1'/>+ Z# c) E6 W7 m! G
    </channel>
: V! w; R2 n3 b修改完成后保存:2 Y: [, G5 A2 v0 r. C
vi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
5 H3 X. d" d# D/ n- H
4 u$ D9 n5 m6 ^% s- M4 {/ c& |: `
. M$ `1 ?: _3 \# G1 g! H重启kvm虚机:
8 p) t5 L3 ?6 ]8 _* Q1 [1 jvirsh destroy xxx( y) i6 ?! Y1 k  D9 R
virsh start xxx
: u8 J5 d+ J3 K, H

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2019-9-19 14:05:34 | 显示全部楼层
解决办法:5 r( q8 V$ L0 {5 N6 ~# Z! V. B7 [
通过virsh edit 修改xml文件,添加如下信息,即可:- G  H1 A2 |- ~+ g+ x
    <interface type='bridge'>
7 [3 ]& A! D4 z* L- t, z1 v; ~      <mac address='52:54:00:af:49:04'/>
: M4 V' x8 f3 h      <source bridge='vpc-connection'/>
. ~+ j# E' |, D      <target dev='peer-175.73'/>7 J; h7 P" P5 ^) d3 t
      <model type='virtio'/>
" i4 |; V8 \) E1 ~      <driver name='qemu'/>
/ d1 O  X" A7 Y5 v# k+ J7 {7 Y5 o      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
2 x; L( Z" V# v9 v3 D; g- u: L$ w    </interface>) A, {, p: Y$ J, b
    <serial type='pty'>2 l( D6 {; p! c6 h2 l9 b
      <target port='0'/>
( q: c" w7 e5 E& \1 x    </serial>+ T9 o; F1 _. H2 c" W1 m* R' |( l
    <console type='pty'># h7 s* A! R) Y7 z( [5 ?
      <target type='serial' port='0'/>7 L5 G! C2 k; a! U, u
    </console># Q3 g5 ^( J6 Z' X" A, [3 _$ Z  k
    <channel type='spicevmc'>
% U2 Q$ X# j, i5 q% n+ O) `4 S2 P      <target type='virtio' name='com.redhat.spice.0'/>
) c, h( L' t- ?, _      <address type='virtio-serial' controller='0' bus='0' port='1'/>
& b/ w+ E3 a0 \% g2 }( R    </channel>  F+ h) j- P; G. f9 U. k
修改完成后保存:
4 g  k2 z" I; R+ s1 Rvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
1 E9 v- C3 l/ y; \; S0 `% `7 d1 }2 g9 {* y
$ h; b( k# E7 f. Y
重启kvm虚机:) t5 H( b& K! _
virsh destroy xxx
- \7 `$ S. W$ Mvirsh start xxx
7 ~; v; M0 f$ e( Z: k; B- A" W
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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