Back to the archive

From the archive

Install a VirtualBox inside a VirtualBox, or I think we call it Nested VirtualBox

Background

A lot of people asked about the possibility of running a VirtualBox machine inside a VirtualBox machine, but it seems that not too many people were actually trying that out. Recently I happened to have the chance to try that because of an assignment from uni. My plan was to have 7 to 8 virtual machines running to have a virtual environment that demonstrates network security-related setups, like VPN, firewall, IDS, Kerberos, RADIUS, LDAP and many more. Because I already have a home desktop workstation running Arch Linux (more details here) with enough resources for that, I decided to set up the environment on that workstation.

My problem is that I already have a few virtual machines running on that and I do not want to mess up the existing environment, so I decided to have a large and relatively powerful virtual machine that “hosts” 8 other virtual machines.

Configuration and Results

My home workstation has an i7-4770 CPU and 32G of RAM, which should be enough for that many virtual machines. So I created a 50G virtual hard drive and allocated 8G of RAM for the 1st level virtual machine. Then I installed VirtualBox in that machine and created a few 2nd level virtual machines in it. My VirtualBox is still running.

In a word: it works, but with limitations. I can only have 32-bit virtual machines running at the 2nd level, but not 64-bit ones, even though my host machine and 1st level virtual machine have a 64-bit architecture. The problem, I think, is that the 1st level virtual machine cannot get VT-x working (check by running cat /proc/cpuinfo and checking whether you have vmx or svm in the flag section), so it is more likely to be software-level virtualisation instead of hardware-level virtualisation. For more details on that, read VirtualBox documentation here.

Another thing is that I cannot get Red Hat-based operating systems installed, which includes Fedora 19, CentOS 6.4 and RHEL 6.4 itself. No idea why. I just get a kernel panic during the installation for CentOS and RHEL 6.4 and a super slow, hardly progressing Fedora installation, so I did not even finish the install process.

But anyway, the performance is not too bad and 32-bit virtual machines work just fine for demonstration purposes at uni. And I think not many people will be able to allocate too many resources to 2nd level machines because of the fact that home machines are still limited. By the way, I haven’t tried any 3rd level virtualisation or other virtualisation technologies like VMware or KVM.