Welcome 微信登录

首页 / 操作系统 / Linux / 解决KVM中宿主机通过console无法连接客户机

一.问题描述:KVM中宿主机通过console无法连接客户机,卡在这里不动了。# virsh console vm01Connected to domain vm01Escape character is ^]为KVM客户机添加virsh console支持  http://www.linuxidc.com/Linux/2013-02/79556.htm二、解决办法:利用vnc或宿主机的桌面进入客户机vm01中添加参数1、添加ttyS0的安全许可,允许root登录:# echo "ttyS0" >> /etc/securetty2、在/etc/grub.conf文件中为内核添加参数:console=ttyS0这步要注意:console=ttyS0一定要放在kernel这行中(大约在第16行),不能单独一行,即console=ttyS0是kernel的一个参数,不是单独的,如下(往右拉进度条,在最后):# cat -n /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 Red Hat Enterprise Linux (2.6.32-431.el6.x86_64)      root (hd0,0)      kernel /vmlinuz-2.6.32-431.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-431.el6.x86_64.img
3、在/etc/inittab中添加agetty:S0:12345:respawn:/sbin/agetty ttyS0 1152004、重启客户机:# reboot三、问题解决# virsh console vm01Connected to domain vm01Escape character is ^]Red Hat Enterprise Linux Server release 6.5 (Santiago)Kernel 2.6.32-431.el6.x86_64 on an x86_64 vm01 login: rootPassword:Last login: Sun Oct 12 00:11:47 on tty1[root@vm01 ~]#附:关于终端的基本概念汇总:tty(终端设备的统称):tty一词源于Teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘通过阅读和发送信息的东西,后来这东西被键盘与显示器取代,所以现在叫终端比较合适。终端是一种字符型设备,它有多种类型,通常使用tty来简称各种类型的终端设备。pty(伪终端,虚拟终端):但是如果我们远程telnet到主机或使用xterm时不也需要一个终端交互么?是的,这就是虚拟终端pty(pseudo-tty)pts/ptmx(pts/ptmx结合使用,进而实现pty):pts(pseudo-terminal slave)是pty的实现方法,与ptmx(pseudo-terminal master)配合使用实现pty。更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-10/107891p2.htm
  • 1
  • 2
  • 下一页
Linux系统安全工具之tcpdumpVMware虚拟机网络模式的区别相关资讯      KVM  console 
  • 怎样在 Ubuntu 和 Debian 中通过命  (02月29日)
  • RHCSA 系列(十五): 虚拟化基础  (10/07/2015 15:25:43)
  • 在Ubuntu上安装KVM并搭建虚拟环境  (10/04/2015 06:28:17)
  • KVM嵌套虚拟化配置  (11/20/2015 20:16:53)
  • Ubuntu下使用KVM+Qemu 搭建虚拟机  (10/04/2015 06:48:51)
  • 如何在Linux发行版上安装和配置KVM  (10/04/2015 06:21:48)
本文评论 查看全部评论 (0)
表情: 姓名: 字数