nested virtualization

Discussions related to using VirtualBox on Linux hosts.
Post Reply
dod0bob
Posts: 4
Joined: 10. Jan 2023, 16:52

nested virtualization

Post by dod0bob »

Hi everybody,
I tried to install Ubuntu 16.04.6 on a virtual machine using Virtualbox 4.0.36 (host Ubuntu 10.04). My host machine is already a virtual machine hosted on a MacOS system. I've already checked the nested virtualization option. I'm wondering if this type of job can be done because I'm continuously getting the same error. I've attached the log files but if somebody needs more info about my host system (both 10.04 and MacOS) or guest settings please ask me.
Attachments
log.zip
(25.69 KiB) Downloaded 5 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: nested virtualization

Post by scottgus1 »

Please provide the host Virtualbox log, too.

4.0.36 may be too long in the tooth to withstand being used in nested virtualization.
dod0bob
Posts: 4
Joined: 10. Jan 2023, 16:52

Re: nested virtualization

Post by dod0bob »

My MacOS host machine (6.1.34) has never thrown any error but I attach the log folder as requested.
MacOs machine is a i5 2,7GHz dual-core and 8GB of RAM
10.04 machine is a 2GB of RAM
16.04 machine is a 512MB of RAM
Attachments
logMACOS.zip
(147.29 KiB) Downloaded 6 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: nested virtualization

Post by mpack »

The VM log contains the following warning:
guest log wrote: 00:00:00.520 Console: VM runtime error: fatal=false, errorID=Ext4PartitionDetected message="The host I/O cache for at least one controller is disabled and the medium '/home/test/VirtualBox VMs/ubuntu/ubuntu.vdi' for this VM is located on an ext4 partition. There is a known Linux kernel bug which can lead to the corruption of the virtual disk image under these conditions.
00:00:00.520 Either enable the host I/O cache permanently in the VM settings or put the disk image and the snapshot folder onto a different file system.
00:00:00.520 The host I/O cache will now be enabled for this medium"
Whether it's relevant, I don't know. 4.x is too old for me to remember much about it.

I see that the guest has detected and enabled HWACCM, which I believe is the "engine" for hardware accelerated virtual machines, so enabling nested VM has worked to that extent. But 4.0.x is very old. I don't know how happy it will be to see this feature implemented by a modern (at the time) i5 processor.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: nested virtualization

Post by fth0 »

In your outer VM, you seem to be running a 32-bit Ubuntu 10.04 on a 64-bit virtual CPU (General > Basic > Version is set to Ubuntu (64-bit)). Although that is technically allowed, I don't know if this is supposed to work correctly in a VirtualBox VM running another 32-bit VirtualBox version.

FWIW, HWACCM is the old name of HM (Hardware Acceleration Manager).
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: nested virtualization

Post by mpack »

I kept an XP (32bit) host PC for long after its sell-by date. I was not completely unusual in that regard. In my case it was well into the Win10 era before I gave a Win7 host a try (I needed 64bit memory management for a 3D CAD app I was developing), from there I migrated to Win10 as soon as my work IT people allowed it.

It used to be commonplace to host 32bit and 64bit VMs on a 32bit host PC. It has always been less common to run a nested VM inside the first VM, but I don't remember any special caveats, except of course that VirtualBox didn't have the ability to reflect VT-x/AMD-v into the VM back then, so all nested VMs had to be 32bit, single CPU core.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: nested virtualization

Post by fth0 »

Thanks for your insights, mpack! :)

The situation is a bit different here, running a 32-bit VirtualBox 4.0.36 on a 32-bit Ubuntu 10.04 on a (virtual) 64-bit CPU provided by a 64-bit VirtualBox 6.1.34 on a 64-bit macOS host. I'm wondering if a 32-bit VirtualBox application works correctly on a (virtual) 64-bit CPU, because the virtual 64-bit CPU is not identical to the physical 64-bit CPU of the host.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: nested virtualization

Post by mpack »

I think the situations are similar. My XP host was running on a PC which had a 64bit capable CPU (my hardware was always up to date - I simply migrated my established XP image when I had a new PC). As I said, I don't remember that running VirtualBox 32bit on a 64bit CPU created any particular caveats. Naturally I was required to install the 32bit version of VirtualBox on my XP host.
dod0bob
Posts: 4
Joined: 10. Jan 2023, 16:52

Re: nested virtualization

Post by dod0bob »

Thanks everyone for the answers and the interesting facts on nested virtualization. I gave up on this solution because my Mac seems to be overstressed. Thanks again.
multiOS
Volunteer
Posts: 800
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: nested virtualization

Post by multiOS »

dod0bob wrote:Thanks everyone for the answers and the interesting facts on nested virtualization. I gave up on this solution because my Mac seems to be overstressed. Thanks again.
I am not surprised by your experience as the Log you supplied shows that your Mac Host has a Dual-Core Processor and a just 8GB Ram so expecting it to run even 1 VM may be stretching its capabilities beyond Apple's expectation of its use. Add nested virtualisation to the mix and.....
dod0bob
Posts: 4
Joined: 10. Jan 2023, 16:52

Re: nested virtualization

Post by dod0bob »

Unfortunately I can't upgrade the ram because it is soldered to the logic board but I don't think that it would be enough to run more VMs.
Post Reply