How to connect Ubuntu guest (in VM) to my Wi-Fi router?

I am running Ubuntu Server 12.04 LTS 64 bit in Virtual Box. There are two network adapters attached with it. eth0 (primary) is using NAT & eth1 is using bridge.

I am able to connect to internet using eth0 thanks to NAT. Now, I want to access website hosted in it from host OS (Windows 7 Home Premium 64 bit). I don’t know how to do it with NAT. So, I was trying to do it with eth1.

This is what I am thinking: eth1 has access to physics WiFi adapter. After connecting to WiFi router, I’ll get internal IP of VM using which I can access the website. Correct me if I am wrong.

Now, my problem: There’s no wlan0 type interface listed when I run ifconfig -a. And, iwconfig isn’t working on eth1. Please, help.

Step by Step guide is encouraged as I don’t know even where to enter wifi password & SSID.

Answer

In the NAT mode of VirtualBox, in order to access your guest OS from the host OS, you have to specifically enable port-forwarding by issuing specific commands like these:

VBoxManage modifyvm “VM name” –natpf1 “guestssh,tcp,,2222,,22”

See this VirtualBox manual link for more details https://www.virtualbox.org/manual/ch06.html#natforward

Attribution
Source : Link , Question Author : Community , Answer Author : Prahlad Yeri

Leave a Comment