Create AD-HOC in debian on virtualbox when host internet sharing is disabled

For some reason my Windows Internet Sharing is disabled by system administrator, yet I still want to use ad-hoc for my mobile devices. So I decided to use virutalbox + linux to create a wireless ad-hoc server.

I chosed debian net installation disk because it is small & clean, I dont need any GUI evironment so I choosed a minimum installation with ssh server, added a port forward on port 22 in virtualbox so I can putty to 22 to access the virtual machine.

You need to install your wireless card driver on linux, this progress is pain, you can either download the linux driver from official website or check if it is ndiswrapper supported from

You will need to add the default module into the /etc/modprobe.d/blacklist.conf & loaded the module to /etc/modules after installation. I received a RTL8188CUS wireless card, it is tiny & luckly the official website provides the download of the driver for linux.

you prbably need to install build-essential & some packages first.

apt-get install build-essential apt-get install dnsmasq wireless-tools

Edit /etc/sysctl.conf
unmment the line


Edit your /etc/network/interfaces

auto wlan0 iface wlan0 inet static address netmask wireless-essid test_essid wireless-mode ad-hoc wireless-key 1234567890 #this is a WEP password, for WPA please check here wireless-channel 11

Edit /etc/dnsmasq.conf


echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE /etc/init.d/networking restart service dnsmasq restart

Now try to connect the device to the ad-hoc, wireless on the fly