Wednesday, September 26, 2012

From VMware Player to VirtualBox

I've made the switch from VMware Player to VirtualBox.

It's really simple — Out of the box, Virtualbox has the capability to read VMware .vmdk files, although I did convert mine to native VirtualBox .vdi files with the following command:
VBoxManage clonehd --format VDI
With VirtualBox, you also don't have to do anything out of the ordinary to setup port forwarding from the host OS to the guest OS. Just remember that the default guest IP address in VirtualBox is 10.0.2.15. So adjust your network settings accordingly.

Also, VirtualBox let's you play around with virtualised deployment tools like Vagrant, which currently does not support VMware.

Have fun!

Sunday, July 15, 2012

Static IPs for Ubuntu Server 12.04 guest in VMware Player

If you want your Ubuntu 12.04 guest VM to have a static IP, you can do the following:
  • Use the NAT mode in the VMware network settings (Virtual Machines > Virtual Machine Settings > Network Adapter > NAT)
  • In Ubuntu, edit /etc/network/interfaces with your favourite editor (I use VIM) to add some configuration lines — check out the "Static IP Address Assignment" section in  https://help.ubuntu.com/12.04/serverguide/network-configuration.html 
  • For example, I use the following:
    auto eth0
    iface eth0 inet static
    address 192.168.111.111
    netmask 255.255.255.0
    network 192.168.111.0
    broadcast 192.168.111.255
    gateway 192.168.111.2
    dns-nameservers 192.168.111.2
  • Make sure that the Virtual Network Editor settings for VMnet8 (NAT) match your static ip, e.g., the Subnet IP is consistent with your static IP. If you are running VMware Player and don't already have the Virtual Network Editor installed, take a look at this post for instructions on how to install it for free. 
  • Most importantly, make sure the gateway / DNS relay is set to 192.168.111.2. I had tried changing it to 192.168.111.1, but that address is reserved for the VMnet8 adapter. It took me a while to figure out how VMware networking works, but it all made sense after reading this fantastic primer by RedNectar! Incidentally, the last IP in your DHCP range is reserved for the DHCP server, so don't set it to that either.
Have fun!

Thursday, June 28, 2012

Vim plugin for some cool Drupal voodoo

At the Learning Drupal London meetup last night at Hub Westminster, I picked up a great little tip for the Drupal users out there using VIM.

There is a handy little VIM plugin that streamlines common Drupal actions like looking up Drupal functions in the API docs and getting values for Drupal variables. It is available at http://drupal.org/project/vimrc.

Thanks @justafish!

Sunday, June 17, 2012

VMware Player advanced network configuration

VMware Player is a fantastic free (as in beer, but not speech) virtualisation software available on Windows 7. I've been running Ubuntu in a VM for my development work and it's been a joy to use. (I gave up trying to do any *real* work in Cygwin on Win7, but that's another story.)

The ability to configure the VMware NAT settings, for example, to forward port 80 traffic to the VM, I had thought to be a feature reserved for the paid-for Workstation version. Port forwarding is useful, for example, if you are running a web server or web app in your VM and you want to see it break in Internet Explorer in the host OS.

However, this is not the case — the configuration tool is included in Player but not installed by default.

I found this tip by "todster" after Googling around for a bit:
http://www.plctalk.net/qanda/showthread.php?t=65786

Here is his solution:
For those that use the player or won't because of the network config or actually lack of, Vmnetcfg is actually included in the vmplayer installer only it isn't installed. 
To extract vmnetcfg.exe from the installer do the following: 
1. Run the installer with /e option. For example: VMware-player-3.0.0-197124.exe /e .\extract Contents will be extracted to “extract” folder. 
2. Open “network.cab” and copy vmnetcfg.exe to your installation folder,typically C:\Program Files\VMware\VMware Player\
After you do this, you can run vmnetcfg and set your port forwarding rules to forward traffic into your VM.

Happy port forwarding!

UPDATE: This trick doesn't seem to work on VMware Player 5. Oh well.