Showing posts with label cloud / virtualization. Show all posts
Showing posts with label cloud / virtualization. Show all posts

Tuesday, December 20, 2011

VMware virtual network configuration: NAT port forwarding

Playing with virtualization is fun. You can entertain yourself as if you have an army of many computers, connected with one or more (virtual) networks.

There are 3 possible configurations of virtual networking in VMware:

1.Host-only: the virtual computers (VM) are connected each other in the virtual networks inside a host (myPC), which is connected to the internet via IP 123.456.789.012. They can access the internet data but it's impossible for a computer in the internet (e.g. Annie) to send request to these VM since the virtual networks are private (e.g. IP in the 198.168.X.X range).

2.Bridge: you're lucky. The network administrator in your company is your best friend, so he gave you several free slots of IP addresses. Thus the VM has its own IP address (e.g. 123.456.789.013). The VM acts just like a real PC, the computers in the internet can reach this VM.

3. NAT: Well, your organization has a limited IP addresses, but with NAT you can still have possibility to let other computers in the internet to access your VM. For example you have a webserver using port 333 in the VM 198.168.11.12, using Network Address Translation (NAT) you can use the port 444 in the myPC host 123.456.789.012 to expose this webserver to the internet.

The vmware network configuration can be set using vmware-config.pl in Linux or vmnetcfg.exe in Windows. Here is a screenshot example over how to configure the NAT / port forwarding from the host 123.456.789.012:444 to the VM webserver in 198.168.11.12:333.



Notes:
How to get vmnetcfg.exe for VMware Player Windows:
  1. Download the installer
  2. Extract the installer: VMware-player-installer.exe /e tempdir
  3. Extract the network.cab in the tempdir, it contains vmnetcfg.exe
If you update the VMware Player vmnetcfg.exe is not extracted by standard installation so the vmnetcfg.exe in your VMware directory  is still the old version that missmatch with the new VMware version. Thus you need to repeat this procedure to replace the old vmnetcfg.exe in your VMware directory.


Source: Steve's blogs http://soa-java.blogspot.com/

Any comments are welcome :)




Note: you can achieve the same thing with iptables service in linux, but this vmware-config approach is easier.

References:

Friday, April 29, 2011

Which free Virtual Machines to use?

VMware Player
• free
• easy to use (don't need to read documentation)
• support both windows & linux as OS hosts
• Even though the name is "player", you can also create new virtual machines with some basic settings (memory size, virtual storage size), to use port forwarding for NAT-virtual networking you need to use a configuration utility which is "hidden" in one the the cab files.

VMware Server
• free
• it seems that VMware stopped maintaining this software so it has compatibility problems with the new OS (e.g. Windows 7, Fedora 14), you can resolve the problems but it costs time.

VMware vSphere ESX
• a newer version of VMware Infrastructure
• hypervisor architecture: faster & you don't have to pay an extra license for the host OS
• bad points: need a dedicated machine
• bad points: expensive license

VMware Infrastructure
• not free (evaluation period for 2 months, so backup your virtual machine images just in case that someday you can't access them anymore due to an expired license)
• old


Oracle Virtual Box:
• good points: free, open source
• documentation: oracle website

Microsoft Virtual PC
• good points: free, easy to use (don't need to read documentation)
• negative points: Windows host only

Xen
• good points: free
• negative points: linux host only

KVM & QEMU
• good points: free
• negative points: linux host only


Finally I chose VMware Player due to reasons:
• free
• support both windows & linux as OS hosts
• support windows & linux as OS guests (even with tricks you can run MacOS too, handy for example for iPhone application development)
• in my work we use VMware products, so I need to work with VMware compatible virtual machine images
• APIs (e.g. Perl, COM) are available to control virtual machines in your development/test environments via scripting / (web)applications.
• I have feeling that VMware products are the best (due to their pioneering & dominance in the virtual machine market for years). After installing add-in tools, you can easily copy-paste / click-drag to copy text, files, etc.
• currency/maintained

PS. Although in my work we have a licence for VMware, for example we use also VMware Lab Manager (a configuration manager for VMware ESX virtual machines), I was looking for a free virtual machines for personal use.

Please leave any comments if you know any other good virtual machines or you have different opinions about the virtual machines discussed here.


References:
An outdated book but still worth to read for ideas/best practices. It discusses real world scenarios about managing virtual machines in your development/test environments, and the examples of COM/Perl API usages.


Another good book about VMware vSphere admin: