用virsh console vhosts 卡住
1 2 3 4 5 6 7 8 9 10 11 12 13 | [root@666 ok]# virsh list --all Id Name State ---------------------------------------------------- 1 c01 running - c02 shut off - c03 shut off - c70 shut off - w7 shut off - win7 shut off [root@666 ok]# virsh console c01 Connected to domain c01 Escape character is ^] |
解决问题以下几步:
# cat /etc/securetty console vc/1 vc/2 vc/3 vc/4 vc/5 vc/6 vc/7 vc/8 vc/9 vc/10 vc/11 tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9 tty10 tty11 # echo "ttyS0">>/etc/securetty [root@DB ~]# cat /etc/securetty console vc/1 vc/2 vc/3 vc/4 vc/5 vc/6 vc/7 vc/8 vc/9 vc/10 vc/11 tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9 tty10 tty11 ttyS0 #追加了ttyS0
在/etc/grub.conf文件中为内核添加参数:
console=ttyS0
[root@DB ~]# cat /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/vda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS 6 (2.6.32-642.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-642.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet console=ttyS0 #在这里增加参数 initrd /initramfs-2.6.32-642.el6.x86_64.img
在/etc/inittab中添加agetty:
S0:12345:respawn:/sbin/agetty ttyS0 115200
[root@DB ~]# tail -n 2 /etc/inittab id:3:initdefault: S0:12345:respawn:/sbin/agetty ttyS0 115200 #增加的参数
生启虚机后,再次连接,成功:
[root@666 ok]# virsh start c01 Domain c01 started [root@666 ok]# virsh console c01 Connected to domain c01 Escape character is ^] emon: [ OK ] CentOS release 6.8 (Final) Kernel 2.6.32-642.el6.x86_64 on an x86_64 DB login: root Password: Last login: Wed Dec 6 13:04:19 from 10.100.0.5
联系方式QQ:326528263 EMAIL:clnking@163.com 网名:bass 分享技术 突破难点 创新思维
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
2016-12-06 redis 常用命令