-1

I am trying to scan wifi networks via Linux terminal running on a virtual machine. I am running virtual machine on Mac OS. On MAC terminal, I can see all WIFI networks using (airport) command and can connect to one network.

The NetworkAdapter setting for Vistual machine is set to "Share with MAC".

On Linux terminal, When I do ifconfig -a, I get

eth0 & lo

However, when I type : sudo iwlist eht0 scan , I get error message:

sudo iwlist eht0 scan

Can someone help that how I can do that with Linux running on virtual machine ? ? What I am doing wrong . .

user3358147
  • 69
  • 5
  • 12
  • 2
    This doesn't appear to be a programming question. Try asking on [unix.se] –  Jun 13 '14 at 02:19

2 Answers2

1

On every VM I've ever seen, the virtual machine emulates the WiFi interface of the host OS (Mac) as an ordinary wired interface to the guest OS (Linux). Therefore you can't scan for WiFi networks from the Linux, because as far as it's concerned, it's not a WiFi interface.

The exception to this would be if you attached a USB WiFi adapter and had the guest OS natively recognize it as a USB device (meaning it would be ignored by the host OS). Note this may not work on some virtual machines; VirtualBox is particuarly bad at recongizing network adapters.

Ivan X
  • 2,165
  • 16
  • 25
  • Yes I am planning to sue Dongle to connect to my laptop and use it to scan wifi networks. I am newbie to Linux. I have few questions. So once I connect Dongle to my laptop, then I need to scan devices on linux terminal via iwlist ? ? Then use that USB device to scane wifi networks . . It will be really nice if u can tell me some steps to follow. Thanks – user3358147 Jun 14 '14 at 09:51
  • Insert dongle (hopefully one that already has a Linux driver). Make sure virtual machine has captured dongle as a native USB device. Then use iwlist as you described. In order to set up the dongle to work with a particular network, you might want to check out [this page](http://ivanx.com/raspberrypi/raspberrypi_wifi.html) that I wrote about that. – Ivan X Jun 14 '14 at 11:12
0

well if you:

nmcli dev wifi

it will show you all the wireless access points (ESSID) available then you can

nmcli dev wifi connect $ESSID password $PASSWORD

example

nmcli dev wifi connect "School Hotspot" password "q5w4e3r2t1y0"

That kinda thang :-)

Sunday Ikpe
  • 924
  • 10
  • 17