KVM 通过virsh console连入虚拟机
新安装一台虚拟机后,是无法通过virsh console 命令连入虚拟机中的,这时我们需要开启虚拟机的console功能。
一、添加ttyS0的许可,允许root登陆
[root@localhost ~]# echo "ttyS0" >> /etc/securetty
二、编辑/etc/grub.conf中加入console=ttyS0
[root@localhost ~]# less /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/sda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (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=128M 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 [root@localhost ~]#
三、编辑/etc/inittab,在最后一行加入内容 S0:12345:respawn:/sbin/agetty ttyS0 115200
[root@localhost ~]# less /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf # # Individual runlevels are started by /etc/init/rc.conf # # Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf # # Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf, # with configuration in /etc/sysconfig/init. # # For information on how to write upstart event handlers, or how # upstart works, see init(5), init(8), and initctl(8). # # Default runlevel. The runlevels used are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: S0:12345:respawn:/sbin/agetty ttyS0 115200 [root@localhost ~]#
四、重启服务器
[root@localhost ~]# reboot
五、在宿主机上测试连接
[root@study ~]# virsh listId Name State
----------------------------------------------------4 centos running[root@study ~]# virsh console 4
Connected to domain centos
Escape character is ^]CentOS release 6.5 (Final) Kernel 2.6.32-431.el6.x86_64 on an x86_64 localhost.localdomain login: root Password: Last login: Thu Oct 13 02:51:30 on ttyS0 [root@localhost ~]#
注:按 ctrl+] 组合键退出virsh console
对于centos 7
在虚机里运行
[root@localhost ~]# grubby --update-kernel=ALL --args="console=ttyS0"
then
[root@localhost ~]# reboot
即可
KVM 通过virsh console连入虚拟机相关推荐
- virsh链接虚拟机_KVM 通过virsh console连入虚拟机
新安装一台虚拟机后,是无法通过virsh console 命令连入虚拟机中的,这时我们需要开启虚拟机的console功能. 一.添加ttyS0的许可,允许root登陆 [root@localhost ...
- virsh console无法连接虚拟机
最近用virt-manager管理VKM虚拟机,virt-mamager里可以打开虚拟机窗口,可是命令行用virsh console无法打开虚拟机控制台. 用virsh edit查看了虚拟机配置文件, ...
- kvm 虚拟化 virsh,virt-manager 删除虚拟机
一.libvirt.virsh.virt-manager 介绍 kvm 虚拟化中 libvirt 是目前使用最为广泛的对 kvm 虚拟机进行管理的工具和应用程序接口,而且一些常用的虚拟机管理工具(vi ...
- [运维|virsh]virsh 命令行管理虚拟机
重用命令和选项 1:查看运行的虚拟机 virsh list 2:查看所有的虚拟机(关闭和运行的虚拟机) virsh list --all 3:连接虚拟机 virsh console +域名(虚拟机的名 ...
- KVM的HVM虚拟机使用virsh console 方式连接
在之前的文章中http://blog.csdn.net/dobell/article/details/9003421,给出了XEN console 连接HVM的方式,那么在KVM下,如何使用libvi ...
- linux virsh console无法登入虚拟机,宿主机virsh console 登录异常
创建虚机后在宿主机上通过virsh console 登录不进去,一直卡在登录界面(可以通过命名空间ssh登录,排除用户名及密码问题).原因是相关配置文件没有添加,可以通过以下方法进行处理,并且验证正常 ...
- CentOS 7虚拟机支持virsh console访问
CentOS 7虚拟机支持virsh console访问方法: 1. 在KVM(客户机)下开机启动并启动服务 systemctl enable serial-getty@ttyS0.service s ...
- KVM console 串口连接虚拟机
KVM宿主机,在使用virsh console时,发现控制台(console)无法使用 报出如下错误: error: operation failed: Active console session ...
- CentOS 7下宿主机使用virsh console访问KVM的设置
在CentOS 6下要实现宿主机使用virsh console访问KVM可以说是非常麻烦,但这一问题在CentOS 7已经解决了,只需要两条命令在KVM下即可实现. 1.在KVM(客户机)下开机启动并 ...
最新文章
- 页面A使用window.open打开页面B,然后取得B的返回值
- python 办公自动化-Python办公自动化|从Excel到Word
- fastjson的值过滤器ValueFilter || fastjson输出字段为Null的两种
- dubbo使用遇到的问题
- 一切成功的秘诀都蕴含在这个公式里面
- python文件中环境声明_Python环境构建
- Eclipse自动生成返回值对象与补全与加注释
- TPL Dataflow .Net 数据流组件,了解一下?
- POJ 1014 Dividing 背包
- 统计学基础学习笔记:概率与概率分布
- asp.net文本编辑器FCKeditor使用方法详解 - 橙色大地 - 博客园
- 20190616 IDEA-每次修改JS文件都需要重启Idea才能生效解决方法
- iPhone 12 要来了,手机是时候换到 11 了
- 0302借软件工程触IT
- 【元胞自动机】基于matlab元胞自动机短消息网络病毒传播仿真【含Matlab源码 1289期】
- 六子棋AI程序---核心讲解
- 2013总结-2014计划
- 用火箭送快递?淘宝宣布联合蓝箭航天起启动“宝箭”计划
- excel等额本息计算房贷公式
- PCI/PCIe的学习笔记
热门文章
- 4.1 SE38数据类型
- wdcp找回mysql密码_wdcp忘记后台admin密码,重置MYSQL ROOT密码
- spring循环依赖及解决方式_来探究一下Spring 循环依赖的三种方式
- MATLAB基本用法介绍
- java取模运算_Java的四则运算符与取模运算符
- ajax概述原理,ajax基本原理
- 笨方法“学习python笔记之输入
- python __getitem__()方法==>可以直接通过P[key]做运算
- 机翼翼尖_我所理解的流体力学 | 闲话翼尖涡
- docker公共存储库_Docker入门(2)——镜像结构和私有镜像库