Question: USB devices/drivers between host OS and guest OS
by haertig from LinuxQuestions.org on (#4Z9W2)
I am trying to get a USB device working in a VirtualBox client.
My specific application is using an "RTL-SDR.blog" USB dongle in a VirtualBox VM: host OS "LinuxMint", guest OS "SkywaveLinux".
Within SkywaveLinux I am running an application named "gqrx".
This setup is a "Software Defined Radio" ("SDR"), which uses a USB dongle and antenna as a radio receiver that is controlled by the gqrx software application (and other applications later, but I'm starting with gqrx).
gqrx is not receiving anything from the dongle and I believe that is because of driver issues. SkywaveLinux's whole purpose is to support SDRs, so I am assuming that it has all the correct drivers. But I am unsure of the host OS. Do I even have to worry about drivers there, since the dongle will only be used in the guest OS? Could host OS drivers, possibly incorrect ones, possibly interfere with the guest OS talking to the dongle? The guest OS sees when I plug-in the dongle, so I believe I have that part configured in VirtualBox successfully.
Below is the output of a few commands as I insert the USB dongle, as viewed from the host and also as viewed from the guest. You will see the module "dvb_usb_rtl28xxu" mentioned in the host OS output, and I have seen on the internet that this is the default driver that will pop up, but it is not the driver that you want. But does this even matter, since this reference is from the host OS?
Thanks in advance for any help/suggestions!
Code:VirtualBox HOST (LinuxMint):
----------------------------
$ dmesg -T -w
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VMMR0.r0
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VBoxDDR0.r0
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VBoxEhciR0.r0
[Wed Feb 12 18:42:53 2020] usb 8-1: new high-speed USB device number 6 using xhci_hcd
[Wed Feb 12 18:42:53 2020] usb 8-1: New USB device found, idVendor=0bda, idProduct=2838
[Wed Feb 12 18:42:53 2020] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Feb 12 18:42:53 2020] usb 8-1: Product: RTL2838UHIDIR
[Wed Feb 12 18:42:53 2020] usb 8-1: Manufacturer: Realtek
[Wed Feb 12 18:42:53 2020] usb 8-1: SerialNumber: 00000001
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: found a 'Realtek RTL2832U reference design' in warm state
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[Wed Feb 12 18:42:53 2020] DVB: registering new adapter (Realtek RTL2832U reference design)
[Wed Feb 12 18:42:53 2020] i2c i2c-5: Added multiplexed i2c bus 6
[Wed Feb 12 18:42:53 2020] rtl2832 5-0010: Realtek RTL2832 successfully attached
[Wed Feb 12 18:42:53 2020] usb 8-1: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
[Wed Feb 12 18:42:53 2020] r820t 6-001a: creating new instance
[Wed Feb 12 18:42:53 2020] r820t 6-001a: Rafael Micro r820t successfully identified
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: Registered as swradio0
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: Realtek RTL2832 SDR attached
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: SDR API is still slightly experimental and functionality changes may follow
[Wed Feb 12 18:42:53 2020] Registered IR keymap rc-empty
[Wed Feb 12 18:42:53 2020] input: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:06.0/0000:02:00.0/usb8/8-1/rc/rc0/input20
[Wed Feb 12 18:42:53 2020] rc0: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:06.0/0000:02:00.0/usb8/8-1/rc/rc0
[Wed Feb 12 18:42:53 2020] input: MCE IR Keyboard/Mouse (dvb_usb_rtl28xxu) as /devices/virtual/input/input21
[Wed Feb 12 18:42:53 2020] rc rc0: lirc_dev: driver ir-lirc-codec (dvb_usb_rtl28xxu) registered at minor = 0
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: schedule remote query interval to 200 msecs
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully initialized and connected
[Wed Feb 12 18:42:53 2020] usbcore: registered new interface driver dvb_usb_rtl28xxu
[Wed Feb 12 18:42:54 2020] r820t 6-001a: destroying instance
[Wed Feb 12 18:42:54 2020] usb 8-1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully deinitialized and disconnected
$ lsmod | grep sdr
rtl2832_sdr 36864 0
videobuf2_vmalloc 16384 1 rtl2832_sdr
videobuf2_v4l2 28672 1 rtl2832_sdr
videobuf2_core 36864 2 rtl2832_sdr,videobuf2_v4l2
v4l2_common 16384 2 rtl2832_sdr,videobuf2_v4l2
videodev 176128 4 rtl2832_sdr,v4l2_common,videobuf2_core,videobuf2_v4l2
$ lsmod | grep rtl
dvb_usb_rtl28xxu 36864 0
rtl2832_sdr 36864 0
videobuf2_vmalloc 16384 1 rtl2832_sdr
videobuf2_v4l2 28672 1 rtl2832_sdr
videobuf2_core 36864 2 rtl2832_sdr,videobuf2_v4l2
v4l2_common 16384 2 rtl2832_sdr,videobuf2_v4l2
videodev 176128 4 rtl2832_sdr,v4l2_common,videobuf2_core,videobuf2_v4l2
rtl2832 28672 0
i2c_mux 16384 1 rtl2832
dvb_usb_v2 36864 1 dvb_usb_rtl28xxu
dvb_core 122880 2 rtl2832,dvb_usb_v2
rc_core 28672 13 ir_sharp_decoder,ir_xmp_decoder,lirc_dev,ir_lirc_codec,dvb_usb_rtl28xxu,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_jvc_decoder,dvb_usb_v2,ir_rc6_decoder,ir_sanyo_decoder
david@Davids-Linux-Desktop ~ $
$
VirtualBox GUEST (SkywaveLinux):
---------------------------------
$ dmesg -T -w
[Wed Feb 12 18:42:22 2020] usb 1-1: new high-speed USB device number 6 using ehci-pci
[Wed Feb 12 18:42:22 2020] usb 1-1: New USB device found, idVendor=0bda, idProduct=2838
[Wed Feb 12 18:42:22 2020] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Feb 12 18:42:22 2020] usb 1-1: Product: RTL2838UHIDIR
[Wed Feb 12 18:42:22 2020] usb 1-1: Manufacturer: Realtek
[Wed Feb 12 18:42:22 2020] usb 1-1: SerialNumber: 00000001
[Wed Feb 12 18:42:22 2020] systemd-udevd[2823]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1 1 6': No such file or directory
$ lsmod | grep sdr
$ lsmod | grep rtl
$


