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

  • u2u2
  • 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,启动的时候一直…

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

评论已关闭。

You Missed

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

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

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

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

Anthropic 推出 Claude Code Security:AI 驱动的代码安全神器

  • u2
  • 2月 24, 2026
  • 75 views

来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

  • u2
  • 10月 16, 2025
  • 48 views
来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

技术宅如何躲开越来越垃圾的CSDN?

  • u2
  • 4月 11, 2024
  • 34 views
技术宅如何躲开越来越垃圾的CSDN?

mysql连接失败:The driver has not received any packets from the server

  • u2
  • 3月 26, 2024
  • 35 views
mysql连接失败:The driver has not received any packets from the server