VirtualBox与杀毒软件冲突导致虚拟机无法启动: 错误 "supR3HardenedWinReSpawn"

今天在公司机器上装了 VirtualBox (版本 4.3.14) 和 Vagrant, 在运行 vagrant up 后总是提示虚拟机不能启动的错误。打开 VirtualBox 然后手动启动虚拟机发现如下错误框:

1
2
3
4
5
6
---------------------------
VirtualBox - Error In supR3HardenedWinReSpawn
---------------------------
Error relaunching VirtualBox VM process: 5
Command line: '81954AF5-4D2F-31EB-A142-B7AF187A1C41-suplib-2ndchild --comment Work_default_1407215688716_8404 --startvm 93cdc421-ae20-49d6-8ca4-6c5570f809cd --no-startvm-errormsgbox' (rc=-104)/>
---------------------------

原因:

  • 与 Symantec Endpoint Protection 冲突

临时解决办法:

NOTE 降级 VirtualBox 后需要重新启动计算机

另外可以参考VirtualBox 论坛的讨论

RabbitMQ笔记(一): 通过Vagrant建立一个RabbitMQ服务器实验环境

安装Vagrant

官方网站上,下载并安装Vagrant

NOTE: Vagrant 1.6版本对CentOS的guest支持不好,不能正确设置网络连接,需要升级到最新版或打上下面这个补丁: Fix issue reported at mitchellh#3649

下载并导入CentOS 6.3 Box

1
vagrant box add --name centos63 'https://s3.amazonaws.com/itmat-public/centos-6.3-chef-10.14.2.box'

创建Vagrantfile

Vagrantfile 文件内容如下:

Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos63"

# 一个Host-Only的Network, IP地址可以自定义, 方便访问
config.vm.network :private_network, ip: "10.10.0.70", netmask: "255.255.255.0"

# config.vm.synced_folder "../", "/vagrant"

config.vm.provider :virtualbox do |vb|
# 调节虚拟机CPU个数
vb.customize ["modifyvm", :id, "--cpus", "2"]
# 调节虚拟机内存大小
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
end

# 自动安装脚本
config.vm.provision :shell, path: "provision.sh"
end

为了简化安装,提供一个用于自动安装的脚本provision.sh,文件内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash

# Disable yum fastestmirror plugin
sed -i.backup 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
# Change yum mirror (163)
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
yum makecache
yum update

# Install EPEL repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

# Install and start rabbitmq-server
yum -y install rabbitmq-server

## Automatically start
chkconfig rabbitmq-server on

## Create a sample config and enable guest user remote access
echo > /etc/rabbitmq/rabbitmq.config <<EOF
[
{rabbit, [
{loopback_users, []}
]}
].
EOF

## Enable magement plugin
/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management

## Start rabbitmq-server
service rabbitmq-server start

# Disable iptables
service iptables stop
chkconfig iptables off

启动虚拟机

1
vagrant up

使用SSH连接到虚拟机

使用命令(如果支持的话):

1
vagrant ssh

或使用SSH工具,例如 XShell, PuTTY 等工具,连接到 10.10.0.70:22 (IP在之前 Vagrantfile 中定义)

停止虚拟机

1
vagrant halt