Monday Nov 15, 2010

Video Tutorial: Installing Solaris 11 Express in VirtualBox

Today, Solaris 11 Express is available for download allowing customer to get a preview of the technologies that will be delivered in Solaris 11 next year.  In this video tutorial, I take you through the steps to install and configure Solaris 11 Express using Oracle's free Type 2 hypervisor, VirtualBox.  VirtualBox can be downloaded for free and is available for MacOS, Solaris, Linux and Windows Platforms.

Solaris 11 Express is binary compatible with Solaris 8, 9 and 10 and is supported on SPARC as well as X86 chip sets. It is a fully virtualized operating system to include virtual networks, zones and file systems (ZFS).  Learn more about What's New in Solaris 11 Express.  You can also learn more about Solaris 11 by reviewing these slides from the recent Oracle Solaris Summit.

The video is 13 minutes long and through the magic of digital video editing covers "just the good parts" without all the waiting around.  I created it using the built-in screen recording features of Quicktime X on MacOS 10.6 and used iMovie 09 for the editing and voiceover.  It's available on YouTube and viewing it in full screen mode makes it easier to see the terminal commands.

Listen to the Podcast and Download Solaris 11 Express today. (Use the "LiveCD" ISO download version which includes the GUI installer)

FAQ:

  • How do I get out of the virtual machine and back to my host OS?
    • VirtualBox defines a "HOST" key.  The default in MacOS is the Left Command key.  Pressing this key releases the cursor and keyboard from the VM control.  You can change this key in VirtualBox Preferences.
  • How do I make the virtual machine run in full screen mode?
    • On MacOS, use Command-F or the VirtualBox menus to switch between window mode and full screen mode.
  • My Virtual machine is locked in a low resolution display mode?  How do I get it to adjust properly to the window size?
    • You MUST have the VirtualBox guest extensions installed.  The VM must be rebooted after installing.
  • What's the difference between the "Solaris" choice in VirtualBox VM settings and Solaris 64-bit?
    • If you choose, Solaris the system will boot the 32-bit kernel.  If you choose Solaris 64-bit, it will choose the 64-bit kernel.  Only a single install is required because both the 32 and 64-bit kernel are installed.  In fact, you can change this parameter after installing Solaris 11 Express and it will automatically boot the correct kernel.
  • How did you find out all these tips?
    • See the VirtualBox Help menu.  It's actually quite helpful.
  • How do you make the folder sharing work without having to manually mount the file system each time as root?
    • See by original blog entry on sharing folders which I recently updated describing how to give the user the Primary Administrator role.  It describes how to add a mount command to the Gnome startup options.
  • Where can I learn more about the installation procedure?

Tuesday Mar 24, 2009

Sharing Folders in VirtualBox

One of the new features of the recently posted VirtualBox 2.2 beta1 is that you are finally allowed to share folders from an OpenSolaris guest to a MacOS host.  This increases the usability of VBox substantially for me because I've been using a workaround for a while.

It's easy to setup the sharing capability in the Virtualbox GUI. With your VM running:

Devices > Shared Folders

Enter the path of a folder on our Mac and the "Share" name that you will be using to reference it on your OpenSolaris system.  The folder name does not need to be related to the actual folder path.

UPDATE NOTE:  In Solaris 11 express build 151a, the initial user is NOT configured as Primary Administrator by default and the pfexec command listed below will not work until you give the user that role. 

  • System > Adminstration > Users and Groups
  • Click on your username and Properties
  • User Profiles tab, select  Primary Administrator and click OK 

On the OpenSolaris side, you need to mount the file system to make it visible to the user.

bash-3.2$ id
uid=101(jlaurent) gid=10(staff) groups=10(staff)

bash-3.2$ mkdir mac
bash-3.2$ pfexec mount  -F vboxfs -o uid=101,gid=10 jlaurent /export/home/jlaurent/mac

This, however, is annoying to do each time you reboot so it would be nice to have the file system mount on boot up.  Adding a line to /etc/vfstab should help.

 jlaurent    -    /export/home/jlaurent/mac    vboxfs    -    yes    uid=101,gid=10

Unfortunately, in my testing, this prevented the system from booting.  Thanks to Michael, I learned that this is because Solaris process vfstab BEFORE it completes the ZFS mount of my home directory in /export/home.  Changing the line to:

jlaurent    -    /mac    vboxfs    -    yes    uid=101,gid=10

Fixed the problem.  

However, it's not very convenient at /mac.  There are a few other options.

You can also add the line you your .bashrc file but that only takes effect when you start a new terminal window.  The best option for me was to place the line in the Gnome session startup scripts.

System > Preferences > Sessions > Add


There's a little trick, however, that was non-intuitive to me the first time I did this.  My file system was NOT mounting on login and I didn't know why.  I checked into my .xsession-errors file and found the message: mount: command not found.

As you can see in the screen shot above, the absolute pathname is required for commands executed during login.

Issues:

StarOffice and Gedit do NOT want to save data back into this folder even though cp and vi have no problem with it.  I'm still researching this issue.



Thursday Nov 06, 2008

File sharing OpenSolaris guest in VirtualBox on Mac host

Sun's VirtualBox type II hypervisor is a great free tool for running multiple guest OSes on your desktop.  I use VBOX on my Mac to run Solaris 10 and OpenSolaris.

