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"
随机推荐
- Awesome Java: Github上关于Java相关的工具
Awesome Java 这是Github上关于Java相关的工具,框架等等资源集合. 原文参考: https://github.com/akullpp/awesome-java. @pdai 最全的 ...
- OpenGL入门1.5:矩阵与变换
每一个小步骤的源码都放在了Github 的内容为插入注释,可以先跳过 前言 在阅读本篇博客之前,你必须对向量和矩阵有基本的认识,并且能熟练进行向量和矩阵的运算 我们已经知道了如何创建一个物体.着色.加 ...
- Java自学-I/O 数据流
Java 数据流DataInputStream ,DataOutputStream DataInputStream 数据输入流 DataOutputStream 数据输出流 步骤 1 : 直接进行字符 ...
- 反射DataTable转实体类
using System; using System.Collections.Generic; using System.Data; using System.Reflection; namespac ...
- Linux域名服务DNS
什么是 DNS DNS 全称是 Domain Name System,大意是域名解析系统,它的职责是把域名翻译成一个一个可以识别的 IP 供不同的计算机设备连接. linux 有关 DNS 解析的配置 ...
- webpack管理资源(loader操作)
1.加载css npm install --save-dev style-loader css-loader webpack.config.js文件中: const path = require('p ...
- IOS系统在Safari安装ipa文件
配置点击下载的地址 itms-services://?action=download-manifest&url= "plist文件路径"plist文件配置 IIS网站配置要 ...
- 【JavaWeb】EL表达式
EL表达式 EL表达式语言,用于简化JSP的输出: EL表达式的基本语法:${表达式}: 示例:<h1>学生姓名:${student.name}</h1> 作用域对象 忽略书写 ...
- 系统设计与分析:Alpha版本2成绩汇总
作业要求 1.作业内容 作业具体要求以及评分标准 2.评分细则 •给出开头和团队成员列表(10’) •给出发布地址以及安装手册(20’) •给出测试报告(40’) •给出项目情况总结(30’) * ...
- unittest,requests,assertEqual实战演练
请求方式:POST请求url:https://api.apiopen.top/developerLogin请求参数:名称 类型 必须 描述 示例name string 是 账号 peakchaopas ...