Is VirtualBox incompatible with kernel zones?

Discussions related to using VirtualBox on Solaris hosts.
Post Reply
martyscholes
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances

Is VirtualBox incompatible with kernel zones?

Post by martyscholes »

I can't find any information on the net, but I am starting to think that hosting VirtualBox machines on Solaris makes it impossible to use kernel zones. Several VirtualBox machines are running and trying to install openstack into a kernel zone produces:

bash-4.1$ sudo zoneadm -z OpenStack-KZ install -a Downloads/sol-11_2-openstack-x86.uar
Platform does not support the kernel-zone brand.
zoneadm: zone OpenStack-KZ failed to verify

The virtinfo command does not show kernel zones available:
bash-4.1$ virtinfo
NAME CLASS
non-global-zone supported

The messages log shows that something became upset about SVME in EFER:
bash-4.1$ grep zvmm /var/adm/messages
Nov 13 08:34:35 dl585 zvmm: [ID 145084 kern.info] NOTICE: kernel-zone virtual environment not supported: SVME already enabled in EFER
Nov 13 08:34:47 dl585 zvmm: [ID 145084 kern.info] NOTICE: kernel-zone virtual environment not supported: SVME already enabled in EFER
Nov 13 08:34:50 dl585 zvmm: [ID 145084 kern.info] NOTICE: kernel-zone virtual environment not supported: SVME already enabled in EFER
Nov 13 08:34:52 dl585 zvmm: [ID 145084 kern.info] NOTICE: kernel-zone virtual environment not supported: SVME already enabled in EFER
Nov 13 08:34:52 dl585 zvmm: [ID 145084 kern.info] NOTICE: kernel-zone virtual environment not supported: SVME already enabled in EFER

It appears that VirtualBox latched onto the CPU virtualization capability and left Solaris with no way to use them? Do I have this right? Is there a workaround?

Machine has 4x Opteron 8431 CPUs which meet the minimum specification for kernel zones. VirtualBox is version 4.3.18 on Solaris 11.2.

Many thanks,
Marty
Ramshankar
Oracle Corporation
Posts: 793
Joined: 7. Jan 2008, 16:17

Re: Is VirtualBox incompatible with kernel zones?

Post by Ramshankar »

Yes, there's a workaround. Tell VirtualBox to relinquish hardware virtualization features when it's not executing guest code. This has a tiny performance hit, but should work:

Code: Select all

VBoxManage setproperty hwvirtexclusive off
You will need to do this once, before starting any VirtualBox VMs after boot up of the host system.
Oracle Corp.
martyscholes
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances

Re: Is VirtualBox incompatible with kernel zones?

Post by martyscholes »

Ramshankar wrote:Yes, there's a workaround. Tell VirtualBox to relinquish hardware virtualization features when it's not executing guest code. This has a tiny performance hit, but should work:

Code: Select all

VBoxManage setproperty hwvirtexclusive off
You will need to do this once, before starting any VirtualBox VMs after boot up of the host system.
Many thanks. It is now set on boot with:

Code: Select all

svcbundle -o /lib/svc/manifest/site/ConfigVB.xml -s service-name=site/ConfigVB -s start-method="$(which VBoxManage) setproperty hwvirtexclusive off" -s model=transient
It seems that the above service only sets it for user root. Is there a way to set it systemwide?

Thanks again,
Marty
Ramshankar
Oracle Corporation
Posts: 793
Joined: 7. Jan 2008, 16:17

Re: Is VirtualBox incompatible with kernel zones?

Post by Ramshankar »

You don't need to do it on every boot, sorry I wasn't more clear in my previous post.

You just need to do it once and VirtualBox remembers the setting. Whichever user runs VirtualBox, they need to use the VBoxManage command and it will update the VirtualBox config. file (VirtualBox.xml) with the right value.

If you're doing it in some automated fashion, you'll need to 'su' as that user and run the VBoxManage command.
Oracle Corp.
martyscholes
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances

Re: Is VirtualBox incompatible with kernel zones?

Post by martyscholes »

That seemed to work. Many thanks!
tazmo
Posts: 4
Joined: 30. Nov 2011, 16:02
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: All

Re: Is VirtualBox incompatible with kernel zones?

Post by tazmo »

Thanks for this... I have been looking all over for an answer to using kernel zones and vbox concurrently.

I am going to assume this person is using a recent Solaris 11.2 SRU ( s11.2.8.0.4 is current at the time of this post ) and this behavior is exhibited only in recent SRU's (or fairly recent).

But can we get this documented consistently somewhere please?

If you research this issue, this page states running the two together can panic Solaris:
http://docs.oracle.com/cd/E36784_01/htm ... gnzfn.html

At the end of this page in the "Notes" (at the VERY end) it says Vbox and kernel zones CAN be used together but to check the virtualbox documentation:
http://docs.oracle.com/cd/E36784_01/htm ... -kz-5.html

While I could have missed it, I looked through the VBox docs (v4.3.26) and could find no reference for the two working together. Google brought me to this post.

I realize different product groups are responsible for each of these documentation sets, but having a consistent answer would be greatly appreciated.

Lastly a statement as to whether this is also supported by Oracle support would be icing on the cake.

Thanks.
Ramshankar
Oracle Corporation
Posts: 793
Joined: 7. Jan 2008, 16:17

Re: Is VirtualBox incompatible with kernel zones?

Post by Ramshankar »

tazmo wrote:Thanks for this... I have been looking all over for an answer to using kernel zones and vbox concurrently.

I am going to assume this person is using a recent Solaris 11.2 SRU ( s11.2.8.0.4 is current at the time of this post ) and this behavior is exhibited only in recent SRU's (or fairly recent).

But can we get this documented consistently somewhere please?

If you research this issue, this page states running the two together can panic Solaris:
http://docs.oracle.com/cd/E36784_01/htm ... gnzfn.html

At the end of this page in the "Notes" (at the VERY end) it says Vbox and kernel zones CAN be used together but to check the virtualbox documentation:
http://docs.oracle.com/cd/E36784_01/htm ... -kz-5.html

While I could have missed it, I looked through the VBox docs (v4.3.26) and could find no reference for the two working together. Google brought me to this post.

I realize different product groups are responsible for each of these documentation sets, but having a consistent answer would be greatly appreciated.

Lastly a statement as to whether this is also supported by Oracle support would be icing on the cake.

Thanks.
I will try to add this to the VirtualBox User Manual for the upcoming major release of VirtualBox 5.0 and possibly backport it to 4.3 later.
Oracle Corp.
tazmo
Posts: 4
Joined: 30. Nov 2011, 16:02
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: All

Re: Is VirtualBox incompatible with kernel zones?

Post by tazmo »

I will try to add this to the VirtualBox User Manual for the upcoming major release of VirtualBox 5.0 and possibly backport it to 4.3 later.
Thank you Ramshankar.
Post Reply