Ubuntu – Ubuntu Server – How to connect to wireless WPA2 personal network

ralinkserverwirelesswpa2

Connecting to the wireless is relatively simple.

After some struggle, you have wifi in your installer. You can install Ubuntu Server and everything is alright. You are ready to boot your new system.

After setup finished, wifi settings disappeared.

tl;dr: How do I connect to a wireless (WPA2 Personal) network from Ubuntu Server 12.10?

What I have tried so far:

Connected with iw* commands. Obtained IP address with dhclient. Put these commands to etc/rc.local.

On boot, the server waits 120 seconds with message "Waiting for network to come up"

To fix this, I removed everything /etc/network/interfaces (wpa-psk and wpa-ssid).
This did not work. It was still waiting. I found an answer, which said I could just remove the /etc/… (the file that was in charge of the 120 second wait time.)

I did that, and kept a backup of it. Now the server waits ~3 seconds (modified sleep within the file) and boots up. However, there's no network connection available. It's some dhcp error.

As I was out of options, I tried using the one in comment. The one that used "tee".
Turns out it does not work either.

How can this whole thing be so inconsistent? How can they not install the firmwares on the ISO while it would perfectly fit (673+~10MB = 683). How can the installer NOT copy the necessary files and set up the connection to be used later? (Or ask if the user wants to use it.)

Best Answer

1) Install the package wpasupplicant.

2) Then write:

sudo su
wpa_passphrase [SSID] >> /etc/wpa_supplicant.conf
exit

Where [SSID] is SSID of point where you want to connect. After entering this command, you have to write password for that acces point.

3) Run wpa_suplicant with new config file.

sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf

Make sure that your interface is wlan0, or change it if needed!

-B is for background running.

-D is used driver.

-i is interface.

4) You should be connected now :)