VirtualBox 可以在 Amazon EC2 实例下执行吗?
我们有一个测试系统,在每次主要测试之前都会启动 VirtualBox VM 快照。快照包含特定于测试的被测试系统的状态。
这是一个内存密集型测试。
有一个想法是将日常测试运行转移到 Amazon EC2 大型实例(7.5G RAM)中。
但我的理解是 EC2 本身就是一个主管。是否允许另一个VM软件(VirtualBox)在其下启动?
We have a test system where a VirtualBox VM snapshot is started before each major test. The snapshot contains a state of the tested system specific to the test.
This is a memory-intensive testing.
There is an idea to move the daily test run into Amazon EC2 Large instance (7.5G of RAM).
My understanding though is that EC2 is a supervisor itself. Will it allow another VM software (VirtualBox) to get started under it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
嗯,亚马逊现在允许导入 VirtualBox 和 VMWare 虚拟机。尚未支持所有操作系统,但它们可以使用:
http://aws.amazon.com/ec2/vmimport/< /a>
因此,无需在 Amazon 下运行 VirtualBox,只需导入并克隆虚拟机作为实例即可。
Well, Amazon now allows to import VirtualBox and VMWare VMs. Not all operation systems are supported yet, but they work on it:
http://aws.amazon.com/ec2/vmimport/
So there is no need to run VirtualBox under Amazon, one can just import and clone the VM as an instance.
不,我不相信它会。
我不是 100% 清楚到底为什么,但我的理解是 VirtualBox 主机需要访问 ring 0,但由于您的主机将在虚拟化系统中运行,因此它将无法获得此访问权限。
如果您确实想要在其他虚拟机中运行虚拟机,则可以使用QEMU。因为它是一个处理器模拟器,所以它不依赖于任何底层硬件,因此它可以“在任何地方”工作。但缺点是速度慢得多。
No, I don't believe it will.
I'm not 100% clear on exactly why, but my understanding is that the VirtualBox host needs access to ring 0, but since your host will be running in a virtualized system it won't be able to get this access.
If you really want to run virtual machines inside other virtual machines, you can use QEMU. Because it is an a processor emulator it doesn't depend on any of the underlying hardware, so it will work “anywhere”. The downside, though, is that it's much slower.
我已在 Windows AMI 下运行 VirtualBox。我试图在 Linux 下运行它,但存在各种依赖性和麻烦。
速度慢得令人痛苦。
所以答案是“是”,但除非你真的绝望,否则你可能不想这样做。
I have run VirtualBox under a Windows AMI. I'm trying to run it under Linux but there are all sorts of dependencies and hassles.
It is painfully slow.
So the answer is "yes" but you probably don't want to do it unless you're really desperate.
我尝试做一些事情,虽然至少对于 来说没有多大意义,它就像 VM 中的 VM,如果它可以帮助某人
这是它的样子,
I tried to do something, although it won't make much sense at least for , it's like VM inside VM, if it helps somebody
Here is how it looks,
我还没有找到一个极其“权威”的来源(例如明确的 EC2 或 VirtualBox 文档),但答案似乎肯定是:否。
到目前为止我找到的最好的解释是 在 AWS EC2 实例上运行 Hyper-V、VMware 或 Xen?:虚拟化感觉类似于模拟,就好像亚马逊正在运行一个“CPU模拟器应用程序”。但虚拟机管理程序更像是一个内核:它在实际物理 CPU 上主张某些特权,且仅属于其自身。就像内核阻止应用程序使用可能干扰其他应用程序的物理 CPU 功能一样,虚拟机管理程序是一种“超级内核”,可以防止内核使用可能干扰其他内核的物理 CPU 功能。
基本上:亚马逊的虚拟化软件已经在使用 VirtualBox 所需的特权指令集。您必须按照 David 建议使用模拟器,或者以某种方式将 VirtualBox 映像转换为 Amazon 支持的格式VM Import 工具 — 本质上是将您的 VM 转换为直接作为其自己的 EC2 实例运行。
I haven't yet found an exceedingly "authoritative" source (e.g. explicit EC2 or VirtualBox documentation) but the answer definitely seems to be: No.
The best explanation I've found so far is in Running Hyper-V, VMware or Xen on an AWS EC2 Instance?: virtualization feels like emulation, as if Amazon is running a "CPU simulator app". But a hypervisor is more like a kernel: it claims certain privileges on the actual physical CPU, exclusively for itself. Just like a kernel prevents apps from using physical CPU features that would interfere with other apps, a hypervisor is something of a "superkernel" that prevents kernels from using physical CPU features that might interfere with other kernels.
Basically: Amazon's virtualization software is already using the privileged instruction sets that VirtualBox would need. You will have to either use an emulator as David suggests, or somehow convert your VirtualBox image into a format supported by Amazon's VM Import tool — essentially convert your VM to run directly as its own EC2 instance.
我今天尝试在 Amazon EC2 中使用 Virtual Box。这是我发现
64 位虚拟机根本无法工作的情况。因此,您必须在 Virtual Box 中仅使用 x86 VM。您还必须将每个虚拟机的 CPU 数量限制为 1。它不适用于 1+ CPU。您可以直接在
vm_name.vbox
文件中修改它。查找注意:测试时 Virtual Box 上的主机操作系统是“Ubuntu 14.04 x64”,来宾操作系统是“Ubuntu 14.04 x64/x86”
I tried working with Virtual Box in Amazon EC2 today. Here is what I found
64 Bit VM's doesn't work at all. So you have to use only x86 VM in Virtual Box. You also have to limit CPU count per VM to 1. It doesn't work with 1+ CPU. You can modify it in
vm_name.vbox
file directly. Look for<CPU count="1" hotplug="false">
Note: Host OS on Virtual Box was "Ubuntu 14.04 x64" and guest OS was "Ubuntu 14.04 x64/x86" while testing
近期有一些新的进展。现在AWS已经裸露了
金属盒子,这不是虚拟机,而是实际的物理盒子。
不幸的是,由于 AWS 硬件非常密集,您可以获得的最小盒子是 m5d.metal,它是 96 核、768GB 的怪物,其性能相当价格昂贵。此外,这些产品似乎也没有现货市场。
我只是尝试在 m5d.metal 盒子上启动 Ubuntu 实例,安装 Vagrant 和 VirtualBox 并尝试运行我的 Windows 盒子之一。它按预期工作,没有任何问题。
There were some new developments recently. Now AWS has bare
metal boxes, which are not VMs, but actual physical boxes.
Unfortunately, because AWS hardware is super dense the smallest box you can get is m5d.metal, which is 96 core, 768GB monster which comes quite pricey. Also, it looks like there is no spot market for those either.
I just tried to spin up Ubuntu instance on m5d.metal box, installed Vagrant and VirtualBox and tried to run one of my Windows boxes. It worked as expected without any problems.
我今天尝试了这个,明确的答案是:不。
您可以安装 GUI,但不会安装内核模块:
I tried this today and definitive answer is: No.
You can install the GUI but kernel module will not install:
所有 AWS 实例(包括裸机实例)都已在虚拟化环境中运行。
在 EC2 实例中运行 VirtualBox 意味着您希望在已存在的虚拟环境中运行另一个虚拟环境(称为嵌套虚拟化)。
AWS 提供了名为裸机(.metal) 实例的特殊实例类型来支持嵌套虚拟化。
因此,对于 VirtualBox、Hyper-V 或 EC2 实例中的任何其他虚拟环境,请使用任何可用的裸机实例。但它们的成本非常高。
All AWS instances including the bare-metal ones already run in a virtualized environment.
Running VirtualBox in an EC2 instance means you want to run another virtual environment inside an already existing virtual environment called nested virtualization.
AWS has provided special instance types named bare-metal(.metal) instances to support nested virtualization.
So, for VirtualBox, Hyper-V, or any other virtual environment in an EC2 instance, use any of the available bare-metal instances. They are very costly though.
对于那些有兴趣了解“嵌套虚拟化”如何在裸机 EC2 实例上工作的人:
上面的最后一个命令显示嵌套虚拟机的虚拟化类型是“virtualbox”。
For those who are interested in seeing how "nested virtualiztion" works on bare metal EC2 instances:
The last command above shows the virtulization type of the nested VM is "virtualbox".