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"

随机推荐

  1. HTTP 状态码及含义

    来自 Koa.js 官方文档中关于设置请求响应的部分 response.status=,列出了从 1xx ~ 5xx HTTP 状态码及含义,现摘录如下: 100 "continue&quo ...

  2. Go文件内容追加问题

    今天在用文件追加时,遇到点小问题,一直没法追加,起初是这样的 fp,err1 = os.OpenFile(filename,os.O_APPEND,0666) 上面这个死活加不了,后面改成 fp,er ...

  3. CAD如何能画的快?老师傅教你5个技巧,远超他人

    都知道CAD用途是很广泛,各行各业都是离不开CAD画图设计,机械,建筑,园林,服装,家具…… 画图速度一定要够快速,这样才能够满足需求,事实上会发现有的人绘图非常快速,但是你出一张图却要加班赶点.差距 ...

  4. linux rz sz文件传输 ZModem协议

    比ftp和scp方便点.需要用支持ZModem协议的工具,SecureCRT是可以的 rz: 接收文件 sz: 发送文件 安装 # sudo apt-get install lrzsz 使用 协议介绍 ...

  5. HIVE SQL产生的文件数量及参数调优

    产生背景:sqoop抽取oracle数据到hive表时,只能写入到固定分区(--hive-partition-key #hive分区字段 --hive-partition-value #hive分区值 ...

  6. typora使用说明

    一级标题 # 空格 编写内容 二级标题 ## 空格 编写内容 有序内容 1.+Tab 无序内容 -+Tab 代码块 print("hello wrold") typora快捷键 c ...

  7. BayaiM__ oracle函数_01

    BayaiM__ oracle函数_01   Oracle函数--------------------------------------------------------------------- ...

  8. 告诉你一些DBA求职面试技巧

    告诉你一些DBA求职面试技巧 要自信!永远不要低估你的能力.如果你不了解什么问题的答案,承认它.重点放在你找出答案的能力和你学习的意愿. 不要自大!是的,你可能过于自信而被认为是骄傲的.轻率的,甚至是 ...

  9. classmethod,staticmethod,反射,魔法方法,单例模式

    目录 classmethod staticmethod instance issubclass 反射 hasatter getatter setatter delatter 魔法方法 单例模式 什么是 ...

  10. liteos C++支持(十七)

    1 概述 1.1 基本概念 C++作为目前使用最广泛的编程语言之一,支持类.封装.重载等特性,是在C语言基础上开发的一种面向对象的编程语言. 1.2 运作机制 STL(Standard Templat ...