Thursday, December 26, 2013

Install oracle java 7 in ubuntu

If you want to install Oracle Java 7 in ubuntu, you need to execute following commands in terminal

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Tuesday, December 24, 2013

Communicating with muliple guest VMs

It's a common use case to have multiple VMs configured in a Virtual Box and be able to communicate to them from host. e.g. you may want to setup tomcat in a two node cluster and be able to access the nodes from the terminal in host machine.

By default, while using Virtual Box, guest VMs can see host but host can not see the guest VMs.

following blog has a very good explanation of how to solve this.

http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox


 

Sunday, October 6, 2013

FATAL: Cannot find sub command for: 'ec2'

I was trying to execute knife command to create ec2 server however i was getting error.


here is the command that i was executing:

$ knife ec2 server create -G default -I ami-7000f019 -f m1.small   -S java-quick-start -i ~/.ssh/java-quick-start.pem -x ubuntu   -r 'role[base],role[dbapp_database_master],role[dbapp],recipe[dbapp::db_bootstrap],role[dbapp_load_balancer]'

this is the error i was getting:

FATAL: Cannot find sub command for: 'ec2 server create -G default -I ami-7000f019 -f m1.small -S java-quick-start -i /home/pankaj/.ssh/java-quick-start.pem -x ubuntu -r role[base],role[dbapp_database_master],role[dbapp],recipe[dbapp::db_bootstrap],role[dbapp_load_balancer]'
The ec2 commands were moved to plugins in Chef 0.10
You can install the plugin with `(sudo) gem install knife-ec2


I continued getting this error even when i installed knife-ec2 using command

gem install knife-ec2

finally it worked when i executed following:

$ /opt/chef/embedded/bin/gem install knife-ec2

/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:in `initialize': No such file or directory - getaddrinfo (Errno::ENOENT)

I was trying to upload cookbooks from my workstation to hosted chef and thats when i was getting the error:

/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:in `initialize': No such file or directory - getaddrinfo (Errno::ENOENT)

command that i was executing was :

knife cookbook upload -a -VV

It worked fine when i executed following commands

sudo apt-get install ruby-dev

sudo knife cookbook upload -a -VV

Saturday, September 7, 2013

Missing File Menu in VirtualBox Manager


I was trying to configure "Host-Only" Networking in virtual box. The host machine in this case has ubuntu OS.

In network settings page, when i selected "Host-only Adapter", it was not showing any options.  

Instead, it showed following message at the bottom.
"On the network:Adapter 1 page, no host only network adapter is selected"





When i was trying to find the possible solution on web, every where they suggested to configure it at "File->Preferences->Network".

I could not fine File menu in the virtual box manager.

After lot of googling, i found the secret. It turned out that File menu is hidden.

https://forums.virtualbox.org/viewtopic.php?f=7&t=42333

I had to maximize the VirtualBox manager window and then hover mouse cursor over the title bar in order to see File menu!!!