Life Imitates LOLCATS

Posted on December 11th, 2007 in General by minter

This famous LOLCAT:

Inspired this sign at Chapel Hill Comics:

Our Pokemons...

LOLCATS cannot be stopped.

There’s No Place Like lo0

Posted on December 11th, 2007 in Technology by minter

As Rob posted, I came up with an interesting solution to a problem yesterday, and I hadn’t seen it written up anywhere.

The problem was: You have a user on a Mac OS X system, running Windows on VMWare Fusion. They have application code running on the Mac side, and want to do browser testing via the Windows instance on VMWare.

Now if the Mac is online and has an IP address, you can just use that IP in the browser bar in Windows, and it will work. But what happens if you want a consistent URL between work, home, the coffee shop, and other places where your IP might switch? You could write a script that would inform your VMWare instance of your live IP, but that’s kludgy. What happens if you’re on a plane and don’t have any live networking? Then what.

You want an interface that’s always up, and that can have a static IP. That rules out the ethernet port (cable out, no networking, DHCP issues), or AirPort.

But wait! There IS an interface that’s always online. And it’s lo0, the localhost adapter. Sure, it doesn’t really go anywhere, but for inter-VM networking, you don’t care about that. And while it normally only hosts 127.0.0.1, the loopback address, it’s a “real” interface, so you can take advantage of IP aliasing.

Run as root:

ifconfig lo0 inet **10.0.0.100** netmask **255.255.255.0** alias

That will bind the IP 10.0.0.100 to your localhost adapter. You can adjust the IP address and netmask to taste – just make sure it’s a nonroutable IP, and hopefully one you won’t get assigned by your NAT device. Once that IP is up on the lo0 interface, you will be able to access it from VMWare. And it won’t change with the winds of DHCP, or even a lack of internetworking at all, giving you something consistent that you can refer to.

If you want to have that persist across reboots, edit the file /etc/rc.local as root and add that ifconfig line to it. rc.local is run by the system at the end of the boot process, so that will take care of it.

Hope this is useful!