Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Installing Drivers for Wireless USB Adapter, Need Help Please!


    Hi! This is my first post.

    I'm fairly new to the world of linux. I'm running linux on vmware fusion as a virtual machine. I recently purchased a wireless USB adapter for my computer, and I noticed linux would not recognise the USB device. So I've downloaded the necessary drivers for my USB adapter, but I'm having some trouble installing them.

    In the file there is a 'README' which includes instructions, but I have found the instructions to be beyond my level of understanding. Here is what they include:

    ================================================== =====================
    Build Instructions:
    ====================

    1> $tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
    go to "./DPB_RT2870_Linux_STA_x.x.x.x" directory.

    2> In Makefile
    set the "MODE = STA" in Makefile and chose the TARGET to Linux by set "TARGET = LINUX"
    define the linux kernel source include file path LINUX_SRC
    modify to meet your need.

    3> In os/linux/config.mk
    define the GCC and LD of the target machine
    define the compiler flags CFLAGS
    modify to meet your need.
    ** Build for being controlled by NetworkManager or wpa_supplicant wext functions
    Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
    => #>cd wpa_supplicant-x.x
    => #>./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
    ** Build for being controlled by WpaSupplicant with Ralink Driver
    Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
    => #>cd wpa_supplicant-0.5.7
    => #>./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d

    4> $make
    # compile driver source code
    # To fix "error: too few arguments to function °•iwe_stream_add_event"
    => $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c

    5> $cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat

    6> load driver, go to "os/linux/" directory.
    #[kernel 2.4]
    # $/sbin/insmod rt2870sta.o
    # $/sbin/ifconfig ra0 inet YOUR_IP up

    #[kernel 2.6]
    # $/sbin/insmod rt2870sta.ko
    # $/sbin/ifconfig ra0 inet YOUR_IP up

    7> unload driver
    $/sbin/ifconfig ra0 down
    $/sbin/rmmod rt2870sta

    ================================================== =====================
    CONFIGURATION:
    ====================
    RT2870 driver can be configured via following interfaces,
    i.e. (i)"iwconfig" command, (ii)"iwpriv" command, (iii) configuration file

    i) iwconfig comes with kernel.
    ii) iwpriv usage, please refer to file "iwpriv_usage.txt" for details.
    iii)modify configuration file "RT2870STA.dat" in /etc/Wireless/RT2870STA/RT2870STA.dat.

    Configuration File : RT2870STA.dat
    ---------------------------------------
    # Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat
    # This file is a binary file and will be read on loading rt.o module.
    #
    # Use "vi RT2870STA.dat" to modify settings according to your need.
    #
    # 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwise using Infrastructure
    # 2.) set Channel to "0" for auto-select on Infrastructure mode
    # 3.) set SSID for connecting to your Accss-point.
    # 4.) AuthMode can be "WEPAUTO", "OPEN", "SHARED", "WPAPSK", "WPA2PSK", "WPANONE"
    # 5.) EncrypType can be "NONE", "WEP", "TKIP", "AES"
    # for more information refer to the Readme file.


    Now could someone with more knowledge please simplify these instructions and offer me some guidance? I'd greatly appreciate it. Thank you!

  2. #2
    Linux Enthusiast sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    739
    I'll try, hoping not to be too detailed or too obtuse.

    1. The $ symbol is the standard Linux command-line prompt. When you see a line like this, you type the part after the $ in the terminal. In this case you would type
    Code:
    tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
    in your terminal, replacing the x.x.x.x with the numbers in the filename you downloaded. This will extract the files from the tar archive into a subdirectory. You then use the cd command to cd to that subdirectory. There you should find, among many other files, one named Makefile. You need to open that file in a text editor. The ones available depend on the desktop environment you have installed, and I have no idea which you chose. Common editors include gedit, mousepad, kedit, and others, usually one per desktop environment. Gedit comes with gnome, kedit comes with KDE, and mousepad comes with Xfce. There are others in other desktop environments. Nano is a simple terminal editor, and is usually installed by default in most environments. If you can't find and use a text editor, you have no hope of success anyway.

    The rest of the instructions are for editing other text files which should be in the same directory. When you get to 4, you just type make and press Enter. That compiles the text files into a binary file. The rest of the instructions give specific commands to type in the terminal. I may not be able to get back to this right away, but I'll try. Life may intrude, though. If you have specific questions and I don't answer right away, someone else will probably be by to help.

  3. #3
    Hi! Thanks for your response and help!

    I'm still having problems however. I have extracted the files, managed to use the cd command to get into the subdirectory and have started making my way through the instructions.

    Where I get stuck is editing the Makefile. I'm unsure what to do when it says:
    'define the linux kernel source include file path LINUX_SRC
    modify to meet your need.'

    Also, I tried bypassing these steps and ran the 'make' command. What I was returned with was this:
    Code:
    make -C tools
    make[1]: Entering directory `/root/Desktop/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/root/Desktop/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
    /root/Desktop/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools/bin2h
    cp -f os/linux/Makefile.6 /root/Desktop/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/Makefile
    make -C /lib/modules/3.18.0-kali1-amd64/build SUBDIRS=/root/Desktop/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux modules
    make: *** /lib/modules/3.18.0-kali1-amd64/build: No such file or directory.  Stop.
    make: *** [LINUX] Error 2
    What does this mean?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    739
    LINUX_SRC should be defined as the source to the directory where the kernel source code is, I assume. You should know that Linux doesn't use separate drivers like Windows does, they're compiled into the kernel. It appears that you need to do a custom compile of the Linux kernel to get this driver to work, and it's probably not worth the trouble. Compiling the kernel is not something for novices to be doing. If you do decide to do it, you need the source code for the kernel you're using, and need to do a lot more study before starting. Good luck with it.

  6. #5
    A few things come to mind...

    they're compiled into the kernel. It appears that you need to do a custom compile of the Linux kernel to get this driver to work
    1) This 'driver' is a kernel module - it's compiled code that works in conjunction with the kernel. It is not 'compiled into the kernel' nor does it require 'a custom compile of the kernel.' The only thing compiled is the driver/module itself.

    2) You mentioned Fusion and that this is a virtual machine (VM.) A VM sees only the hardware presented to it by the virtualization software. In 99.99% of cases, a VM would not see any wireless/USB device - it would simply see a standard ethernet NIC. Did you look at lspci to see what PCI devices are listed? This ethernet NIC can be NAT'ed thru the host's networking or bridged to the same network as the host.

    3) If there is a particular reason you've passed this USB device into the VM and want to continue wifi config, this thread is the place to start.

  7. #6
    Quote Originally Posted by HROAdmin26 View Post
    2) You mentioned Fusion and that this is a virtual machine (VM.) A VM sees only the hardware presented to it by the virtualization software. In 99.99% of cases, a VM would not see any wireless/USB device - it would simply see a standard ethernet NIC. Did you look at lspci to see what PCI devices are listed? This ethernet NIC can be NAT'ed thru the host's networking or bridged to the same network as the host.
    I'm beginning to think that this is the problem. I am using VMware fusion and running it on a virtual machine, and you're right, it does not recognise the USB device.

    How do I get linux to recognise the device?

  8. #7
    How do I get linux to recognise the device?
    It doesn't need to. The VM sees a virtual network provided by Fusion. It likely has an ethernet NIC in the VM. You can use lspci to list PCI devices in the VM.

    A VM sees only the hardware presented to it by the virtualization software. In 99.99% of cases, a VM would not see any wireless/USB device - it would simply see a standard ethernet NIC. Did you look at lspci to see what PCI devices are listed? This ethernet NIC can be NAT'ed thru the host's networking or bridged to the same network as the host.
    VMware Fusion Documentation - Configuring the Network

  9. #8
    -->
    Great news! I've managed to fix it and get it all up and running. Turns out it was a very simple issue with a driver for the adapter that was installed on my host OS, but as soon as I uninstalled it the device works perfectly with VMware and the virtual machine! Thanks for all the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •