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. 好久没玩laravel了,今天玩下Laravel项目迁移步骤

    .在新的目录中克隆git远程版本库 .执行composer install安装依赖 .执行php artisan key:generate生成key 好久没玩laravel了,今天玩下Laravel项 ...

  2. 面试官,我会写二分查找法!对,没有 bug 的那种!

    前言科普 第一篇二分搜索论文是 1946 年发表,然而第一个没有 bug 的二分查找法却是在 1962 年才出现,中间用了 16 年的时间. 2019 年的你,在面试的过程中能手写出没有 bug 的二 ...

  3. 仅支持基本增删改查的学生自制php操作mysql的工具类 DB.class.php (学生笔记)

    <?php class DB{ //主机地址 var $host; //用户名 var $username; //密码 var $password; //数据库名 var $dbname; // ...

  4. Zipkin客户端链路追踪源码解析

    我们知道,Zipkin这个工具可以帮助我们收集分布式系统中各个系统之间的调用连关系,而且除了Servlet之外还能收集:MQ.线程池.WebSocket.Feign.Hystrix.RxJava.We ...

  5. Html 页面底部添加版权信息

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. Java 实践:生产者与消费者

    实践项目:生产者与消费者[经典多线程问题] 问题引出: 生产者和消费者指的是两个不同的线程类对象,操作同一个空间资源的情况. 需求引出: —— 生产者负责生产数据,消费者负责取走数据 —— 生产者生产 ...

  7. react 地图发布 cesium 篇

    上篇文章介绍了如何搭建 react cesium 开发环境.在开发环境下,项目一切运行正常.最近把项目打包发布出来,却遇见了 cesium 不能正确初始化.打开浏览器的调试面板,出现好多 404,资源 ...

  8. 获取SpringCloud gateway响应的response的值,记录踩坑

    最近在做网关改造,想要通过Gateway过滤器获取ResponseBody的值,查看了网上的帖子和官网内容: 帖子:https://cloud.tencent.com/developer/articl ...

  9. [Linux] 纯净ubuntu快速搭建宝塔面板

    宝塔官方建议是纯净的系统,我使用docker运行一个ubuntu容器,模拟一个纯净的系统,这样也不会影响到我的其他服务. docker run --name baota -id -p 8888:888 ...

  10. js 时间戳转yyyy-MM-dd HH-mm-ss工具类

    转载自:https://blog.csdn.net/shan1774965666/article/details/55049819 在web开发中,我们经常需要用js将时间戳转yyyy-MM-dd H ...