Archive for ubuntu

Setting up VirtualBox Guest VM Server Networking via NAT

I recently took Atlassian up on their Starter Pak deal to help manage some personal projects I’m hoping to kick off. I’m a big fan of their work, and their entire suite has performed extremely well for us at work for the last 3 years.

While I could run the software directly off of my iMac, my preference (and the environment I’m ultimately most comfortable in) is to run them under Linux. To accomplish this, I downloaded the latest version of Xubuntu and installed it within VirtualBox for OS X. Being the lazy man that I am, I did a plain-vanilla VirtualBox install.

After a quick apt-get to install OpenSSHd (and trying to connect via the host OS back to the guest), I realized that the default network settings would not allow me to see back into the guest OS (Xubuntu) from the host (OS X) (The other way around works fine, btw).

The VirtualBox documentation presents a few different ways to resolve this (NAT, Bridged and Host-Only). Once again, I decided to take the path of least resistance…which is to do simple port-forwarding from the host OS to the guest OS. The result is that when a resource is requested on host OS port, it just forwards the request to the mapped guest OS port.

I have 3 primary services that I’m looking to forward: SSHd (22), Apache (80) and Tomcat (8080)….so my mappings look like this:

Host OS Port 2222 –> Guest OS Port 22 (SSHd)
Host OS Port 10080 –> Guest OS Port 80 (Apache)
Host OS Port 18080 00> Guest OS Port 8080 (Tomcat)

When VirtualBox is installed, it places a few command line utilities on the host OS. The command that is needed to setup port-forwarding is VBoxManage. There are 3 values that must be set for port-forwarding to work: Protocol, HostPort and GuestPort. Below are the commands I executed to setup SSH port-forwarding:

VBoxManage setextradata "Xubuntu"
  "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP

VBoxManage setextradata "Xubuntu"
  "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22

VBoxManage setextradata "Xubuntu"
  "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222

The value “guestssh” is somewhat arbitrary…it just needs to be the same for all 3 values. The other difference you might have is if you have chosen a different virtual network adapter (pcnet) when you setup your VM. When in doubt, check the VirtualBox documentation.

That’s basically it…just rinse and repeat for any other services that you want to run on the guest OS and have visible from the host.


OSCON 2008 – Day 1

Technically, it’s day 2…but it’s day 1-ish for me.

I got into Portland around 2PM local time.  Checked-in to the hotel, then ran over to the convention center to check-in for the conference.  Probably the worst conference bag I’ve ever got.  That said, I think I have 5 computer backpacks lying around by now…so I’m definitely on overload.  Tech conferences need to move on to something else.

Not being familiar with the area and having not eaten in about 10 hrs, I went the path of least resistance and stopped by the mexican restuarant in the hotel (come to find out later it’s named “Eduardo’s Cantina”…if I’d known that, I probably would have just moved along).  I ended up chatting for a good long while with Josh Marinacci from the JavaFX team at Sun…which was cool because we’ve been working with JavaFX for well over a year now at work (I don’t think many people can say that…and even less could say they have an app in production using JavaFX).

Later in the night, they had an “Extravaganza” back over at the convention center.  There where 3 main parts (that I stayed for):

Mark Shuttleworth: Founder of the Ubuntu project, as well as the commercial company supporting Ubuntu, Canonical.

He spoke about the economics of open source, software development methodologies (specifically Agile/Scrum/XP) and building software that encourages others to extend.  I’m sure my synopsis doesn’t do it justice, but overall a good talk.

Next, O’Reilly/Google gave out some Open Source awards.  I’m sure you can check out their site for the low-down

Finally (for me), Robert Lefkowitz gave a talk about software development methodologies.  The theme of Agile/XP came up yet again.  It definitely feels like (at least from attending conventions) that we’re at a tipping point on Agile methodoligy acceptance.  One thought I hadn’t had until tonite is that this is closely tied to the rise of open source.  In most open source projects, there aren’t a lot of requirements made up front..people either use (and by extension, like) what you’ve built, or they don’t and go elsewhere.  If they do like your product, instead of creating “requirements” for new features, they just submit bug reports…which get triaged appropriately.  Sounds pretty efficient.

Quick Ubuntu Server Setup

I’m amazed at how easy it is to get a server up and running these days. From a fresh HD (or VM image if that’s your thing) to a fully functional LAMP+ server in just under an hour (depending on the size of your pipe).

Here’s a good HOWTO.