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. Python读写Excel文件的实例

    最近由于经常要用到Excel,需要根据Excel表格中的内容对一些apk进行处理,手动处理很麻烦,于是决定写脚本来处理.首先贴出网上找来的读写Excel的脚本. 1.读取Excel(需要安装xlrd) ...

  2. PHP入门了解

    1.五个基本概念     1.1静态页面和动态页面 静态页面:服务器不执行的页面 动态页面:服务器执行的页面  1.2客户端和服务器端 客户端:浏览器就是客户端 服务器端:给浏览者提供服务  1.3端 ...

  3. 阿里P7工作总结:Spring MVC的工作原理,看完受益匪浅

    这篇文章将深入探讨Spring框架的一部分——Spring Web MVC的强大功能及其内部工作原理. 项目安装 在本文中,我们将使用最新.最好的Spring Framework 5.我们将重点介绍S ...

  4. 024.微服务架构之服务注册与发现(kubernetes / SpringCloud)

    微服务 微服务是一种架构模式,一种分布式的架构风格. 顾名思义,micro service,将一个庞大的单体应用拆分成若干个“微小”的服务,服务间通过进程通讯完成原本在单体应用中的调用. 其中必要的六 ...

  5. 10.JavaCC官方入门指南-例5

    例5:计算器--添加乘除法运算 1.calculator2.jj 根据上一个例子,可知要添加乘法和除法运算是很简单的,我们只需在词法描述部分添加如下两个token: TOKEN : { < TI ...

  6. TICK技术栈(一)TICK技术栈介绍

    1.什么是TICK技术栈? 1.1 简介 TICK 是由 InfluxData开发的一套开源工具栈,由 Telegraf, InfluxDB, Chronograf, Kapacitor 四个工具的首 ...

  7. Incorrect datetime value: '' for column 'examDate' at row 1

    出问题的程序:user.setCreateTime(new Date()); 控制台图片一张,问题是:Incorrect datetime value: '' for column 'createTi ...

  8. SpringBoot关于静态js资源的报错问题

    2019-12-02 09:45:01.636 WARN 9572 --- [nio-8080-exec-2] o.s.web.servlet.PageNotFound : No mapping fo ...

  9. C++ 模板类示例 template class

    声明和实现在一个文件中: template<class T> class book { public: book(); ~book(); private: }; template<c ...

  10. 基于C++的STL的vector实现静态链表,要求包含插入,删除,和查找功能

    //main.cpp部分 #include"List.cpp" int main() { StaticList<int> SL; SL.Insert(,); SL.In ...