VirtualBoxImg

Feasibility study for VirtualBox images

Contents


Intro

VirtualBox (VB) is a family of x86 virtualization products that allow to an unmodified operating system with all of its installed software to run in a special environment, on top of your existing operating system. This environment, called a "virtual machine", is created by the virtualization software by intercepting access to certain hardware components and certain features. The physical computer is then usually called the "host", while the virtual machine is often called a "guest". Most of the guest code runs unmodified, directly on the host computer, and the guest operating system "thinks" it's running on real machine.

Product

The idea is to distribute VB disk images with pre-installed OpenSolaris, NetBeans and Sun's runtimes (GlassFish, MySQL, ..). User would just download the image, register in VB installation and the system should be ready for development at the moment.

Proof of concept

The following section describes the experiment that we did with VB and OpenSolaris. The main goal of the experiment is to verify the whole idea, performance of VB on the typical host system, setup experience and also test how the image would be distributed to users.

We installed the latest version (1.6.6) of VirtualBox on Toshiba Tecra laptop (Intel Centrino Duo, 2 GB RAM) and Win XP that is the most used configuration by NetBeans users, see statistics. Then, we created the new OpenSolaris virtual machine with 1GB allocated memory (recommended by OpenSolaris on VB installation document) and 8 GB hard disc with dynamically expanding image (recommended is 10GB, see).

http://wiki.netbeans.org/attach/VirtualBoxImg/os_VirtualBoxImg.png

Further, the latest available version of OpenSolaris 2008.05, NetBeans 6.0.1, GlassFish v2 and MySQL 5.0 were used for installation. The operation system was installed from CD media and additional software via package manager. MySQL and GlassFish didn't work after plain installation from IPS and additional steps were required like registering as domain and setup of MySQL database. The overall time for installation and post-install steps was approximately 2 hours.

This was the VB image that can be distributed to our end users, installed and pre-configured system. User just need to download and register VB file to VB on his machine.

The next step was to use the installed virtual system as development platforms and simulate the common developer's work flow, e.g. build, clean, deploy and debug. We used JSPWiki that is mid-size J2EE application as reference project.

Issues

  • Very slow startup of OpenSolaris guest in comparison with Ubuntu that is two times faster.
  • OpenSolaris occupied almost doubled memory then Ubuntu, see below table
Operation System Memory after startup (MB) Memory, GlassFish running (MB)
OpenSolaris 594 840
Ubuntu 157 300
  • The machine started to swap after several build/deply/run cycles and the overall system performance become very

bad and it was impossible to use the system for regular development work, see the screenshot where you can see the OS host memory after 30 minutes development staff. Also, we couldn't use the host system anymore due high load.

http://wiki.netbeans.org/attach/VirtualBoxImg/swap_VirtualBoxImg.png

  • VB uses NAT as default networking approach for guests. Network address translation is used in conjunction with network masquerading which hides private network addresses. Therefore, extra steps are needed in case we want to expose guest's services to other clients (host machine, machines on host's network). For instance, exposing http service can be done by port forwarding (require to setup protocol, host/guest port). We tested port forwarding for ssh/http and it works very well. The other technique is host interface networking that creates new interface on host. We didn't test this approach but it seems more suitable when you need expose more services on your guest.
  • Shared folders that can be used for exchanging files between the host and guest doesn't work for OpenSolaris guest.
  • Deployment to guest from host system was slow. We tried to use configuration when the IDE is running on host (Win XP) system and application server runs on guest. Therefore, we created the rule for AS admin port 4848 and register the server in IDE as remote server. The deployment was pretty slow since IDE doesn't support directory deployment for remote servers and the deployment requires building war file, copy to remote server, unpack, ...

The size of the image was approximately 3 GB that isn't suitable to deliver to users as download. We shrinked the image by 'VBoxManage modifyvdi' command but the size change was really minimal. Probably, disc defragmentation would reduce the size a little bit but we didn't find out the tool that does defragmentation on zfs. Also, only installation was done on the image (no huge move,delete disc operation) hence further improving can be minimal. Zip compression (we use default compression ratio in WinZip) was applied on OpenSolaris VDI file and the size was reduced to 1.3 GB.

The vdi images is host system independent (image was tested on Win XP, Ubuntu and Win Vista). User should create new virtual machine in VB, setup parameters like allocated memory and choose the image as Boot Hard Disk. The installation on new machine takes 5 minutes.

OpenSolaris installation iso (700 MB) is available on dlc server. The download on my laptop took 1 hour. It means the whole installation and setup takes 3 hours. If I downloaded the pre-installed image then I would save 1 hour (2 hours download + 5 mins installation vs. 1 hour download + 2 hours installation system and runtimes).

Use cases/Customers

The next section describes possible use cases and customers for the images.

  • Desktop application developer The image can be useful for the developers who need to reproduce/debug bugs that are reported against Solaris operating system.
  • J2EE developer Using NetBeans and appliaction server on guest is really painful due performance degradation and it's not suitable for daily base development. The remote deployment is possible but due missing directory deployment it's pretty slow. Also, I don't see any major benefits why to deploy J2EE applications to guest machine with Solaris instead to my host system.
  • Solaris C/C++ developer NetBeans 6.5 introduces new feature for C/C++ remote development that allows to run NetBeans on local desktop (which can be any platform which runs NetBeans) and build, run, and debug on remote lab machine. The image can simplify the development native Solaris application from Win XP that is the most popular platform on desktops.

http://wiki.netbeans.org/attach/VirtualBoxImg/c_VirtualBoxImg.png

Production requirements

The effort that should be done before releasing image as product:

  • Disabling Solaris services that are not needed for developers. This one can reduce memory requirements.
  • Try to resolve how to setup port forwarding automatically after installation
  • Use more efficient compression (-9, we use default compression ratio for experiment)
  • NetBeans QE performs full test on OpenSolaris hence we don't need to do special testing with image
  • Maintenance cost of the image can be high if we will need to update it when each of three main components changes.

Conclusion

Usage by NetBeans developers

The image with pre-installed OpenSolaris and runtimes can be attractive for C/C++ developers who have Solaris as target platform. Also, image can be used in C/C++ NB pack tutorials since the installation doesn't require any Solaris experience. The usage by J2SE developers for bugs verification is disputable and they likely don't need all the preinstalled SW.

Usage by Glassfish developes

Of course, the image can be attractive also for J2EE developers but we need provide more features that they can utilize. For instance, we can provide better dtrace integration, support for directory deployment for remote servers, ..... The virtualization is very helpful for modeling data centers with low investment. Setup of load balancing or cluster configuration for Glassfish is pretty complicated hence we can produce the images with these configs. Users can simple install this on their machine and test J2EE applications behavior on this configuration.

The image can be entry point to cloud computing. Users can download image, deploy J2EE application and required software and test it. Then the final image can be uploaded to cloud infrastructure and switch the application to production. For instance, skytap allows to deploy own images and run them on virtual lab machines.

Recommendation

?? Make your opinion or ask for an experimental image. ??

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo