Suunto app Forum Suunto Community Forum
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    [Guide] How to get deploy working on Linux

    Scheduled Pinned Locked Moved Suunto Plus Development
    guidelinuxsuuntoplusdevelopment
    1 Posts 1 Posters 45 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      SuuntoPartnerTeam
      last edited by SuuntoPartnerTeam

      At present, by default, you cannot deploy an app to your watch from a system running Linux. This guide will show you how to set up a Windows virtual machine (VM) with Bluetooth (BT) passthrough, high performance, and a shared folder with the host system.

      I’m using a laptop with (A) a built-in PCIe BT device, (B) Ubuntu 25.10, and (C) the GRUB bootloader. What this means for you:

      (A) Run the following in a terminal emulator:

      lspci -k -nn | grep -A3 -i bluetooth
      

      On my system it outputs this:

      00:14.7 Bluetooth [0d11]: Intel Corporation Device [8086:a876] (rev 10)
              Subsystem: Intel Corporation Device [8086:000e]
              Kernel driver in use: btintel_pcie
              Kernel modules: btintel_pcie
      

      If you get nothing, then your BT adapter is connected via USB. You can run ‘lsusb’ to find it. What this means though is that:

      1. You can skip the parts of this guide that talk about binding to VFIO and PCIe
      2. You need to figure out the BT passthrough part yourself. Fortunately, with USB the process should only include a simple click of a button once the VM is running. There should be plenty of guides online, for example this one.

      If your output resembles mine, you need to write down three parts, which are:

      1. The address xx:yy.z, which for me is 00:14.7
      2. The Vendor:Device ID, here 8086:a876
      3. The driver, so btintel_pcie

      (B) I’ll be using the package manager ‘apt’. Your system might have a different one with differing package names. Adjust accordingly!

      (C) I’ll be adding two kernel parameters to GRUB’s config. If you have a more ‘‘exotic’’ bootloader, you should know where to put those instead.


      A word of caution


      Your device is your responsibility. I’m personally using this method, but anything may always happen. Always be careful 🙂

      Furthermore, you will temporarily lose BT on the Linux side. You can always roll back with:

      sudo rm /etc/modprobe.d/vfio-bt.conf
      sudo rm /etc/modprobe.d/blacklist-bt.conf
      sudo update-initramfs -u
      sudo reboot
      

      Additionally, if you let the VM enter a sleep mode, it may require a reboot for BT to start working again. Similarly, if your host system goes to sleep, then the whole system may require a reboot for BT functionality.


      Let’s go


      1. Enable IOMMU


      Your hardware should support virtualisation, but it isn’t always enabled by default. You may have to go to your BIOS/UEFI and enable VT-d/AMD-Vi/SR-IOV/IOMMU or whatever else they call it there. Once done, edit GRUB, for example with nano:

      sudo nano /etc/default/grub
      

      Find the line with ‘quiet splash’ and adjust it:

      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt"
      

      Of course, if you have an AMD CPU, write ‘amd’ over ‘intel’. The ‘pt’ stands for ‘passthrough’.

      Update GRUB and reboot:

      sudo update-grub
      sudo reboot
      

      Then verify:

      find /sys/kernel/iommu_groups/ -type l
      

      Among the output, I get /sys/kernel/iommu_groups/13/devices/0000:00:14.7 where you can see a familiar address at the end. The device is alone in its group, which is excellent, since that group will be lost to the host. If you BT is grouped with other things, it might be wise to abort this tutorial, since I cannot tell what other important stuff this group might include. Perhaps get yourself a cheap BT dongle instead 🙂


      2. Install the goods and update your rights


      sudo apt update
      sudo apt install \
        qemu-kvm libvirt-daemon-system ovmf \
        libvirt-clients virt-manager virtiofsd
      

      After which:

      sudo usermod -aG libvirt,kvm $USER
      newgrp libvirt
      

      Verify that the following returns an empty list:

      virsh list --all
      

      3. Bind Bluetooth to VFIO


      Again, skip to chapter 4 if you do not have a PCIe device. After this point, Linux will become “blind” to the presence of the BT hardware.

      3.1 Load VFIO modules

      Edit vfio.conf:

      sudo nano /etc/modules-load.d/vfio.conf
      
      vfio
      vfio_pci
      vfio_iommu_type1
      vfio_virqfd
      

      3.2 Bind the BT device

      Create a modprobe config with your Vendor:Device ID:

      sudo nano /etc/modprobe.d/vfio-bt.conf
      
      options vfio-pci ids=8086:a876 disable_vga=1
      

      Then blacklist the native driver:

      sudo nano /etc/modprobe.d/blacklist-bt.conf
      
      blacklist btintel_pcie
      

      Update initramfs and reboot:

      sudo update-initramfs -u
      sudo reboot
      

      3.3 Verify

      Run lspci -k -nn | grep -A3 -i bluetooth again.
      You must see Kernel driver in use: vfio-pci.


      4. Create the Windows VM


      This chapter will include some screenshots for clarity.

      You’ll need to download a Windows iso file.
      I went with Windows 10. Please note that Windows 10 is not supported by Microsoft anymore, so you should not use the VM for browsing sketchy sites. For performance, also get the latest virtio-win.iso.

      Next, launch virt-manager, which you installed earlier, and click the big button there to start the VM setup process.

      Choose local install:

      Image of a dialog showing 4 radio buttons

      Then browse…:

      Image of a dialog for ISO selection

      Browse local and find the Windows iso you downloaded earlier:

      Image of a dialog for locating ISO media volumes

      For me, the automatic detection insists it’s Windows 11, so I chose W10 manually:

      Image of the earlier ISO selection dialog

      You’ll probably want to give this thing >= 8 GiB of RAM and plenty of CPUs. If the VM is running slow, you might see the SuuntoPlus Editor time out when trying to communicate with your watch. These settings can be changed later at any point:

      Image of memory and CPU settings

      It will offer 40 GiB by default. I personally went with 64 to be on the safer side:

      Image of storage settings

      Important!! Check the option to customise before install:

      Image of a summary dialog of what you've done so far

      In overview, change firmware to OMVF_CODE_4M.fd:

      Image of further configuration settings with overview selected

      In CPUs, make sure the host-passthrough is checked:

      Image with CPUs tab selected

      In memory, enable shared memory, which allows for a shared folder between the host and the VM:

      Image with memory tab selected

      In boot options, check the CDROM and move it first or you will have a tough time booting:

      Image with boot options tab selected.png

      In disk, change disk bus to VirtIO:

      Image with SATA Disk 1 tab selected

      In networking, change the network to virtio as well:

      Image with NIC tab selected

      Now we’re going to add hardware 3 times. First add storage. Find the virtio.iso you downloaded earlier and select the type as CDROM device:

      Image of add hardware dialog with storage tab selected

      Then, add a PCI Host Device. You’re going to need that address you wrote down way back:

      Image of add hardware dialog with PCI host device tab selected

      Make sure you go and uncheck ROM BAR for stability:

      Image of the main configuration dialog with the just-added PCI device selected

      Finally, we want to add a shared folder aka ‘Filesystem’ so that you can send files between the host and the VM. Create a folder anywhere on your device and select it. Target path can be called anything:

      Image of add hardware dialog with filesystem tab selected

      You can now begin installation! Beware that there will be a ‘‘quick time event’’ when the VM boots where you need to click any key to boot the iso. Miss it and you will need to reboot the VM for a second chance.


      5 Configuring Windows


      Go throught the installation, choose no product key etc. I went with the option of Windows 10 Pro since I’m a pro 😎 The important thing is to choose custom install, then load driver, and from there the Windows 10 driver:

      Image of Windows setup at driver selection

      Now your main installation drive will appear. Windows will reboot on its own and then enter the second setup phase. Due to virtio we don’t have access to the internet, which is great! Windows will complain, just say you don’t have internet. It will reboot and complain again, but you must insist 🙂

      Once the installation is done, inside Windows you should open the file explorer and go to where the attached drives are (‘‘This PC’’). There should be the virtio-win CD Drive you attached in chapter 4. Open it and install the guest tools inside. You will suddenly have a working internet connection inside the VM! Windows should tell you that it needs to reboot – do so.

      We still need to fetch a couple of things inside the VM.

      5.1 Winfsp

      Get winfsp. After it’s installed, open admin cmd by writing ‘cmd’ in the start menu and pressing Ctrl+Shift+Enter. You should have gotten a User Account Control prompt to elevate your privileges. If not, close the command prompt and try again.
      Inside the command promp, run:

      sc start VirtioFsSvc
      

      You want the service to start automatically, therefore also run:

      sc config VirtioFsSvc start= auto
      

      The space after = is there on purpose. If these fail with some error codes, you either didn’t install winfsp or you aren’t running the prompt as admin.

      File explorer should now have a new drive where you can put anything and it will appear on the Linux side, in the folder you chose when you added a filesystem at the end of chapter 4. Likewise, stuff added on the Linux side will appear instantaneously in Windows. Great for when you, for example, want to develop a project on Linux and then send it to your watch using the VM.

      5.2 Bluetooth drivers

      Yeah about that sending – you still need BT drivers! Since I have Intel, I went here, but you’re going to solve this one on your own if you have something else.


      The end


      That’s it. As a final tip, in the top bar with ‘File | Virtual Machine | View | Send Key’ you may want to go to ‘View > Scale Display > Auto resize VM with window’ for a better visual experience.

      Get VS Code, install the SuuntoPlus Editor, connect your watch inside Windows, and get to developing! Cheers!

      1 Reply Last reply Reply Quote 1
      • Dimitrios KanellopoulosD Dimitrios Kanellopoulos pinned this topic
      • First post
        Last post

      Suunto Terms | Privacy Policy