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. sequelize时间自动格式化

    问题 每次查询datetime的字段,显示出来都是这种格式 2019-08-27T12:02:05.000Z 解决办法 初始化Sequelize的时候传入dialectOptions参数 let se ...

  2. Nginx反向代理Tomcat静态资源无法加载以及请求链接错误

     在使用Nginx实现Tomcat的负载均衡的时候,项目发布到了Tomcat,Nginx也配置好了, 当访问的时候发现了与预期不符 表现为: 静态资源加载失败 链接跳转地址错误 下面是我错误的配置文件 ...

  3. Redisson实现分布式锁(3)—项目落地实现

    Redisson实现分布式锁(3)-项目落地实现 有关Redisson实现分布式锁前面写了两篇博客作为该项目落地的铺垫. 1.Redisson实现分布式锁(1)---原理 2.Redisson实现分布 ...

  4. vue-品牌管理案例

    品牌管理 分析 获取到 id 和 name ,直接从 data 上面获取 组织出一个对象 把这个对象,调用 数组的 相关方法,添加到 当前 data 上的 list 中 注意:在Vue中,已经实现了数 ...

  5. SpringBoot(七) SpringBoot整合Log4j

    第一种打印debug日志方式: logging.level.com.demo.mapper: debug 第二种打印debug日志方式: 在resource文件夹下新建:logback.xml < ...

  6. vue快速复习手册

    1.基本使用 <!DOCTYPE html> <head> <meta charset="UTF-8"> <title>Vue的基本 ...

  7. 配置VS Code+React开发环境

    1.安装node+npm 2.安装VS Code 3.选择工作区文件夹——右键点击在终端中打开 4.按照Using React in Visual Studio Code的文档进行操作 npm ins ...

  8. 教你如何添加Xcode 9.3配置包?(安装流程可供其他版本安装参考)

    1.准备好你想要的Xcode版本的安装包 ,这里以Xcode 9.3为例.                        →                   2.打开Xcode开发工具的安装路径 ...

  9. Python图像处理库Pillow常用使用方法

    PIL(Python Imaging Library)是Python一个强大方便的图像处理库,只支持到Python2.7.Pillow是PIL的一个派生分支,在Python3中用Pillow代替PIL ...

  10. .gitignore 文件没起作用

    场景 修改了.gitignore文件, 但是查看状态还是没有忽略 解决 *. 清除git缓存, 注意最后有一个点 git rm -r --cache . 再之后就可以正常使用了, 基本恢复正常, 被忽 ...