Ubuntu Terminal connecting to wireless internet DHCP

Dec 13 2011 4:56 PM DEC 13 2011 4:56 PM
Connecting to your Wireless Router with TerminalUbuntu

Recently I was given a VDI, that is a Ubuntu Server. This runs a web app for a company that I work with. We use these VM's for development, integration testing, and testing. When I installed the VDI I found that it was not connecting to my local network by just using the regular settings. After roughly two tutorials I found a mix of the two to be my resolution.

1) Go into your network settings of the VM. 

  • Pick an adapter and select "Attached to: Bridged Adapter"
  • Select wlan0
  • Advanced -> Promiscuous Mode: "Allow All"

2) Start up the VM lookup what devices are visible.

ifconfig -a | grep eth

This should list out the connections. Even though your wireless internet is a wlan0 the VM may see it as a eth0, eth1, eth2, etc...

3) Next we need to manually change your network configuration file.

vi /etc/network/interfaces

You will want to add this:

auto eth0 
iface eth0 inet dhcp

Now make sure the eth0 fits the one you discovered. Mine happened to be eth2 and not eth0.

4) Next step we need to restart the networking to make this take into affect.

/etc/init.d/networking restart

You should get a long list of things that should connect up to your router. My router happens to be in the 10.0.1.1 so when the list went through I was easily able to find it and know it connects. That and the IP address range my local network  fits into gave the VM an IP Address in that range.

If this doesn't work you can follow the tutorial below also as it also contains methods for static IP's. I was able to achieve this after going through these two tutorials on ubuntu's website.

Resources