Skip to main content

JRuby-on-Rails and MySQL on GlassFish on OpenSolaris in Virtual Box VM

Posted by arungupta on June 24, 2008 at 6:20 AM PDT



My primary development machine is href="http://www.apple.com/macosx/">Mac OS Leopard
on Intel Core 2 Duo (read href="http://blogs.sun.com/arungupta/tags/osxtips">osxtips).
But the beauty of href="http://en.wikipedia.org/wiki/Virtualization">virtualization
is that I can run multiple Operating Systems on a single powerful
machine. And what better virtualization product than href="http://www.virtualbox.org/">Virtual Box.
And  Open
Solaris
has crossed leaps and boundaries making installation
and getting started extremely simple :)



So here is an application stack that I tried:


cellspacing="5">
style="width: 170px; height: 384px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/opensolaris-2008.05-stack.png">
href="http://www.jugsicilia.it/node/91">

Rails 2.1
+ My
SQL 5.0.51a








JRuby 1.1.2






GlassFish
v3 TP2






href="http://dlc.sun.com/osol/opensolaris/2008/05/os200805.iso">OpenSolaris
2008.05





Virtual
Box 1.6.2








Mac OSX Leopard








href="http://www.intel.com/products/processor/core2duo/index.htm">Intel
2.4 G Hz Core 2 Duo



You can easily deploy your Rails applications using MySQL database
on GlassFish installed on OpenSolaris in a Virtual Box VM on Mac OS
Leopard running on an Intel 2 Duo processor machine. Overall a happy
experience :)



The complete instructions to install href="http://dlc.sun.com/osol/docs/content/IPS/virtualbox.html">OpenSolaris
using Virtual Box are very useful.



Here are basic steps ...



Create a new VM (settings given in the href="http://dlc.sun.com/osol/docs/content/IPS/virtualbox.html">instructions):



src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-new-vm.png">



Once all the options are chosen, the generated VM settings are shown as
below:



src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-vm-settings.png">



Booting the Virtual Machine from the Live CD shows the following GRUB:



src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-grub.png">



Pick the default options (GRUB, Keyboard & Language) and then
the following default screen is shown:



href="http://blogs.sun.com/arungupta/resource/images/vb-os200805-license.png"> style="border: 0px solid ; width: 800px; height: 637px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/vb-os200805-license.png">



Read
and Close the license screen. And then click on the "Install Open
Solaris" icon to continue the installation process. This step is
important otherwise you'll keep booting from LiveCD every time (I
messed up on this few times ;).



href="http://blogs.sun.com/arungupta/resource/images/vb-os0805-welcome.png"> style="border: 0px solid ; width: 800px; height: 637px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-welcome.png">



After choosing the Region, Location & Timezone and taking other
defaults, the summarized installation options are shown:



href="http://blogs.sun.com/arungupta/resource/images/vb-os0805-installation.png"> style="border: 0px solid ; width: 800px; height: 637px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-installation.png">



And finally the installation is complete:



href="http://blogs.sun.com/arungupta/resource/images/vb-os0805-installation-complete.png"> style="border: 0px solid ; width: 800px; height: 634px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-installation-complete.png">



After
the installation is complete, shutdown the VM by either selecting
"System, Shut Down..." or click on the X on the VM window and selecting
"Power off the machine". Change the boot sequence order to bring "Hard
Disk" at the top by clicking on "Settings", "Advanced" tab and changing
the order as shown below.



src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-boot-sequence.png">



And
finally, you can easily deploy a Rails 2.1 application on this newly
configured machine as explained in href="http://blogs.sun.com/arungupta/entry/rails_2_1_on_glassfish">Rails
2.1 on GlassFish. href="http://blogs.sun.com/arungupta/entry/totd_35_rails_database_connection"> TOTD
#35 explains how Rails Database connection need to be
configured on Solaris.

The final output of the application looks like:



href="http://blogs.sun.com/arungupta/resource/images/vb-os0805-complete-app.png"> style="border: 0px solid ; width: 800px; height: 636px;" alt=""
src="http://blogs.sun.com/arungupta/resource/images/vb-os0805-complete-app.png">





Here are some pointers for you to get started:

Did you know the 3 keywords for GlassFish
v3
- Modularity (OSGi compliant), Extensiblity (non-Java
apps) & Emebeddability (runs in-VM) ? Read more on href="http://glassfish.org/v3">GlassFish v3 main page.



Stay in touch with us by posting your questions/comments/concerns to href="http://forums.java.net/jive/forum.jspa?forumID=138">GlassFish
Web Tier Forum or href="mailto:webtier@glassfish.dev.java.net">webtier@glassfish.



Technorati: href="http://technorati.com/tag/rubyonrails">rubyonrails
jruby href="http://technorati.com/tag/ruby">ruby href="http://technorati.com/tag/opensolaris">opensolaris
virtualbox
mac href="http://technorati.com/tag/glassfish">glassfish
v3

Related Topics >>