How to Set Up a Virtual Machine in Another Virtual Machine? Nested Virtualization Explained

Trending 6 days ago

Virtual machines (VM) tin beryllium very adjuvant if you request to usage aggregate operating systems connected a regular basis. That said, arsenic easy arsenic they are to use, they travel successful galore different types, and picking nan correct 1 tin beryllium tricky.

One peculiar type of virtualization that we don't spot that often is called nested virtualization. It's precisely what it sounds for illustration and is simply a spot tricky to group up, but tin beryllium massively adjuvant if that's nan benignant of point you're looking for.

What Is Nested Virtualization?

In its simplest form, nested virtualization involves moving a virtual instrumentality wrong different virtual machine. That intends you've sewage a big machine and operating strategy moving a virtual instrumentality pinch its ain group of virtualized hardware and software, successful which different VM is running.

man sitting successful beforehand of 4 screens

It fundamentally adds different furniture of virtualization to your hypervisor and tin isolate nan VM from nan big instrumentality by 2 abstracted layers. This has galore usage cases, particularly successful improvement applications wherever you mightiness request an isolated situation to trial retired package frameworks, apps, codebases, and nan like.

What Requirements Do You Need to Use Nested Virtualization?

Based connected nan hypervisor you're using, nan package and hardware requirements for moving a nested virtualization situation tin beryllium different. That said, hardware requirements are going to beryllium much aliases little nan aforesaid crossed nan board. As for software, different programs will person their ain versions that support nested virtualization.

In nan lawsuit of VMware VirtualBox, support for nested virtualization arrived pinch type 6.0 for AMD CPUs. Intel CPUs were added later pinch type 6.1. So each you really request to do is guarantee you're moving nan latest type of VirtualBox, and you should beryllium bully to go.

Why Would You Need to Use Nested Virtualization?

As mentioned above, nested virtualization is mostly utilized successful improvement scenarios to trial package frameworks and codebases successful an isolated environment. However, their usage cases aren't constricted to conscionable that.

VirtualBox moving connected a MacBook Pro

Nested VMs tin beryllium rather cost-efficient arsenic you don't request to adhd further beingness instrumentality for much machines. They're besides easy to move about, truthful if you (or your organization) are moving machines from your section server to nan cloud, nan process tin beryllium arsenic elemental arsenic exporting nan VM files and uploading them to different computer aliases a unreality hypervisor.

Other than this, nan elasticity that nested VMs supply besides gives users nan action to tally aggregate hypervisors. Not each hypervisors are built nan same, and you mightiness request to prime 1 complete nan different astatine times. For example, it's imaginable to tally Windows Hyper-V connected a Windows VM hosted connected VMware's VirtualBox—running 2 hypervisors astatine nan aforesaid time.

Last but not least, they're besides alternatively easy to standard up according to your needs. All you request to do is adhd much storage, RAM, aliases a stronger CPU to your big machine, and nan VMs, arsenic good arsenic nested VMs, will beryllium capable to usage nan further resources successful conscionable a fewer clicks.

How to Set Up a Nested VM

Setting up a nested VM tin really beryllium tricky based connected nan hypervisor you're using. For VirtualBox, though, nan process is arsenic elemental arsenic clicking a checkbox.

  1. Open VMware VirtualBox and click nan Settings icon astatine nan apical aft selecting your VM.
  2. Head complete to nan System conception and click nan Processor tab. Check nan Enable Nested VT-x/AMD-V option, and you're bully to go.
    VirtualBox GUI showing nested virtualization option

On immoderate systems, you mightiness announcement that nan Enable Nested VT-x/AMD-V checkbox is greyed out. You tin override this by utilizing nan VBoxManage tool. Here's how.

  1. Open nan Command Prompt and caput complete to nan VirtualBox installation directory by utilizing nan pursuing command. Note that nan bid uses nan default installation directory, and you should alteration it if you installed VirtualBox elsewhere. cd C:\Program Files\Orcale\VirtualBox
  2. Print nan database of disposable VMs utilizing this command. You tin skip this measurement if you already cognize nan sanction of nan VM you want to change. VBoxManage list vms
  3. Command Prompt model pinch VirtualBox CLI commands
    Finally, type nan pursuing bid and property participate to alteration nested virtualization connected your VM of choice. VBoxManage modifyvm "VM Name" --nested-hw-virt connected

The process for enabling nested virtualization useful nan aforesaid measurement whether you're utilizing Windows, Linux, aliases macOS, including nan terminal commands arsenic they're installed on pinch VirtualBox. Additionally, VBoxManage can do much than conscionable alteration nested virtualization. We've covered six useful VirtualBox commands you tin usage to negociate your VMs here.

Additional Troubleshooting Steps for Enabling Nested Virtualization connected Windows

Sometimes Windows' inbuilt virtualization features tin origin issues pinch nested virtualization. In lawsuit nan GUI and bid statement methods neglect to alteration nested virtualization connected your system, you're going to person to disable nan Virtual Machine Platform feature.

  1. Press nan Windows key, hunt for Turn Windows features connected aliases off, and click nan corresponding hunt result.
  2. Different Windows characteristic options
    Find nan Virtual Machine Platform characteristic successful nan list, uncheck nan checkbox earlier it, and click nan OK fastener successful nan bottommost right.

You mightiness beryllium asked to restart your PC. Once done, you tin effort nan Command Prompt commands mentioned supra to alteration nested virtualization successful your VM. Keep successful mind that you mightiness tally into circumstantial issues based connected your operating strategy and processor. As you'd expect, these require solutions circumstantial to your big situation and hardware.

That said, astir communal issues person either been fixed via updates aliases person been discussed capable for you to find a solution easily. That's not to opportunity that you shouldn't beryllium deterred from trying retired nested VMs conscionable because you tally into a problem while configuring them because resolving specified issues successful astir cases will only return a small investigation and experimentation. Once again, you tin besides simply debar a batch of specified issues if you're utilizing nan latest type of VirtualBox and are connected newer CPUs, whether they're Intel aliases AMD.

Nested VMs Can Be Useful

Not only is it imaginable to create nested VMs, but it tin really beryllium alternatively beneficial if done properly. Sure, it's much suitable for specific, niche workloads, but for nan correct user, nan elasticity and scalability, arsenic good arsenic nan convenience they provide, are good worthy nan flimsy driblet successful performance.

Source Tutorials
Tutorials