Thursday, December 23, 2021

wifi Tethering to VM on virtualbox

 The usual and most common method to pass internet to the VM from host network is to keep the adapter of VM in bridged mode and the internet connection of the host is shared to the VM whether VM is linux or windows

However, though this works without problem if the host internet connection is through wired medium(Ethernet). When host gets the connection through wifi, this method of bridge does not work. 

Soultion:

The solution is rather simple, in the guest VM settings in virtualbox manager, go to network and in Advanced settings, copy the mac address of the host wifi adapter(which you can get by going to network connections, and rt clicking the wifi adapter and then clicking status and noting down the MAC address) and paste it in the MAC address box replacing whatever was existing in the box.

This can be done only when the VM is offline. once done, check using ip address or ipconfig command in guest VM  and you would find that that the eth1 adapter in VM has already been allotted an ip address in same series as wifi adapter of host OS. ping google dns 8.8.8.8 and it should ping. open browser and check if it is opening google, if not, then just add DNS entry in VM which would be same  as gateway of WiFi dongle/router.

No comments: