2

I have a few USB devices that have newer firmware available, but I don't have a Windows PC handy to update the firmware.

First I checked fwupdmgr to see if I could update the devices directly in Linux, but it said there weren't any firmware updates available.

Next I tried updating the firmware in Windows 10 and 11 VMs using Virtualbox 7. I set up USB passthrough, and the devices appear to work fine within Windows. In fact, for some of the devices (e.g. multiple Logitech mice) I installed the vendor software which recognized the devices and allowed me to make changes to them (but not update firmware).

I also made sure I'm a member of the vboxusers group, and I see that VirtualBox's udev rules are intact at /etc/udev/rules.d/60-vboxdrv.rules. And I've tried setting the USB controller to different versions in the VM settings (USB 3.0, 2.0, 1.1).

I've also read through this page and tried everything listed there: https://forums.virtualbox.org/viewtopic.php?t=82639

Lastly, I tried Gnome Boxes and virt-manager in case this issue was unique to VirtualBox, but neither of those worked either.

I've seen some people mention they were able to update firmware using Virtualbox on macOS, e.g.:

So I'm wondering if perhaps there's something unique to how Linux USB devices connect to VMs that makes firmware updates impossible.

My question is similar to this one, but that user is asking if it's safe to update firmware, not if it's possible.

bmaupin
  • 349
  • 1
  • 5
  • 15
  • Has anyone tried PCI pass-through of a USB card or controller to bypass any limits on USB pass-through? I realize this is an experimental feature of VirtualBox so there's some potential pitfalls there. – MacGuffin Jul 28 '23 at 06:38

1 Answers1

2

After trying a handful of iterations (Windows 10/11 on VirtualBox/Gnome Boxes/virt-manager) my best guess is that it simply isn't currently possible to update firmware through a Windows VM running on Linux.

I don't use Windows but the only workaround I could come up with is have a small Windows installation just for updating firmware. You could:

  • Install Windows on an old unused computer
  • Create a small Windows partition on a computer you use
  • Install Windows to an external drive

Install Windows the normal way

The easiest way to install Windows is to download the Windows 10 or Windows 11 installation ISO, create a bootable USB installation, and then use that to install Windows.

In my case, I don't want to erase a perfectly good USB drive just to create the Windows installation media, and I do want to be able to use my computer while I'm installing Windows, so I prefer to install Windows directly from Linux.

Install Windows 10 from Linux using deploy-win10-from-linux

This is a really cool tool that permits installing Windows 10 completely from Linux without the use of a VM, but it's somewhat advanced and the documentation is sparse. I was able to get it working, however, and I documented what I did here: https://codeberg.org/regnarg/deploy-win10-from-linux/issues/1

Install Windows 10 from Linux using VirtualBox

Note that I installed Windows 10 using MBR+BIOS to keep it simple. Adjust these steps as necessary if you're using GPT+EFI.

  1. Download Windows 10 ISO from https://www.microsoft.com/software-download/windows10ISO

  2. Prepare the destination

    This is only needed if you want to install Windows on a specific partition. If you want to install Windows on an entire drive you can skip this step.

    I typically use GParted for this kind of work:

    1. Create some free space on the drive

      1. Open GParted and resize or delete one or more partitions then click Apply All Operations at the top. I'd recommend at least 80 GB of space for Windows 10.
    2. (Optional) Create a new NTFS partition

      1. Right-click on unallocated space > New > File system > ntfs > Add then click Apply All Operations at the top
  3. Install Windows

    1. Install VirtualBox

    2. Create a VMDK file for the drive, e.g.

      sudo vboxmanage internalcommands createrawvmdk -filename sda.vmdk -rawdisk /dev/sda
      
    3. Change ownership of the VMDK files to your user

      sudo chown "$USER:" *.vmdk
      
    4. Give your user temporary access to the disk group

      sudo usermod -aG disk "$USER"
      newgrp disk
      
    5. Start VirtualBox

      virtualbox
      
    6. Create a new VM for Windows 10

      • ISO Image > Select the Windows 10 installation ISO you downloaded

      • Check Skip Unattended Installation if you are installing to a specific partition and not the whole drive

        ⚠ Installing Windows unattended is a really cool feature of VirtualBox that will save you some work, but you should only use it if you're installing Windows to an entire drive as it will erase the entire disk.

      • Select Use an Existing Virtual Hard Disk File and browse to the VMDK file you created

    7. Boot the VM

      • If you did not check Skip Unattended Installation, the VM will power on automatically and install Windows

      • If you checked Skip Unattended Installation, you will need to power on the VM and manually go through the Windows installation process

        1. Press a key after powering on to boot to the Windows installation

        2. Click Next > Install now

        3. Fill out the next screens as needed until you get to Which type of installation do you want?

        4. Choose Custom: Install Windows only (advanced) and then select the partition to install Windows to

    8. After the installation finishes, it will reboot the VM; power off the VM before it boots

    9. (Optional) Delete the VM from VirtualBox

    10. Exit VirtualBox and remove your user from the disk group

      sudo deluser "$USER" disk
      
  4. If you installed Windows to a specific partition on a disk with Linux on it, you'll need to set up Grub again

    1. Reinstall Grub, e.g.

      sudo grub-install /dev/sda
      
    2. Add a Windows entry to Grub

      1. Enable the OS prober

        sudo sh -c 'echo GRUB_DISABLE_OS_PROBER="false" >> /etc/default/grub'
        
      2. Run update-grub

        sudo update-grub
        
  5. Reboot your computer and boot to the new Windows installation

    • If you installed Windows to the entire drive, it should boot directly to Windows
    • If you installed Windows to an external drive, you'll need to select that drive from your computer's boot options
    • If you installed Windows to a specific partition, choose the new Windows 10 menu entry from Grub
bmaupin
  • 349
  • 1
  • 5
  • 15