Sunday, November 14, 2010

Using snapshots with VirtualBox 3.2.10

Before I am going to install the OSB on my Oracle Enterprise Linux virtual machine with SOA Suite 11g I want to experiment a little with snapshots.  Snapshots give me the possibility to store a working state of my virtual machine. So when the installation does not work I can restore to this previous working state.
In the virtualbox console there is a tab named Snapshots. Here a list is shown with all snapshots and the current state of your virtual machine. First I want to take a snapshot of the current state. You can do this by pressing the right most image button or right clicking on the Current State.
In the popup I entered some details.
In the list a new item is added before the current state as seen below.  
A snapshot has been created now.
So far so good. Now I did some changes to my current state (I deleted a directory). So let’s see I can go back to the previous state and see if the directory is restored again. To do this I right clicked on the snapshot and selected Restore Snapshot.
A window popped up warning me my virtual machine will be rolled back to the moment of the snapshot. I pressed Restore as this is exactly what I want.
After some processing (progress shown in a window I did not capture) my snapshot was restored. When I opened my virtual machine the previously deleted directory was restored so it worked.
In this case I restore to the first snapshot before the current state. When I would have restored to a snapshot skipping some snapshots how do I get rid of  these skipped snapshots that have become obsolete. To test this I created three snapshots and restored the first one.
To get rid of the two obsolete snapshots I want to delete them as I do not want to return to anymore. This was very easy, just delete the two snapshots by right clicking on one of these snapshots and select Delete Snapshot.  
So suppose my installation went ok. I do not need the snapshot anymore and want to remove it. This can be done by merging the snapshot (or snapshots if you have created more) and the current state.

In some other post I read you have to work your way down from the most recent snapshot to the latest and merge them by executing Delete Snapshot (Ctrl+Shift+D).



Resulting in a nice clean empty list.

I can only conclude working with snapshots is easy with virtualbox. I feel safe enough to do my installation of OSB knowing I can always return to a working state.

Friday, November 12, 2010

Trying the Pre-built Virtual Machine for SOA Suite and BPM Suite 11g - Part One

Until now I have always worked with VMWare as virtualisation solution. I used the VMWare player and was very happy with it. I knew of the existence of Virtualbox but never felt the need to use it. Until I found out there was a pre-built virtual machine for SOA Suite (and BPM Suite). So I though lets give it a try.

I downloaded the virtual box for windows (I run windows 7 professional) and installed it. This was very easy as expected. Now I needed to download the virtual machine itself. This took some time because the download consists of a number of files of 1Gb each and some smaller ones and a larger one of 1,7 Gb. After downloading them you need to run a script to combine seven of the downloaded files to a single file again. This took about ten minutes on my machine. It looked like my system hung but this was not the case. I just had to be patient.
Now I could import the virtual machine into virtualbox. This process also took some time but finally I was ready to startup my VM for the first time. 




















The vm started and when I entered oracle/oracle I could login and saw the desktop with the links to the most important applications. Firefox is also installed and contained shortcuts to the most important consoles.
The VMWare itself has two disks, one with the operating system and utilities of 6 Gb. 5.5 Gb of diskspace is already full so not a lot of space left. A second disk of 20Gb contains the oracle software and is mounted as /oracle. After starting the weblogic server instances I could open Enterprise Manager. It all seemed to be working fine.
















The network has been switched off by default. You can switch it on again by browsing to System>Administration>Network. When you have entered the oracle password you will get a window like this:

After pressing activate the network will be switched on and you can use the internet. (You will see some errors but these were not so severe it did not work :-)

I wanted to update the virtualbox guest additions. When you select Devices>Install Guest Additions... an iso will be mounted as a disk. It contains a cmd file you should be able to run to install the lasted version of the additions. With me this did not work. Some browsing on the internet provided me with a solution. I opened a terminal window and browsed to this disk (under /media folder). Instead of running autorun.sh I typed:  sh ./VBoxLinuxAdditions-x86.run. Now the additions were installed. (You need root access of course so use: su -)

Now I wanted to be able to access the disks on my guest system from my host and the other way around. You can use Shared Folders for this. It did not work out-of-the-box unfortunately. Adding a host directory as a shared folder did not work. During boot I also noticed the error: sbin/mount.vboxsf mounting failed with the error : protocol error. Some browsing on the internet solved the issue. Under Devices>Shared Folders... I changed the folder name to SharedFolders. Now it was mounted.

I also wanted to be able to connect the old fashion way. Because my guest and my host are in a network they should be able to connect to each other. I only got this working when I switched from NAT to Bridged. Now I can use WinSCP to connect to my virtual machine and transfer files.
You can also mount a windows share in your virtual machine by connecting to a server. Follow Places>Connect to Server... and select the windows share option. fill in the fields and voila.

USB Devices I did not get working. One time I was close as the virtual machine detected an USB hard drive that was formatted with NTFS which is not supported. In the virtualbox settings for the virtual machine I added my usb stick in the filter section. When I tried to select the USB device from my virtual machine it tried to install some kind of driver in windows which fails. In the virtual machine itself i got an error window. I will have to look into this some more to find a solution.

As firefox is installed on the 6Gb (root) file system it uses the tmp directory for temporarily storing download parts during downloading. When you try to download large files (> 500 Mb) you run into trouble I noticed. As the space left on this file system is less than 500 Mb firefox stops downloading although I selected /oracle/downloads on the other file system as my download location. This file system has at least 9 Gb of free disk space. In my case firefox became corrupt so I had to reinstall it. Downloading large files I now do on my host and transfer them with WinSCP. I could not find any way of changing the location firefox uses to store the temporarily download parts.

As this was my first time I used virtualbox I had to find out how virtualbox works compared to VMWare. One if these things was what to do when virtualbox crashes. I found out I had to kill still running instances in the task manager to have the running state reset in the virtualbox console. With vmware you have to delete some files to reset the state so this is a different approach.


Conclusion
With some tailoring and some experimenting you can make this virtual machine into a fully functional and connected  environment. There were some glitches like a practically full root file system and the fact I did not get USB devices working under windows 7. Although I must admit I am not a seasoned expert on Linux and on Virtualbox. As far I can see virtualbox has become a good alternative for VMWare.
I hope to have solved some of the issues in the future to boost my expertise on the subjects. I also want to add an OSB to the installation. More about this in future posts.

Open for business

I just started this blog and hope to publish some of my adventures with the Oracle Fusion Middleware stack soon.