KVM的HVM虚拟机使用非串口方式建立virsh console 连接

在去年写的文章中,http://blog.csdn.net/dobell/article/details/14442457,写到了怎么利用serial 设备进行console连接

不过比较麻烦,因为1.需要修改虚拟机内部的grub启动选项,2 vnc连接过去无法同时使用

后来发现libvirt支持了virio启动,那么就容易了多了。

虚拟机配置文件的xml如下

<devices> 
 <console type='pty'>
        <source path='/dev/pts/5'/>
         <target type='virtio' port='0'/>
  </console>
</devices>

然后virsh create  hvm201.xml创建虚拟机即可。

这次就不截图了,具体如下

root@zju-PowerEdge-T610:/share/nfs181# virsh console hvm201
连接到域 hvm201
换码符为 ^]







Ubuntu 12.04.1 LTS hvm183 hvc0

hvm183 login: Password: 
root@zju-PowerEdge-T610:/share/nfs181# dmesg|tail
[  184.441602] init: Failed to spawn ufw post-stop process: unable to execute: No such file or directory
[  184.553217] ip_tables: (C) 2000-2006 Netfilter Core Team
[  184.662792] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[  184.751382] IPv6: ADDRCONF(NETDEV_UP): virbr0: link is not ready
[  185.637728] init: Failed to spawn ufw pre-start process: unable to execute: No such file or directory
[  185.643237] init: Failed to spawn ufw post-stop process: unable to execute: No such file or directory
[  185.665464] device vnet0 entered promiscuous mode
[  185.685296] xenbr0: port 2(vnet0) entered forwarding state
[  185.685306] xenbr0: port 2(vnet0) entered forwarding state
[  200.710430] xenbr0: port 2(vnet0) entered forwarding state
root@zju-PowerEdge-T610:/share/nfs181# 
不过这样还是有个缺点,grub还是得从vnc进入进行选择,而且没有记录启动过程中的信息

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值