My specific application is using an "RTL-SDR.blog" USB dongle in a VirtualBox VM: host OS "LinuxMint", guest OS "SkywaveLinux".
Within SkywaveLinux I am running an application named "gqrx".
This setup is a "Software Defined Radio" ("SDR"), which uses a USB dongle and antenna as a radio receiver that is controlled by the gqrx software application (and other applications later, but I'm starting with gqrx).
gqrx is not receiving anything from the dongle and I believe that is because of driver issues. SkywaveLinux's whole purpose is to support SDRs, so I am assuming that it has all the correct drivers. But I am unsure of the host OS. Do I even have to worry about drivers there, since the dongle will only be used in the guest OS? Could host OS drivers, possibly incorrect ones, possibly interfere with the guest OS talking to the dongle? The guest OS sees when I plug-in the dongle, so I believe I have that part configured in VirtualBox successfully.
Below is the output of a few commands as I insert the USB dongle, as viewed from the host and also as viewed from the guest. You will see the module "dvb_usb_rtl28xxu" mentioned in the host OS output, and I have seen on the internet that this is the default driver that will pop up, but it is not the driver that you want. But does this even matter, since this reference is from the host OS?
Thanks in advance for any help/suggestions!
Code:VirtualBox HOST (LinuxMint):
----------------------------
$ dmesg -T -w
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VMMR0.r0
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VBoxDDR0.r0
[Wed Feb 12 18:42:05 2020] vboxdrv: 0000000000000000 VBoxEhciR0.r0
[Wed Feb 12 18:42:53 2020] usb 8-1: new high-speed USB device number 6 using xhci_hcd
[Wed Feb 12 18:42:53 2020] usb 8-1: New USB device found, idVendor=0bda, idProduct=2838
[Wed Feb 12 18:42:53 2020] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Feb 12 18:42:53 2020] usb 8-1: Product: RTL2838UHIDIR
[Wed Feb 12 18:42:53 2020] usb 8-1: Manufacturer: Realtek
[Wed Feb 12 18:42:53 2020] usb 8-1: SerialNumber: 00000001
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: found a 'Realtek RTL2832U reference design' in warm state
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[Wed Feb 12 18:42:53 2020] DVB: registering new adapter (Realtek RTL2832U reference design)
[Wed Feb 12 18:42:53 2020] i2c i2c-5: Added multiplexed i2c bus 6
[Wed Feb 12 18:42:53 2020] rtl2832 5-0010: Realtek RTL2832 successfully attached
[Wed Feb 12 18:42:53 2020] usb 8-1: DVB: registering adapter 0 frontend 0 (Realtek RTL2832 (DVB-T))...
[Wed Feb 12 18:42:53 2020] r820t 6-001a: creating new instance
[Wed Feb 12 18:42:53 2020] r820t 6-001a: Rafael Micro r820t successfully identified
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: Registered as swradio0
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: Realtek RTL2832 SDR attached
[Wed Feb 12 18:42:53 2020] rtl2832_sdr rtl2832_sdr.0.auto: SDR API is still slightly experimental and functionality changes may follow
[Wed Feb 12 18:42:53 2020] Registered IR keymap rc-empty
[Wed Feb 12 18:42:53 2020] input: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:06.0/0000:02:00.0/usb8/8-1/rc/rc0/input20
[Wed Feb 12 18:42:53 2020] rc0: Realtek RTL2832U reference design as /devices/pci0000:00/0000:00:06.0/0000:02:00.0/usb8/8-1/rc/rc0
[Wed Feb 12 18:42:53 2020] input: MCE IR Keyboard/Mouse (dvb_usb_rtl28xxu) as /devices/virtual/input/input21
[Wed Feb 12 18:42:53 2020] rc rc0: lirc_dev: driver ir-lirc-codec (dvb_usb_rtl28xxu) registered at minor = 0
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: schedule remote query interval to 200 msecs
[Wed Feb 12 18:42:53 2020] usb 8-1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully initialized and connected
[Wed Feb 12 18:42:53 2020] usbcore: registered new interface driver dvb_usb_rtl28xxu
[Wed Feb 12 18:42:54 2020] r820t 6-001a: destroying instance
[Wed Feb 12 18:42:54 2020] usb 8-1: dvb_usb_v2: 'Realtek RTL2832U reference design' successfully deinitialized and disconnected
$ lsmod | grep sdr
rtl2832_sdr 36864 0
videobuf2_vmalloc 16384 1 rtl2832_sdr
videobuf2_v4l2 28672 1 rtl2832_sdr
videobuf2_core 36864 2 rtl2832_sdr,videobuf2_v4l2
v4l2_common 16384 2 rtl2832_sdr,videobuf2_v4l2
videodev 176128 4 rtl2832_sdr,v4l2_common,videobuf2_core,videobuf2_v4l2
$ lsmod | grep rtl
dvb_usb_rtl28xxu 36864 0
rtl2832_sdr 36864 0
videobuf2_vmalloc 16384 1 rtl2832_sdr
videobuf2_v4l2 28672 1 rtl2832_sdr
videobuf2_core 36864 2 rtl2832_sdr,videobuf2_v4l2
v4l2_common 16384 2 rtl2832_sdr,videobuf2_v4l2
videodev 176128 4 rtl2832_sdr,v4l2_common,videobuf2_core,videobuf2_v4l2
rtl2832 28672 0
i2c_mux 16384 1 rtl2832
dvb_usb_v2 36864 1 dvb_usb_rtl28xxu
dvb_core 122880 2 rtl2832,dvb_usb_v2
rc_core 28672 13 ir_sharp_decoder,ir_xmp_decoder,lirc_dev,ir_lirc_codec,dvb_usb_rtl28xxu,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_jvc_decoder,dvb_usb_v2,ir_rc6_decoder,ir_sanyo_decoder
david@Davids-Linux-Desktop ~ $
$
VirtualBox GUEST (SkywaveLinux):
---------------------------------
$ dmesg -T -w
[Wed Feb 12 18:42:22 2020] usb 1-1: new high-speed USB device number 6 using ehci-pci
[Wed Feb 12 18:42:22 2020] usb 1-1: New USB device found, idVendor=0bda, idProduct=2838
[Wed Feb 12 18:42:22 2020] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Feb 12 18:42:22 2020] usb 1-1: Product: RTL2838UHIDIR
[Wed Feb 12 18:42:22 2020] usb 1-1: Manufacturer: Realtek
[Wed Feb 12 18:42:22 2020] usb 1-1: SerialNumber: 00000001
[Wed Feb 12 18:42:22 2020] systemd-udevd[2823]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1 1 6': No such file or directory
$ lsmod | grep sdr
$ lsmod | grep rtl
$