Cannot Open KVM Virtual Machine Manager on CentOS 7

I got following error message when I try to run KVM Virtual Machine Manager: virt-manager on SSH.

Gtk-WARNING **: cannot open display:

There are several things need to be checked:

  • Make sure “X11Forwarding” is set to “yes” in /etc/ssh/sshd_config on the machine you run virt-manager.
    cat /etc/ssh/sshd_config | grep "^X11"
  • If you are using Windows to connecting SSH. The X11 need to be forwarded to an “X Window server” on top of Windows. I use xming.
  • If you connect SSH by Putty on Windows. Please configure X11 forwarding.
    • Go to “Connection” -> “SSH” -> “X11“.
    • Check “Enable X11 forwarding“.
    • Assign xming.exe path in “X authority file for local display“.
  • If you are using terminal on Mac OS. You need to install Xquartz. It configures terminal automatically.

Now you are ready to use “virt-manager“.

The CPU has been disabled by the guest operating system

Few weeks ago, our database virtual machines got randomly failed. There was error message “The CPU has been disabled by the guest operating system. Power off or reset the virtual machine.” on VM events. I didn’t find any abnormal on vmkernel, hostd and vm logs. Finally our Linux team identified it’s a Linux kernel bug. Please refer to BUG at block/blk-core.c:NNNN! in blk_requeue_request or blk finish_request.

The bug only present on RedHat 6 on ESXi 5.5 with VMware Paravirtual SCSI drivers.

 

Continue reading “The CPU has been disabled by the guest operating system”

如何删除Raspberry Pi上安装的软件

做为一位Raspberry Pi(树莓派)的新手,面对这个庞大的系统,真心不知道从何下手。在网上搜各种有关Raspberry Pi的信息,发现只有英文文章能比较详尽的介绍怎么使用它,中文的信息要么是从英文翻译过来,不知所云;要么蜻蜓点水一般感觉只有高高手才能看得懂。

我会尝试把我这个新手学到的东西记录在我的博客里,希望对Raspberry Pi中文社区有所贡献。

感觉自己有些技术洁癖,不喜欢系统上被预装各种软件,比如当我打入python时,会提示我有2.7,3.0,3.2三个版本存在于我的系统里!所以我很好奇我的Raspberry Pi上到底已经内置了哪些软件,怎么删除这些不需要的软件。其实这个问题已经困扰我很久了,由于一直使用Windows,对于添加删除程序的概念一直是 规范、整洁、方便。没想到Linux的软件是如此的自由,以至于我根本不知道哪些应该删除,哪些不应该。

幸好现在的Debian发行版本已经内置了很多好的工具帮我解决这个问题!我的Raspberry Pi上安装的是官方推荐的raspbian,这是Debian的衍生版本,几乎所有的命令都和Debian下一致。你可以在Raspberry Pi的下载页面找到这款系统,当然你还可以选择很多其他的系统。

OK,言归正传,说到删除,我们需要先知道系统里都安装了哪些软件,下面这个命令可以检索出系统内的所有软件。

dpkg-query -l | grep 软件名字

dpkg-query 命令 是用于检索安装包的。

-l 参数 表示列出所有的包。

| 管道标识符 表示传递列出的所有包到 管道标识符后边的命令中。

grep 命令 是用于过滤

软件名字 参数 表示你要找的安装包名字

举例, 列出所有名字里含python的安装包:

dpkg-query -l | grep python

用上边的方法列出你要找的包后,下一步我需要删除不需要的软件了。

apt-get –purge remove 软件名字

apt-get 命令 是操作软件的命令

–purge 参数 表示将软件相关的配置文件一并删除

remove 参数 表示删除软件

软件名字 参数 表示你要删除的软件,也可以是多个名字,用逗号隔开

举例,删除chromium和所有相关的软件:

apt-get –purge remove chromium,chromium-browser,chromium-inspector,chromium-l10n

在这个例子里,我一次性删除了chromium和他相关的软件,比如语言包、页面检测程序等。Linux里的软件给你最大的透明度,一个软件其实有可能是由多个小程序组成的,所以你会看到好几个含有chromium关键字的包。

另外,也许你会看到类似libxxxx这样开头的包,这种一般都是某个主程序的库文件,在你删除主程序时候他会自动删除这些库文件。

最后,运行这个命令删除不再需要的零散软件包

apt-get autoremove

apt-get是一个强大的工具,他甚至可以用来更新系统,我在另外一篇文章《Upgrade raspberry pi on fly》中有介绍怎么实现。

Upgrade raspberry pi on fly

This article is for the new users whom just like me! 🙂
I got a Raspberry Pi about half years ago, I’m pretty new in Linux world, so I rebuilt my pi over and over again whenever there was a new release…it takes lot of time to do it.
Thanks Safari(a online library for IT guys). Today I found a new way to do it on fly! Just run following two commands it will upgrade system automatically.

#apt-get update
This command line updates the latest repository information.

#apt-get upgrade
It’s upgrade all older packages to latest version.

It may takes long time to complete upgrading, you’d better make sure the SSH alive during that time.