正文
virsh console hangs at the escape character “^]”
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
I am trying to kickstart a newly built VM. I am stuck with the following. Want to start with a console so that I can include username and other info for this VM:
@vmhost02 ~]$ sudo virsh start --console testengine
Domain testengine started
Connected to domain testengine
Escape character is ^]
It hangs up in there and doesn't listen to any keys except "^]"
1)
You can try to edit
/etc/default/grub
in the guest, and make sure you have:
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
Then execute:
# update-grub
# reboot
2)
If that does not work, try to replace
quiet
with
console=ttyS0
in
GRUB_CMDLINE_LINUX_DEFAULT
in
/etc/default/grub
:
GRUB_CMDLINE_LINUX_DEFAULT="... console=ttyS0"
Then again:
# update-grub
# reboot
3)
You may still need to try:
# systemctl enable serial-getty@ttyS0.service
# systemctl start serial-getty@ttyS0.service
# reboot
4)
You would need to define a tty to be used as a virtual console. In case you have access to your vm either using vnc or ssh create the following file
vi /etc/init/ttyS0.conf
The content should be something like
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -L 38400 ttyS0 vt102 # This is your term type vt102
Save these settings and subsequently from your host machine
virsh destroy [vm-name]; service libvirtd stop; service libvirtd start; virsh start [vm-name]
I'm doing here a stop/start of libvirt, because it sometimes tend to not send a SIGTERM to libvirt.
Finally try
virsh console [vm-name]
5)
May be simpler than the solution of val0x00ff, you shall add the
console=ttyS0
at the end of the kernel lines in the
/boot/grub2/grub.cfg
file of the VM (this is not done by default it seems):
(vm)$> grubby --update-kernel=ALL --args="console=ttyS0"
(vm)$> reboot
Then
virsh console
shall work as expected
6)
The virsh console command connects you to the virtual serial port in the guest. If you see nothing on this console this indicates that the guest OS has not setup anything on the serial port. Typically in Linux you'd want to make it run an 'agetty' process on the serial port. If you want to see kernel boot messages on this serial console you also need to edit the guest boot loader to add console=tty0 console=ttyS0 to the kernel command line - this should get boot messages on both the serial and graphical consoles.
7)
I think you should start a console (e.g. ttyS0 ). For example on my Debian 8 I enable it with systemd:
systemctl enable getty@tty1.service
Enable Serial Console on CentOS/RHEL 7
On the virtual machine, add ‘console=ttyS0‘ at the end of the kernel lines in the /boot/grub2/grub.cfg file:
grubby --update-kernel=ALL --args="console=ttyS0"
Note:
Alternatively, you can edit the /etc/default/grub file, add
console=ttyS0
to the
GRUB_CMDLINE_LINUX
variable and execute
grub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial –speed115200 –unit=0 –word=8 –parity=no –stop=1"
随机推荐
-
Define the Data Model and Set the Initial Data 定义数据模型并设置初始数据
This topic describes how to define the business model and the business logic for WinForms and ASP.NE ...
-
SAP MM 采购信息记录中价格单位转换因子的修改
SAP MM 采购信息记录中价格单位转换因子的修改 如下采购信息记录, Order unit 跟 base UoM 一致,都是 PC. 采购价格是8849.56 CNY / 10000W, 由于业务人 ...
-
为Dynamics CRM的Office附件注释定制个无需下载即可在线查看的功能
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复164或者20151021可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 上一篇博客:为Dynamics ...
-
gitlab设置项目组成员权限
你敢相信这是个码农? setting菜单的“Members”功能页: 该页面展示了当前Project的成员列表,以及每个成员对应的权限角色,Owner/Master/Developer 注意到该页面顶 ...
-
微服务(入门学习五):identityServer4+ocelot+consul实现简单客户端模式
简介 主要是采用identity Server4 和ocelot 加上consul 实现简单的客户端模式 开发准备 环境准备 下载并安装Consul具体请参考前几篇的内容 项目介绍 创建ocelot ...
-
Mysql—存储引擎详解
存储引擎基本操作 查看数据库支持的所有的存储引擎 mysql> show engines; 查看数据库目前使用的引擎 mysql> show varlables like "%s ...
-
spark-shell 中rdd常用方法
centos 7.2 spark 2.3.3 scala 2.11.11 java 1.8.0_202-ea spark-shell中为scala语法格式 1.distinct ...
-
c# 第23节 外部方法
本节内容: 1:外部方法是什么 2:外部方法的实现 1:外部方法是什么 2:外部方法的实现 样式: 实现方式:很少 用自己多加练习把
-
【转】Restful架构详解
1. 什么是REST REST全称是Representational State Transfer,中文意思是表述(编者注:通常译为表征)性状态转移. 它首次出现在2000年Roy Fielding的 ...
-
Http响应乱码
Http响应乱码 方案1 response.setHeader("Content-Type", "application/json"); response.se ...
This topic describes how to define the business model and the business logic for WinForms and ASP.NE ...
SAP MM 采购信息记录中价格单位转换因子的修改 如下采购信息记录, Order unit 跟 base UoM 一致,都是 PC. 采购价格是8849.56 CNY / 10000W, 由于业务人 ...
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复164或者20151021可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 上一篇博客:为Dynamics ...
你敢相信这是个码农? setting菜单的“Members”功能页: 该页面展示了当前Project的成员列表,以及每个成员对应的权限角色,Owner/Master/Developer 注意到该页面顶 ...
简介 主要是采用identity Server4 和ocelot 加上consul 实现简单的客户端模式 开发准备 环境准备 下载并安装Consul具体请参考前几篇的内容 项目介绍 创建ocelot ...
存储引擎基本操作 查看数据库支持的所有的存储引擎 mysql> show engines; 查看数据库目前使用的引擎 mysql> show varlables like "%s ...
centos 7.2 spark 2.3.3 scala 2.11.11 java 1.8.0_202-ea spark-shell中为scala语法格式 1.distinct ...
本节内容: 1:外部方法是什么 2:外部方法的实现 1:外部方法是什么 2:外部方法的实现 样式: 实现方式:很少 用自己多加练习把
1. 什么是REST REST全称是Representational State Transfer,中文意思是表述(编者注:通常译为表征)性状态转移. 它首次出现在2000年Roy Fielding的 ...
Http响应乱码 方案1 response.setHeader("Content-Type", "application/json"); response.se ...