kvm虚拟化两个小故障的处理

  • kvm
  • 2月 21, 2014
  • 1 评论

问题一:KVM宿主机,在使用virsh console时,发现控制台(console)无法使用
报出如下错误:
error: operation failed: Active console session exists for this domain

现象:

# virsh console v03
Connected to domain v03
Escape character is ^]
error: operation failed: Active console session exists for this domain

解决办法:

# ps aux | grep console
root     19449  0.0  0.0 300964  3648 pts/1    Sl    2013  33:33 /usr/bin/virsh --connect qemu:///system console 2

kill -9 19449

重新登录console

# virsh console v03
Connected to domain v03
Escape character is ^]

问题二: KVM明明有内存很多的内存,但是因为内存不够无法创建虚拟机。

实际内存情况:

# free -m
             total       used       free     shared    buffers     cached
Mem:         32060      31180        879          0        163      22466
-/+ buffers/cache:       8550      23509
Swap:        16383          4      16379

KVM中可分配内存仅为890M:

# virsh freecell
Total: 880492 KiB

发现是linxu下内存cache的问题,清理内存cache:

sync; echo 3 > /proc/sys/vm/drop_caches

现在的状态:

# free -m
             total       used       free     shared    buffers     cached
Mem:         32060       7652      24407          0          0         15
-/+ buffers/cache:       7635      24424
Swap:        16383          4      16379

现在KVM可分配内存如下所示:

 virsh freecell
Total: 24985164 KiB

u2

Related Posts

kvm下安装Debian9无法启动

[摘要] kvm里面安装了Debian9.2,启动的时候一直…

Read more

One thought on “kvm虚拟化两个小故障的处理

评论已关闭。

You Missed

AI安全护栏:保护还是束缚?一场不对称的战争

  • u2
  • 3月 11, 2026
  • 17 views

从”养虾”到AI Agent爆发:2026年技术圈的新范式转移

  • u2
  • 3月 9, 2026
  • 34 views

提示词注入:AI时代最危险的漏洞,正在吞噬你的数据

  • u2
  • 3月 7, 2026
  • 77 views
提示词注入:AI时代最危险的漏洞,正在吞噬你的数据

潘多拉魔盒已打开:开源AI攻击平台正在血洗全球防火墙

  • u2
  • 3月 4, 2026
  • 85 views
潘多拉魔盒已打开:开源AI攻击平台正在血洗全球防火墙

雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

  • u2
  • 3月 1, 2026
  • 81 views
雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战

  • u2
  • 2月 25, 2026
  • 200 views
OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战