VirtualBox on Amazon EC2

This is for discussing general topics about how to use VirtualBox.

VirtualBox on Amazon EC2

Postby BradEC2 » 17. Sep 2012, 07:24

I've been trying to get VirtualBox running in Ubuntu 12.04 running on an Amazon EC2 instance, but have been getting the error "Running VirtualBox in a Xen environment is not supported." After a lot of searching I haven't found an explanation... but have a thought. Is the problem that Amazon EC2 is based on Xen, and that VirtualBox can't run in a Xen-hosted virtual machine? I've run VirtualBox in a VMWare-hosted virtual machine, but maybe that is different..?

Any help would be greatly appreciated!
BradEC2
 
Posts: 4
Joined: 17. Sep 2012, 07:19

Re: VirtualBox on Amazon EC2

Postby mpack » 17. Sep 2012, 11:42

BradEC2 wrote:Is the problem that Amazon EC2 is based on Xen, and that VirtualBox can't run in a Xen-hosted virtual machine?

Without a doubt.

BradEC2 wrote:I've run VirtualBox in a VMWare-hosted virtual machine

No, you haven't.
mpack
Site Moderator
 
Posts: 25242
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox on Amazon EC2

Postby BradEC2 » 17. Sep 2012, 16:21

mpack wrote:
BradEC2 wrote:Is the problem that Amazon EC2 is based on Xen, and that VirtualBox can't run in a Xen-hosted virtual machine?

Without a doubt.


Would I have the same problem with Qemu (under Ubuntu on Amazon EC2)?

mpack wrote:
BradEC2 wrote:I've run VirtualBox in a VMWare-hosted virtual machine

No, you haven't.


Ahh, but I did:)... just booted to confirm. Why do you think it wouldn't work?
BradEC2
 
Posts: 4
Joined: 17. Sep 2012, 07:19

Re: VirtualBox on Amazon EC2

Postby mpack » 17. Sep 2012, 16:57

You can't run one Hypervisor inside another: In the case where VT-x is not used, VirtualBox works by reserving ring0 for itself and running the guest OS in ring1. Thus "ring0" (actually ring1) hardware accesses by the guest can be intercepted by a higher privilege level and diverted onto simulated hardware. Obviously it can't do that if ring0 is not available (bear in mind that the CPU is not being simulated, so pretending to be in a higher privilege level is not possible).

In the case where VT-x is used, only one root mode client is allowed.

I don't know what you think you are seeing, but I'm pretty sure you can't be seeing a VirtualBox VM running inside another VM. If I'm wrong then I'm sure one of the devteam will want to correct me.
mpack
Site Moderator
 
Posts: 25242
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox on Amazon EC2

Postby Y E T I » 17. Sep 2012, 17:21

Actually it is possible under certain circumstances. Only 32 bit guests will work and the host must support nested paging.
Y E T I
 
Posts: 161
Joined: 9. Aug 2010, 01:47
Location: H i m a l a y a s
Primary OS: Other
VBox Version: OSE self-compiled
Guest OSses: ?

Re: VirtualBox on Amazon EC2

Postby BradEC2 » 17. Sep 2012, 17:48

Y E T I wrote:Actually it is possible under certain circumstances. Only 32 bit guests will work and the host must support nested paging.


A more detailed description of the situation... I have a 32-bit CentOS VM in VirtualBox in a Windows VM running in VMware Fusion on a Mac (Mac OS 10.7... is that "Lion"?). See the attached picture.

Question... is the problem here that Ubuntu doesn't "support nested paging" and Windows 7 does? If so, would things work on EC2 if I replaced Ubuntu with Windows 7?

Many thanks!!

PS - There is a good reason for doing all of this:). I am configuring a virtual network lab using GNS3 and VirtualBox for the advanced networking class I teach at UC. My fallback will be to install this environment on physical machines running either Windows or Linux, but fully virtualized is my first preference. Thx again!
Attachments
VMinVM.jpg
CentOS VM in VirtualBox in Windows VM in VMware Fusion on Mac.
VMinVM.jpg (102.87 KiB) Viewed 11994 times
BradEC2
 
Posts: 4
Joined: 17. Sep 2012, 07:19

Re: VirtualBox on Amazon EC2

Postby BradEC2 » 17. Sep 2012, 18:40

Y E T I wrote:Actually it is possible under certain circumstances. Only 32 bit guests will work and the host must support nested paging.


A little more data... in the example I gave on my Mac, the Windows 7 VM (running in VMWare) is 32bit, and the "enable hypervisor applications in this VM" box is not checked in the VMWare config (the explanation given for this checkbox is "enables running modern virtualization applications by providing support for Intel VT-x/EPT inside this virtual machine).

Also, VirtualBox (which is running the 32bit CentOS image) does have the "Enable VT-x/AMD-V" and "Enable Nested Paging" boxes checked in both scenarios (EC2 and VMWare).

So another difference is the "level 1" VM is 32bit (Win7) in my VMWare example but 64bit (Ubuntu 12.04) in the EC2 example. Also, I don't know how to tell if EC2 has any of these virtualization technologies enabled for the Ubuntu "level 1" VM in that scenario.

Again, thanks for all the help!

Brad
BradEC2
 
Posts: 4
Joined: 17. Sep 2012, 07:19

Re: VirtualBox on Amazon EC2

Postby Jazon » 3. Jun 2013, 10:40

I'm interested in doing something similar on EC2 with VirtualBox, were you ever successful ?

Another possibility might be to use an older (< 4.0) version of VMware Player, which doesn't require VT-X/AMD-V. I haven't tried this though, and it would likely be pretty slow in the guest OS.

I'm not familiar with GNS3, but it might be possible for you to use Amazon EC2's Virtual Private Cloud for your network lab purposes. It allows you to create your own non-routable subnet, control NAT, routing, etc. Can also install hardware-VPN (costs extra for this VPN, but otherwise free). Each student could spawn N Instances within their own VPC, so it would be segregated from other students. Some instance types can only have 1 IP, but Spot pricing makes the larger Instance types much cheaper.

(I tried to send you PM, but it kept saying I had URLs and was a new user, so it wouldn't send)
Jazon
 
Posts: 1
Joined: 3. Jun 2013, 10:06

Re: VirtualBox on Amazon EC2

Postby software developer » 28. Jul 2016, 00:42

It maybe a bit late, and not strictly relevant to virtualbox, however, it is possible to nest hypervisors. A couple of years ago I managed to run a virtual ESXI server running within VMWare player on a Windows PC, connect vsphere to it and then deploy both a Linux guest OS and Windows OS guest to the virtual ESXI instance. I was then able to power them on and interact with them through the console running in vsphere client on the host Windows PC, install VMWare tools and directly RDP into them from the host. Who says nesting isn't fun?
software developer
 
Posts: 1
Joined: 28. Jul 2016, 00:36

Re: VirtualBox on Amazon EC2

Postby mpack » 28. Jul 2016, 11:02

You are correct - that is not at all relevant to VirtualBox. This topic (and website) is about the features of VirtualBox, not the features of other VM platforms.
mpack
Site Moderator
 
Posts: 25242
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 11 guests