One of the weaknesses of VBOX at this time is that the "guest additions" don't yet support file sharing from a Solaris guest OS.  There are ways around this, however, using SMB protocols.  Here's how....

  • Configure SMB sharing on your Mac
    • Apple Menu > System Preferences > File Sharing pref pane
    • Enable File sharing
    • Click Options
    • Enable Share files and folders using SMB
    • Enable your username account for file sharing. Doing this exposes your home folder on the network as a Windows shared folder. Make sure you have a good password!
  • Install Solaris or OpenSolaris in VirtualBox
  • Configure NAT networking
  • Open a Nautilus file browser
  • Go > Location
  • Enter: smb://10.0.2.2/<usernameonmac>
  • Enter your password
  • A new file browser should open with your mounted files.
  • Bookmarks > Add Bookmark

This works because when NAT networking is configured the Solaris guest gets an IP address of 10.0.2.xx.  The VBOX hypervisor acts not only as DHCP server but also as gateway and host at IP address 10.0.2.2.

In OpenSolaris, you can also do this using the Places > Connect to server menu item.  Choose Custom Location from the pull-down menu and enter the SMB address.

For more on accessing Windows Sharing check out Brian Leonard's blog entry.

Meanwhile, make sure to get the free downloads of Solaris 10, OpenSolaris or VirtualBox.


Monday Sep 08, 2008

Using Virtual Box on MacOS to host a Solaris Sun Ray server

With the release of Virtual Box 2.0, I'm happy to report that VB for Mac now supports "host networking." What does this mean to you?  In the 1.x version of VB for Mac, only NAT support was included which made it extremely difficult for your Solaris OS within VB to actually act as a server on the network.  With the new host networking, the Solaris VM can now assign itself an IP address on your network.

With this in mind, I set about to reproduce the steps I detailed earlier this year for creating a Sun Ray thin client server on my Mac.  After configuring a new Solaris 10 VM with 1 GB of RAM, 8 GB of disk and host network, I installed the Sun Ray server software (using my handy instructions previously posted),  and it worked with no problem.

In case you haven't heard of it, Virtual Box is:


Thursday May 15, 2008

Importing Solaris VMDK image into Virtual Box

Virtual Box 1.6 has been released and is no longer in beta for MacOS X.  One of the advertised features is the ability to import VMDK image files from VMware into Virtual Box.  Being the eternal optimist, I decided to try it.  How long could it take?  A few minutes maybe?  I have quite a few different VMs in Fusion and did this with Solaris 10 08/07.

Virtual Box is:

  • a type 2 hypervisor
  • Free
  • Open Source
  • supported on a variety of host OSes (Windows, Linux, Macintosh and OpenSolaris)
  • capable of running a variety of guest OSes
  • now owned and being developed by Sun Microsystems as part of the open source xVM family of virtualization products

The first part was easy. Extract the VMDK file and import it into Virtual Box

  • Right click on your chosen VM.  Choose "Show Package Contents"
  • Find a file with a .vmdk suffix.  Click once to select
  • Command-D (duplicate it) Wait a few minutes while Mac OS copies the multi-GB file
  • Drag the copied file to another location
  • Start Virtual Box
  • File > Virtual Disk Manager
  • Click Add.  Locate and select the copied .vmdk file. Click OK.
  • Create a New VM as usual using the added vmdk file
  • Boot the VM

That should have been it, right?  Unfortunately, after seeing the grub screen and attempting to boot Solaris, I entered an infinite loop of rebooting OS.  Obviously, it's mostly working but something is still wrong.  Luckily, inside of Sun, we archive our mail aliases and Rudolf Kutina had already posted a solution to the problem.

The rebooting sequence resulted from the fact that VMware Fusion emulates SCSI disks (c0t0d0s0) while VBox emulates IDE disks (c0d0s0).  Because of this, the Solaris device trees and vfstab mount entries are not correct.  Rudolf's solution is not for the weak of heart but DOES work.  After all, it's all just a virtual machine and if I screw it up, I just make another copy.  What have you got to lose?

  1. Boot into Solaris Safeboot mode. You can get access at the Grub menu, usually is the 2nd or 3rd option.
  2. Mount the found Solaris partition on /a , Safeboot will usually find the slice on the disk with Solaris and ask if you want it to mount on /a. Select Yes.
  3. Move /a/dev, /a/devices, and /a/etc/path_to_inst to another name (I just append .orig) and then create new directories, (mkdir) /a/dev and /a/devices, and touch file /a/etc/path_to_inst.
  4. Run "devfsadm -r /a" to rebuild the device tree
  5. set TERM so we can use 'vi', TERM=vt100; export TERM
  6. Now we need to fix boot disk patch changes Edit /a/boot/solaris/bootenv.rc and fix the line with "setprop bootpath '/pci@0,0....' to match the path you'll find mounted for /a (i.e. run a 'df -k' command, and you should see /a mounted from /dev/dsk/c1d0s0 or something, then run 'ls -l /dev/dsk/c1d0s0' or whatever your device listed was, and you should see the actual link point to ../../devices/pci@0,0/...ide..)
  7. Fix also disk naming in /a/etc/vfstab to match IDE "c0d0sx" scheme. Change each instance of c1t0d0s0 to c0d0s0 etc.
  8. Recreate archive "bootadm update-archive -v -R /a" to rebuild the boot-archive on /a
  9. Force to reconfigure on next boot with 'touch /a/reconfigure'
  10. Delete /etc/dhcp.e1000g0 /etc/hostname.e1000g0 create /etc/dhcp.pcn0.
  11. Run "cd /; sync; sync; sync; umount /a"
  12. reboot with 'init 6'

Enjoy your new Virtual Box machine.

Instructions are also available for importing a Windows XP .vmdk file to Virtual Box.

About

Jim Laurent is an Oracle Sales consultant based in Reston, Virginia. He supports US DoD customers as part of the North American Public Sector hardware organization. With over 17 years experience at Sun and Oracle, he specializes in Solaris and server technologies. Prior to Oracle, Jim worked 11 years for Gould Computer Systems (later known as Encore).

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today