zoukankan      html  css  js  c++  java
  • 用virsh console vhosts 卡住

    [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
  • 相关阅读:
    Android环境说明 与 屏幕尺寸问题
    关于修改Visual Studio 2010 Ultimate RC的密钥
    安装Office 2010是出现windows installer服务不能更新一个或多个受保护的windows文件 错误
    Sharepoint 2010和阿里通进行集成完成短信通知功能
    用visual studio 2010 打开winform程序 时 无法运行 的解决方案
    一次尴尬的招聘经历
    TFS里的MSB3021错误
    程序员是强者
    修改密码导致应用程序池无法启动
    远离客户开发陷阱(转)
  • 原文地址:https://www.cnblogs.com/bass6/p/7992187.html
Copyright © 2011-2022 走看看