Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am using a 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 that to connect directly my ubuntu to an wifi card ?

share|improve this question
    
@LuisAlvarado waiting for your guide to understand more in depth these things ! –  user1611830 Apr 16 '13 at 12:59
add comment

marked as duplicate by Luis Alvarado Jun 8 '13 at 6:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 10 down vote accepted

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

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

share|improve this answer
    
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
    
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
add comment

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.

share|improve this answer
add comment

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