Sharing Bluetooth dongle

Discussions about using Linux guests in VirtualBox.
Post Reply
BrainInAJar
Posts: 6
Joined: 4. Jan 2015, 21:50

Sharing Bluetooth dongle

Post by BrainInAJar »

Hello

My setup: Windows 10 host, Ubuntu 18.04 guest. In the Windows host I am using a BlueGiga BLED112 BLE dongle. The dongle is working fine in Windows. I can use BlueGiga's BLE GUI tool to attach to it and see my devices.

I want to be able to use the BLE dongle in my Ubuntu VM.
According to Silicon labs Ubuntu should be able to use BLED112 without any additional drivers (https://www.silabs.com/community/wirele ... drive-Ijo1).
I have shared the USB device with my guest. But, it doesn't seem to like it. Ubuntu's settings utility says no Bluetooth found. I have tried a few commands suggested elsewhere e.g. rkill (list and unblock bluetooth), restarting the bluetooth service etc. But, the bluetooth service status is still "inactive (dead)" and rfkill shows no devices.

Is there something else I need to do? I'm not sure if this is a general Ubuntu/Bluetooth question or a VirtualBox device sharing question.

(for context I am trying to get it working so I can use Python in the guest VM to program a Lego Boost hub. It is working OK in Windows. I want to use my VM to do this as I have lots of other tools etc in the VM).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Sharing Bluetooth dongle

Post by mpack »

USB devices can't be shared, if you meant to say that. They are designed to be plugged into one port on one PC, their design has no concept of serving two masters. Logically, the host and VM are separate PCs.

USB FAQ.
BrainInAJar
Posts: 6
Joined: 4. Jan 2015, 21:50

Re: Sharing Bluetooth dongle

Post by BrainInAJar »

I guess "passthrough" is the appropriate term. i.e. it is the guest that I want to use the dongle, not the host. Done by selecting Devices>USB>Bluegiga low energy dongle.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Sharing Bluetooth dongle

Post by socratis »

BrainInAJar wrote:Done by selecting Devices>USB>Bluegiga low energy dongle.
Does this mean that it worked? As you planned it?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
BrainInAJar
Posts: 6
Joined: 4. Jan 2015, 21:50

Re: Sharing Bluetooth dongle

Post by BrainInAJar »

socratis wrote:Does this mean that it worked? As you planned it?
No. That was just clarifying that I had done the USB passthrough.
The device is ticked, but I haven't yet got it to work with Ubuntu.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Sharing Bluetooth dongle

Post by socratis »

As mpack said, please read the following thread: USB basics and troubleshooting, all of the posts.

If you still have a problem after reading through the whole thing, please follow the advice of the last post, #8: Asking for help and post the information requested.

I'd like you to go with the USB filter option. Note the sequence for grabbing the log. And I want you to see the output of "lsusb" in your guest...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
BrainInAJar
Posts: 6
Joined: 4. Jan 2015, 21:50

Re: Sharing Bluetooth dongle

Post by BrainInAJar »

Output of lsusb in guest:
With dongle plugged in:

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 2458:0001  
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
With dongle unplugged:

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
vboxmanage list usbhost (USB device plugged in):

Code: Select all

Host USB Devices:

UUID:               d47b6610-04d2-4ded-88e7-f6e1c264e8f9
VendorId:           0x8087 (8087)
ProductId:          0x0aaa (0AAA)
Revision:           0.2 (0002)
Port:               14
USB version/speed:  2/High
Manufacturer:       Intel Corp.
Address:            {e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\0000
Current State:      Busy

UUID:               3e49a9ff-81dd-4e6f-acf4-6e158aea17af
VendorId:           0x2458 (2458)
ProductId:          0x0001 (0001)
Revision:           0.1 (0001)
Port:               3
USB version/speed:  2/High
Manufacturer:       Bluegiga
Product:            Low Energy Dongle
SerialNumber:       1
Address:            {4d36e978-e325-11ce-bfc1-08002be10318}\0001
Current State:      Busy

UUID:               c879b8c9-9a73-4a37-a99d-7aa986be3eec
VendorId:           0x138a (138A)
ProductId:          0x00ab (00AB)
Revision:           1.100 (01100)
Port:               8
USB version/speed:  2/High
Manufacturer:       Validity Sensors, Inc.
Address:            {53d29ef7-377c-4d14-864b-eb3a85769359}\0000
Current State:      Busy

UUID:               53c4d3a0-4a32-411a-8e5c-58f6612564b6
VendorId:           0x04f2 (04F2)
ProductId:          0xb63b (B63B)
Revision:           146.97 (14697)
Port:               5
USB version/speed:  2/High
Manufacturer:       Chicony
Product:            HP Wide Vision HD Camera
Address:            {36fc9e60-c465-11cf-8056-444553540000}\0002
Current State:      Busy
vboxmanage list usbfilters:

Code: Select all

Global USB Device Filters:

<none>
vboxmanage showvminfo:

Code: Select all

Name:            BLETest
Groups:          /
Guest OS:        Ubuntu (64-bit)
UUID:            452a573f-268a-4412-bd74-063a8d00562d
Config file:     C:\Users\sky_a\VirtualBox VMs\BLETest\BLETest.vbox
Snapshot folder: C:\Users\sky_a\VirtualBox VMs\BLETest\Snapshots
Log folder:      C:\Users\sky_a\VirtualBox VMs\BLETest\Logs
Hardware UUID:   452a573f-268a-4412-bd74-063a8d00562d
Memory size:     4096MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       on
Triple Fault Reset: off
APIC:            on
X2APIC:          on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
BIOS APIC mode:  APIC
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: KVM
State:           powered off (since 2019-04-02T20:26:15.997000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SATA (0, 0): C:\Users\sky_a\VirtualBox VMs\BLETest\BLETest.vdi (UUID: a519b21e-1d88-4dce-8c96-ac2b7f90462d)
NIC 1:           MAC: 080027C37254, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: DSOUND, Controller: AC97, Codec: AD1980)
Audio playback:  disabled
Audio capture: enabled
Clipboard Mode:  Bidirectional
Drag and drop Mode: disabled
VRDE:            disabled
USB:             enabled
EHCI:            enabled
XHCI:            disabled

USB Device Filters:

Index:            0
Active:           yes
Name:             Bluegiga Low Energy Dongle [0001]
VendorId:         2458
ProductId:        0001
Revision:         0001
Manufacturer:     Bluegiga
Product:          Low Energy Dongle
Remote:           0
Serial Number:    1

Bandwidth groups:  <none>

Shared folders:  <none>

Capturing:          not active
Capture audio:      not active
Capture screens:    0
Capture file:       C:\Users\sky_a\VirtualBox VMs\BLETest\BLETest.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25
Capture options:    ac_enabled=false

Guest:

Configured memory balloon size:      0 MB
vbox.log : attached

No other external USB devices attached to the host.

I think that's everything...
Attachments
BLETest-2019-04-02-21-57-36.zip
(26.11 KiB) Downloaded 24 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Sharing Bluetooth dongle

Post by socratis »

Excellent work! 8)

The USB device in question (Bluegiga Low Energy Dongle, VID:0x2458, PID:0x0001) is seen by the host, you've created a filter (albeit overpopulated) and the device is seen as captured in the VBox.log:
[color=#0000BF]VBox.log[/color] wrote:
00:01:43.594236 VUSB: Attached '0000000009fa6220[proxy 2458:0001]' to port 2 on RootHub#1 (FullSpeed)
00:02:31.544719 VUSB: Detached '0000000009fa6220[proxy 2458:0001]' from port 2 on RootHub#1
After that it's all a matter of configuring your guest properly, VirtualBox has done its part completely and (most importantly) right.

The last checkpoint is that you actually see the device in your guest. And you do...
[color=#0000BF]lsusb[/color] wrote:
Bus 002 Device 003: ID 2458:0001
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Sharing Bluetooth dongle

Post by mpack »

So the executive summary: the claim that all Linux's can use this device without additional drivers is BS. The guest OS sees the device but has no idea what it is without an app level driver. That is standard USB behaviour.

While you may not require a specialized driver for this device, it's possible that you at least need to install a class driver. E.g. on the Wikipedia entry for BLE I see mention of BLE being supported "through BlueZ 5.0".
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Sharing Bluetooth dongle

Post by socratis »

FWIW, I followed the exact same procedure with my built-in Bluetooth device on my MBP, with a Mint19 guest. It worked right out of the box, drivers, discovery, pairing, the whole kit and caboodle, no additional drivers needed to be installed.

That doesn't mean that all Bluetooth adapters will do...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Sharing Bluetooth dongle

Post by mpack »

socratis wrote:That doesn't mean that all Bluetooth adapters will do...
While I've done no specific research, I do get the feeling that there's a standard class interface covering Bluetooth just as there is for mass storage. Mind you it's kind of hard to tell these days: what looks like native plug and play support could just as easily be downloading and installing the drivers in the background.
CoccoBill
Posts: 2
Joined: 30. Mar 2020, 12:41

Re: Sharing Bluetooth dongle

Post by CoccoBill »

Sorry about the bump if they're now encouraged.

I have an issue trying to pass through BT dongles to a guest, for somereason they are not recognized by VirtualBox. I've tried with 2 different models (a CSL Pico and a TP-Link UB400). Both of them work normally on the host.

Host: Win10 running VBox 6.1.4 + extpack
Guest: Ubuntu 19.10 + guest additions

Both of the adapters show up like this, this one is the CSL:

VBoxManage list usbhost

Code: Select all

UUID:               f1325fac-7917-4b91-af6f-2e72632f8fe7
VendorId:           0x0000 (0000)
ProductId:          0x0000 (0000)
Revision:           0.0 (0000)
Port:               1
USB version/speed:  0/Low
Current State:      Captured
When trying to manually attach them I get an error message (Failed to attach the device Unknown device 0000:0000...). For example that CSL is in the USB ID repository (VID 0a12 PID 0001).

Any ideas?
CoccoBill
Posts: 2
Joined: 30. Mar 2020, 12:41

Re: Sharing Bluetooth dongle

Post by CoccoBill »

Please ignore the previous, got it to work.

One or more of the following steps helped:

- Switched dongle to another usb port
- Rebooted host
- Reinstalled extpack and guest additions (same versions, not updates)
- Rebooted host

After that the dongle was recognized correctly in VBox, but unfortunately my ASMedia USB 3.1 host didn't like the idea, and BSOD'd. Swtiched again to another usb port, and now it works!
Post Reply