VirtualBox on Opensolaris short cuts

VirtualBox on Opensolaris short cuts

Introduction

Purpose

Scope

Described how to install VirtualBox 2.1.2 on OpenSolaris Express snv_107

References

Acronyms

Installation

  1. download the virtual box for Solaris.
  2. pkgadd -d VirtualBoxKern-2.1.2-SunOS-r41885.pkg all
  3. pkgadd -d VirtualBox-2.1.2-SunOS-r41885.pkg all
    • Answer y to change of uid etc.
  4. bootadm update-archive
    • See Ref1
  • To run it: /opt/VirtualBox/VirtualBox

Creating a virtualbox in a zone

  1. Create a zone

Create a Zone

  1. mkdir -p /common/zones/vbox
  2. chmod 700 /common/zones/vbox
  3. zonecfg -z vbox -f /common/sun/vbox.cfg
  4. zoneadm -z vbox install
  5. cp /common/sun/sysidcfg /common/zones/vbox/root/etc
  6. cp /common/sun/site.xml /common/zones/vbox/root/var/svc/profile
  7. touch /common/zones/vbox/root/NFS4
  8. zoneadm -z vbox boot
  9. cp xp_slipstream.iso /common/zones/vbox/root/
  10. zlogin vbox
  11. setenv PATH
    ${PATH}
    :/opt/VirtualBox
    • on non (t)csh use EXPORT PATH=$
      ${PATH}
      :/opt/VirtualBox
  12. VBoxManage createvm -name "WindowsXP" -register
  13. VBoxManage modifyvm "WindowsXP" -memory "256MB" -acpi on -boot1 dvd -nic1 nat
  14. VBoxManage createhd -filename "WinXP.vdi" -size 3000 -register
  15. VBoxManage modifyvm "WindowsXP" -hda "WinXP.vdi"
  16. VBoxManage openmedium dvd /xp_slipstream.iso
  17. VBoxManage modifyvm "WindowsXP" -dvd /xp_slipstream.iso
  18. VBoxHeadless -startvm "WindowsXP"
    VirtualBox Headless Interface 2.1.2
    (C) 2008-2009 Sun Microsystems, Inc.
    All rights reserved.
    
    Listening on port 3389
     

Then you can connect from Solaris using: rdesktop -a 16 192.168.0.244

creatvm output

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Virtual machine 'WindowsXP' is created and registered.
UUID: 6a29ca8f-bd65-4269-8353-ea2a137819ae
Settings file: '/root/.VirtualBox/Machines/WindowsXP/WindowsXP.xml'

modifyvm output

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

createhd output

VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Disk image created. UUID: 3ebef187-c77c-4008-807c-9284456d6fd2

zone configuration file: vbox.cfg

vbox.cfg
create -b
set zonepath=/zones/sparse
set autoboot=true
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add inherit-pkg-dir
set dir=/opt
end
add net
set address=192.168.0.244
set physical=e1000g0
end
add device
set match=/dev/vboxdrv
end
commit

sysidcfg

sysidcfg
name_service=none

network_interface=PRIMARY {primary
   hostname=sparse
   ip_address=192.168.0.244
   netmask=255.255.255.0
   protocol_ipv6=no
   default_route=192.168.0.254
}

# Next line only works for Solaris Express Releases so far!
nfs4_domain=dynamic

root_password=MAKE_ME_VALID

security_policy=none

system_locale=C

terminal=vt100

timeserver=localhost

timezone=US/Central

site.xml

site.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='profile' name='site'>
  <service name='avahi-bridge-dsd' type='service' version='0'>
    <instance name='default' enabled='false'/>
  </service>
</service_bundle>

Trouble shooting

Installation

VirtualBox cannot run under xVM Dom0

## VirtualBox cannot run under xVM Dom0! Fatal Error, Aborting installation!
pkgadd: ERROR: postinstall script did not complete successfully
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 28

    Predrag.Zecevic says:

    First of all, thank you for this nice document and for sharing your experience...

    First of all,

    thank you for this nice document and for sharing your experience with us!

    A question: does step 3. in Installation section shows proper command (I mean: is switch -G has to be supplied)?
    I am asking, because VirtualBox installation mention that step, but w/o use of -G switch.

    Best regards.

    1. May 28

      HenryPepper says:

      I appologies for the late answer. Thank you for your kind words. I have removed ...

      I appologies for the late answer.
      Thank you for your kind words.
      I have removed the -G from both commands.
      So please go ahead and install the packages without the switch.
      The install I have running here, had the packages installed with the -G option.
      What the -G does it to ensure that the package is only installed in the zone where the pkgadd command is run.
      If run in the Global Zone, then the package will only be installed in the Global Zone, it will not be installed in any current zones, nor will it be installed in any new zones created.
      The advantage of using -G on a package in the Global Zone, is that it is one package less to be installed in a new zone. Also it would save time when a package is patched, if it's only installed in one zone.

      I believe, but I need to test this, that the kernel module will only need to be installed in the GlobalZone.
      You could also do the same for the second package, and then, I assume, install the package specifically into any zone where you might need it.
      I need to test both theories.

      All this however shouldn't really have any impact on less it is on a production system with numerous zones (more than 5).
      Henry

  2. May 29

    Predrag.Zecevic says:

    Well, thanks for answer. Then I have another question: if zone was created with...

    Well,

    thanks for answer. Then I have another question:
    if zone was created with:
    -<snip vbox.cfg>--
    add inherit-pkg-dir
    set dir=/opt
    end
    --</snip vbox.cfg>--
    do i need to install (any) VirtualBox package at all?

    BTW: Documentation for VirtualBox say that kernel module package has to be installed wit '-G' switch.
    Other is then 'passed' to the zone with inherit-pkg-dir directive?

    1. May 29

      HenryPepper says:

      Hi Thank you for the information on the -G, I'll need to read the Sun documenta...

      Hi

      Thank you for the information on the -G, I'll need to read the Sun documentation again, I just skimmed it to get the VB running.

      As to the issue with other package. I would assume that you need it, I believe that is the rest of the applications needed to create a virtual environment.
      So you would need to install both package. It shouldn't matter what kind of zone your are installing.

  3. May 29

    Predrag.Zecevic says:

    Hi again, i have just realized that my OpenSolaris (2009.06 snv_111a amd64) did...

    Hi again,

    i have just realized that my OpenSolaris (2009.06 snv_111a amd64) didn't created d-bus instance in zone, so start of VM fails:
    --<snip>--
    VBoxManage -nologo startvm CentOS5
    Waiting for the remote session to open...
    ERROR: Virtual machine 'CentOS5' has terminated unexpectedly during startup
    Details: code NS_ERROR_FAILURE (0x80004005), component Machine, interface IMachine, callee <NULL>

    ls -al /var/lib/dbus/machine-id
    ls: cannot access /var/lib/dbus/machine-id: No such file or directory

    ls -al /var/lib/dbus/
    ls: cannot access /var/lib/dbus/: No such file or directory

    ls -al /var/lib/
    ls: cannot access /var/lib/: No such file or directory

    svcs -a | grep dbus
    $ NOTHING !!!
    --</snip>--

    Do you have idea? VirtualBox version is 2.2.2

    1. May 31

      HenryPepper says:

      Hi Sorry, I do not know what the problem is. There is however a couple of MAili...

      Hi

      Sorry, I do not know what the problem is.
      There is however a couple of MAiling lists where you would be able to get support. http://www.virtualbox.org/wiki/Mailing_lists
      Good luck

  4. Nov 09

    daveabrahams says:

    I presume VirtualBox can't run in an xVM domU, either?

    I presume VirtualBox can't run in an xVM domU, either?

    1. Nov 10

      HenryPepper says:

      I don't know. It might be in the documentation, or it might be worth for you to...

      I don't know.
      It might be in the documentation, or it might be worth for you to try it.
      I'd appreciate an update if you find out.
      Henry

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact