0

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 Wi-Fi networks using (airport) command and can connect to one network.

The NetworkAdapter setting for Virtual 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 eth0 scan , I get error message:

sudo iwlist eth0 scan
eth0      Interface doesn't support scanning.

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

1
  • What error message? I believe you wanted to mention the error message but mentioned the command again. :) Commented Jun 13, 2014 at 2:24

2 Answers 2

1

What you're doing wrong is to assume that whatever software you're using to run the virtual machine will pass the WiFi extension through to your VM.

If you ran

lspci 

in the terminal of your VM you'd most likely find that it sees an Intel, Realtek or AMD wired adapter.

7
  • I am newbie to linux. yes i got a VMware SVGA II Adapter answer. How should I resolve this issue plz Commented Jun 13, 2014 at 2:33
  • 1
    There's nothing to be resolved. Short of finding a virtualisation platform that passes the physical hardware through to your VM there's no way you will be able to use the wifi adapter of the host as such from within a VM. In short it can't be done. Commented Jun 13, 2014 at 2:48
  • what is the best way then ? As I will run a C program from my virtual machine to scan and connect a specific wifi network? Commented Jun 13, 2014 at 3:32
  • Again: this will not work. I don't know how to spell it out more clearly. Make your C program work on the host. The VM doesn't (can't, will never, ... ) see the wifi adapter, so any efforts you put into this - including posting questions about it - are wasted. Commented Jun 13, 2014 at 4:54
  • don't get aggressive. was just asking other way !! that's it Commented Jun 13, 2014 at 5:04
0

Use an Alfa USB long-range adapter. When you plug it in to USB, it will ask who gets control? host or vm? give access to the vm.

voila: "iwlist wlan0 scan | less" will show what you are looking for

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Mar 16, 2022 at 17:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.