I am using VirtualBox to run Ubuntu on an OSX machine. The problem is that I can't get any wireless extensions when running iwconfig. How can I manage to connect Ubuntu to my wifi card?

  • @LuisAlvarado waiting for your guide to understand more in depth these things ! – user1611830 Apr 16 '13 at 12:59

VirtualBox does not natively offer Wireless support (Like a virtualized Wireless device). Instead, it connects directly to the Wireless device the Host uses. In this guide I will point to the steps needed to have a working Wireless card for you Guest. Before we begin you need to make sure you have done the following points:

  • Installed the Extension Pack for that particular VirtualBox Version. You can find the extension pack in the Download section of VirtualBox. To install it, open VirtualBox, go to the menu and select File --> Preferences. Now select Extensions and select the Add Pack button at the far right. Look for the downloaded Extension pack and add it to VirtualBox.

  • You have added your user to the vboxusers group. The quickest way is to go to the terminal and type:

    sudo usermod -a -G vboxusers cyrex

    where cyrex is my username. In this case, you would change cyrex for yours. Note that if the vboxusers group is not found it is because VirtualBox is not yet installed on your system.

Now to proceed with the steps. This is what is called a passthrough method:

  1. Right click on the Virtual Environment you wish to edit and select **Settings*:

    enter image description here

  2. Go to the Network section and select an Adapter. In this case I selected Adapter 1 although it is recommended to select a second Adapter, this way, you can use the wireless connection to your Host and still be able to connect to your internal Virtualized network (Connect to other virtualbox guests internally). For the example mentioned here I connected directly using the first adapter.

    Click on the Attached To option and select Bridged Adapter. This will open an option that will show your Host network interfaces. If your host iw Linux it will show something like wlan0, wlan, eth2... If your Host is a Mac, it will show AirPort. In the image you can see wlan0 for this case:

    enter image description here

    Now simply accept and run your virtualized environment. You should connect and see it similar to this:

    enter image description here

I should mention the following:

On Mac and Linux hosts, functionality is limited when using AirPort (the Mac's wireless networking) or any Wireless Linux device to bridged networking. Currently, VirtualBox supports only IPv4 over Mac's AirPort or Linux Wireless devices. For protocols such as IPv6 and IPX, you must choose a wired interface.

Some adapters strip VLAN tags in hardware. This does not allow to use VLAN trunking between VM and the external network with pre-2.6.27 Linux kernels nor with host operating systems other than Linux.

I should also mention that in the following extended options:

enter image description here

You can select how you wish to interpret the Host's wireless device. If you wish to see it as a Intel network device, a PcNet device or a Paravirtualized Network device. Note that Promiscuous mode is used more often for sniffing and can create a bit of network lag on both, the Guest and Host when using it.

Note that if you disconnect in the Guest OS, you are only disconnecting the Guest to Host virtualized connection. You are not disconnecting or turning off your Host's Wireless device. For more information regarding VirtualBox and networking see this guide.

Using the method above, with a PCI Wireless device on the host or a USB Wireless device is the same. The VirtualBox Network settings will detect the device the same way. I am testing this right now with the Edimax EW-7811Un. It was detected as wlan1 and Virtualbox (On the Network settings) detected the device as such. Remember that one thing is how the "outside" of the virtual environment works and then another how it works inside. Inside it was shown as a "Wired" device and I have internet through it.

Now, if you want to access a USB device do the following (Note that you need the Extension Pack for this):

  1. Once the virtual OS has started select the device from the USB option on the bottom:

    enter image description here

  2. It will appear on the Desktop after a couple of seconds:

    enter image description here

  3. If you want the USB device to be present from the beginning, then go to the USB Settings option and select the Enable USB 2.0 Controller then add the device you wish to have activated with the Add Filter From Device option at the right (The one with the Green Plus sign).

    enter image description here

Now I want to add that the difference between the VirtualBox Extension Pack and the Guest Addition is that, apart from the USB support and Remote Display options that the Extension Pack brings the Guest Addition provides the following:

  • Better Mouse Integration
  • Better 3D Support
  • Copy/Paste Support between Host and Guest
  • Folder Sharing between Host and Guest

So if you need any of this features, you need to also install the Guest Addition. If you only need access to a USB Device or network options, with the Extension alone you will have that.

Note that VirtualBox does NOT provide a virtualized Wireless device inside the guest. They will all look like a wired one, even if the host is providing the connection via a Wired or Wireless card. Something like this:

enter image description here

  • Thank you for this very complete response but unfortunately. I added the extension package but when I run iwconfig, I still have no wireless extensions... – user1611830 Apr 17 '13 at 13:24
  • 1
    You will not have any wireless connection INSIDE the guest environment. They will all look like a wired one because VirtualBox right now has no way of creating a wireless virtual device. It only creates a wired one. – Luis Alvarado Apr 17 '13 at 14:14
  • Outstanding answer :) – user115639 Oct 18 '15 at 4:36
  • This is related although a slightly different issue superuser.com/questions/990021/… – William Nov 3 '15 at 20:33
  • If I am correct, If I use a USB wifi adapter, it will work natively in VBox since it supports capturing USB devices? – VarunAgw Dec 10 '15 at 10:20

If you want to use the connection as wifi in the guest, you need to use the passthrough method as said in the comments but if you only want to connect your guest, you don't need to do that.

Assuming your wifi connection works on the host system, you can simply in virtualbox manager on the host go to network configuration of your guest. On adaptor 1 tab, select bridge mode and on Name field, you select the wifi connection on your host. The connection will appear as wired connection eth0 on your guest and will work as if it were a wired connection. The wifi part will be managed by the host OS.

Not the answer you're looking for? Browse other questions tagged or ask your own question.