Broader USB device support for Project Crostini takes a big step forward

Last month, the Linux containers in Chrome OS gained access to external storage, such as microSD cards or USB drives on a Chromebook. That’s just the first step though: There are Chrome OS owners who want their devices to have broad access to a range of USB devices from Linux. Think of Android phones for debugging or Arduino boards for coding and monitoring.

I’ve been watching these two Chrome OS bugs to help bring this type of USB support for Project Crostini and there’s some new, current information: Aside from progress on both of these, one is targeted for the Chrome OS 72 release, offering us an idea of when full USB support will be available in the Stable Channel.

The first bug is labeled “Enable USB emulation in crosvm“; crosvm is the virtual machine where the Linux container is run on Chrome OS using Crostini. Here’s a summary of the additional functions added:

This CL defines AttachUsbDevice, DetachUsbDevice, and ListUsbDevices
dbus methods for vm_concierge and adds corresponding request and
response protobufs.

And although the prototype code is fairly long, here’s a portion of the functionality between the USB device and the virtual machine:

If you enjoy reading code and want to see how this service is managed, here’s the full listing. This code still shows a target of Chrome OS 71, but I think that’s out of date and needs an update as Chrome OS 71 Stable is actually expected any day now. I found that it’s also what version shipped with the Pixel Slate when I reviewed last month.

The second, related change is dubbed “UI for Crostini USB Support” and adds user preferences to see if USB support is enabled or not. The flag for this is already available, having arrived last month in the Dev Channel.

The newest code appears to help manage the preference selection but also support the first code change above by tracking the name and description for all USB devices connected to the Linux container.

This change is slated for Chrome OS 73 at the moment so it might not arrive on the Stable Channel for a good three months. I’m going to keep watching it though because that seems a long time out considering some of the dependent changes are already in versions 71 and/or 72 of Chrome OS.

Regardless of the actual landing date, this will add some highly desired functionality to Linux on Chrome OS; particularly for developers, yes, but most everyone could find some benefit with broader USB support in Project Crostini.

6 thoughts on “Broader USB device support for Project Crostini takes a big step forward

  • December 4, 2018 at 10:33 am
    Permalink

    Neat…but I wish they would put some resources into fixing bluetooth. Not trying to derail the comments on your post…just voicing a huge frustration I have and which it seems like Google is making no effort to address.

    Reply
    • December 4, 2018 at 10:40 am
      Permalink

      No, I totally hear you on that. The new BT implementation is still in the works but you can enable it with a flag to try for now. chrome://flags/#newblue

      Reply
      • December 4, 2018 at 10:51 am
        Permalink

        I tried that a while ago and it hasn’t seemed to make a difference for me. BT still crashes on my Pixelbook and I have to restart to get it to work again. I have mouse, headphones and speaker that regularly disconnect; the later two being the biggest pain as I’m either listening to music or watching a video and have to stop everything to restart the chromebook. I’ve given up on using it for that which is a huge shame.

        Reply
  • December 4, 2018 at 1:26 pm
    Permalink

    I want to note that using an external USB keyboard and mouse already works with Crostini. Perhaps this new push is focused in particular on USB mass-storage devices?

    Reply
  • December 4, 2018 at 1:56 pm
    Permalink

    Really interested in using my Pixelbook to talk to serial devices and JTAG’s. So, I have been following the above bugs as well, but I am still unsure how the USB device will be reported to the user. Usually in Linux they are seen at ‘/dev/ttyUSB*’. I wonder where the device will be reported when in a VM?

    Reply
  • December 10, 2018 at 8:56 am
    Permalink

    notify me when arduino devices are compatible with arduino for linux (not the paid chromeos version!!!! i cant afford it)
    thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.