scan and connect to wifi from linux terminal on virtual machine - linux

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 . .

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.

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 :-)

Related

How to access a raspberry pi localhost from a linux?

I set up a php file in my raspberry pi so that I can access some files on it from my local network.
Within raspbian, it works well in any browser using localhost/test. I tested it also in a Windows and a Mac computer in the same network, using my.local.ip.address/test in my browsers and it also worked fine.
Now here is the problem: in my linux computer, it does not work. It simply says that "the site cannot be reached". I already tried disabling the firewall (UFW) but it doesn't change anything.
I also tried several browsers in linux and the result is the same.
I think I am overseeing something obvious but I cannot see it.
Could someone give me a pointer on what might be wrong?
ifconfig -a output (Linux machine)
ifconfig -a output (Raspberry Pi machine)
It's possible that your Ubuntu machine is not in the same network. You can try theses steps to confirm :
Ping
Go on your ubuntu machine and type :
ping <rasp.pi.local.ip.address>
Go on your Raspberry Pi and type :
ping <ubuntu.local.ip.address>
If the ping request do not succeed your machines are probably in different networks. Your can use this command to watch the path used by packets between your ubuntu machine and your Raspberry Pi :
traceroute <rasp.pi.local.ip.address>
Change network card settings
Before this step, check if your are able to connect your machines togather (switch, router, vlan...).
ifconfig <interface> down
ifconfig <interface> <ip.network> netmask <netmask.network>
ifconfig <interface> up
After completing theses steps try to ping again and access to your website.

How can I use multicast in a Win7 VM on Linux?

I'm using Ubuntu 14.04 LTS on my laptop to host a Windows 7 VirtualBox instance. What I want to do is connect the laptop to a network (either wired or wireless) then run an app in the Windows VM that connects to an IPv4 multicast. The app is written in Qt 4.8.2 and I'm running it in QtCreator. When I run the app it fails to join the multicast group:
QUdpSocket *udpSocket = new QUdpSocket(this);
bResult = udpSocket->bind(port, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint);
bResult = udpSocket->joinMulticastGroup(address);
If I step into joinMulticastGroup() I can see setsockopt() returns -1. This code works fine in native Windows. I've tried attaching the VM network to NAT or a Bridged Network to eth0 (with Promiscuous Mode set to Allow All) but neither works.
Does VirtualBox just not allow this or is there some setting somewhere I need to adjust, either in the VM or on the Linux host?
Note: I can't run the Qt app in Linux because it depends on third-party libraries that are only built for Windows.
Try setting Promiscious Mode to "Allow All" on the VMs network adapter in Virtualbox.
In the end I fixed it accidentally by following up on a USB problem I was having - thanks to Ramon Suarez for his answer to VirtualBox doesn't recognize USB.

Network settings

how can change my pc settings in linux so that my network cannot recognise my previous mac address and thinks that is a new pc that connects to network via wifi. I ask this because something went wrong and cannot connect because my pc is blocked from this network
To change your MAC address on Linux (or OSX), use the command ifconfig :
ifconfig [interface name] hw ether [new MAC address]
Example:
ifconfig eth0 hw ether 01:02:03:04:05:06

Cannot access ubuntu server from other machines other than the machine which is hosting the virtual machine which is my ubuntu server

I created a ubuntu server on vmware. I am using it as a file server. I can access it if I am connecting through the machine which hosts the virtual machine. I am not able to do it from other machines which are on the same network. Thanks in advance!
First of all make sure in the setting of the virtual machine that it is in Bridged Adaptor type connectivity.
Give a static ip to the virtual machine using
sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
the above is an example. You got what I mean.
3.Third, Try pinging the virtual machine with the base machine running the vbox to make sure they are connected.
ping ipaddress-basemachine
4 . Now if everything is working fine from there then connect with this virtual machine with other base machine using Remote Desktop Viewer or any other similar application.
Specify, the ip-address of the vbox and username, password. It will be able to connect with it now.
5 . If it still is not able to then try to check the firewall rules on both the virtual box machine and the base machine running the vbox using the command
iptables -L

Configuring ethernet or wifi inernet on centos

How do i configure ethernet or wifi on laptop, i followed this tutorial and my ethernet started properly and still i couldn't receive any packet from ping 8.8.8.8 dns, i have ethernet and wifi on my laptop... same setting on virtual machine works perfectl but on real os it wouldn't work... if i ping
ping 127.0.0.1
or
ping localhost
what could be the problem???
It could be that your interface is down.
ifconfig eth0 up
Eth0 is an interface name to get the list of your visible interface type in "ifconfig"
also you should provide us with the list of interface and possibly also hardware
dmesg
will display the full list of device on your laptop.
Also to be noted some of these command requires root / sudoer.
Wifi : http://wiki.centos.org/HowTos/Laptops/Wireless

Resources