Virtualization can help with this and here is how to host your whole environment locally in your machine using VirtualBox.
In an Enterprise you will find Solaris, Windows, OSX, Unix and what not. I personally use a Mac Book Pro with VirtualBox. In VirtualBox I can run as many VMs as I need to recreate the surrounded environment.
Ideally we should have an environment following the next features:
- The guest should have connectivity to internet taking advantage of your network configuration in the host
- The guest should communicate to the host even if no internet connection is available
- The guest should automatically work independent what network you are using, from work, from home or even on the road with no local network at all
Virtual box will allow these features if we just add a first network interface as NAT (for internet) and the second as host-only (for connectivity with the box)
We will show this process using a virtualized instance of an Advent Geneva Server (A Solaris Box with some proprietary Accounting Software). It is useful to have this server locally to be able to mess with RSL reports for example without affecting other members of the dev or operations team.
In the host find the vboxnet0 interface to be sure you use an IP in the same network later on in the guest:
$ ifconfig -a ... vboxnet0: flags=8843
mtu 1500 ether 0a:00:27:00:00:00 inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255 ...
In the Solaris guest ...
Configure first interface (NAT) to use DHCP
$ touch /etc/dhcp.e1000g0 $ rm /etc/hostname.e1000g0 $ touch /etc/hostname.e1000g0 $ ifconfig e1000g0 plumb $ ifconfig e1000g0 up $ ifconfig e1000g0 dhcp start
And second interface (host-only) to use a static IP
$ vi /etc/hosts ... 192.168.56.2 genevadev loghost ... $ rm /etc/dhcp.e1000g1 $ vi /etc/hostname.e1000g0 192.168.56.2 $ ifconfig e1000g1 plumb $ ifconfig e1000g1 genevadev up ...
Be sure to define DNS available from any network to connect to the internet (only to be used in the case you do need internet in the guest) If you really need to access local resources you might want to add local DNS as well.
$ vi /etc/resolv.conf nameserver 18.104.22.168 nameserver 22.214.171.124
Make sure you see both interfaces (the NAT and host-only). They should show up as e1000g0 and e1000g1. The first with an internal 10.0.xxx.xxx IP and the second with the static IP you picked (for this example 192.168.56.2)
$ ifconfig -a
Clearly the static IP must be in the same subnetwork (192.168.56.xxx).
You should be able to connect to the internet from the guest and at the same time ssh into it using its 192.168.56.2 IP. Do not forget to add in your host the new created server resolution:
$ vi /etc/hosts genevadev 192.168.56.2
The question about sharing this environment or building it from scratch is one interesting topic. An even more interesting is left as homework and it deals with devops. In reality regardless the path you follow you should automate your actions and there is where things like http://vagrantup.com/ and puppet/chef can help you further.