Friday, June 29, 2012

VirtualBox on non-global zones

Of course it's best to run VirtualBox from a non-global zone.
I have successfully tested this on VirtualBox version 4.2.18.
But, unfortunately, since 4.3 series, at least up to 4.3.4, it's broken.
Create and configure non-global zones adding the following:

# zonecfg -z vboxzone              
     "add device;                  
      set match=/dev/vboxdrv;      
      end"

# zonecfg -z
vboxzone              
     "add device;                  
      set match=/dev/vboxusbmon;   
      end"


Next boot the non-global zone and install the VirtualBox package stream (.pkg) and its extension pack (.vbox-extpack) as performed in VirtualBox on the global zone.

Alternatively, for greater simplicity, instead of repeating the installation in the non-global zone, it may be well enough just to lofs map /opt/VirtualBox from the global zone and adjust PATH to include it.

# zonecfg -z vboxzone              
     "add fs;                  

      set type=lofs;   
      set dir=/opt/VirtualBox;   
      set special=/opt/VirtualBox;   
      end;   
      end"

NOTE
 
  • Naturally, /dev/vboxusbmon is not applicable to Solaris 10.
  • If on Solaris 11, consider making the zone immutable