How to set up a wi-fi hotspot with an Ubuntu laptop (access point mode)?

You need to create infrastructure (Access Point mode) wireless hot-spot rather Ad-hoc hot-spot. In linux(ubuntu) i used ap-hotspot and which works for me(i got connected WP8 and Android 4.4, dont know about iPhones).

For installation

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot

Update for 14.04

The hostapd version in Ubuntu 14.04 is buggy and doesn't work properly. To get AP-Hotspot to work with hostapd in Ubuntu 14.04, you need to downgrade hostapd and use apt to hold the package so it's not upgraded.

To do this, use the following commands:
For 32 Bit:

cd /tmp
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

For 64 Bit

cd /tmp
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

Configuration

sudo ap-hotspot configure

Configure_Sample

It will asks for interfaces, Access point name(which can be anything you want to see as wifi_hotspot name), password(which is your wifi_hotspot security key).

Now, if you able to configure successfully and dont get any kind of Unsupported wifi errors(if you get that simply means, your wifi_card doesnt support infrastrucutre Access point wifi_hotspot, so can do nothing on it), then procceed.

So just now start your hotspot as

sudo ap-hotspot start

If you want to stop then

sudo ap-hotspot stop

If you wanna see all available commands

sudo ap-hotspot

You don't see this hot-spot running in any indicator or something, i am still finding it how to determine status checking of it.

I am using is from last few weeks, and no bugs(no side-effects too) yet. I am using Gnome-Ubuntu 13.10 amd64 sharing eth0 to my WP8.

SOURCE : http://www.unixmen.com/create-infrastructure-wifi-access-point-connect-android-devices/ SOURCE : http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html


I have 2 wi-fi adapters installed for this. One native internal, and other via USB. I have to share with external USB because the internal one I am using to receive my conection. In your case you don't need another adapter, as you receive the conection via cable. Just follow my steps.
This is how I do. In System Settings...>Networks select the Wi-Fi adapter you want to uuse as a Hotspon, and click Use as Hotspot... button.

enter image description here

This will shortly activate the adapter to serve as a Hotspot. At the same window you have Options... function, and you can stop it in a same easy way.

enter image description here


Since ap-hotspot is deprecated, it's neither reliable or stable for newer Ubuntu distribution. The author of ap-hotspot recommended create_ap.

Installation

git clone https://github.com/oblique/create_ap
cd create_ap
make install

Usage

No passphrase (open network):

create_ap wlan0 eth0 MyAccessPoint

WPA + WPA2 passphrase:

create_ap wlan0 eth0 MyAccessPoint MyPassPhrase

Change wlan0 and eth0 to the interface on your machine. (ifconfig)