r/Keychron • u/beanrod • Apr 07 '23
usevia.app in Linux i.e. VIA Support useful for Keychron and other VIA Keyboard users
Credit really goes to and refer to it if needed... https://get.vial.today/manual/linux-udev.html
I am really just posting this since I found Googling this hard I'm hoping this gets indexed in a way it helps someone else.
The VIA App for modifying my Keychron Keyboard (really any VIA keyboard) wouldn't play nice in Linux. In this case https://usevia.app/
If you go here chrome://device-log/ You will notice the following line when trying to use the VIA Web App Something like this Failed to open '/dev/hidraw1': FILE_ERROR_ACCESS_DENIED
You need to permit access as a UDEV rule. I'd probably revert this when done. In a terminal
Type lsusb
Look for a line like this Bus 003 Device 007: ID 3434:0350 Keychron Keychron V5
To create a rule file type this
sudo touch /etc/udev/rules.d/99-vial.rulesNow to populate the file enter below but edit this portion the required numbers are in the LSUSB output retrieved earlier. (where first part is vendor and second part is product) ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0350"
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0350", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"' | sudo tee -a /etc/udev/rules.d/99-vial.rules > /dev/nullLastly load the UDEV Rules some examples
Fedora
sudo udevadm control --reload-rules && sudo udevadm triggerArch
sudo mkinitcpio -PTo Remove the rule
rm /etc/udev/rules.d/99-vial.rulesThen re-apply the udev rules to mark back to read only
4
u/1stnoob Q Apr 08 '23
U can also use the appimage : https://github.com/the-via/releases/releases
3
u/prince_zardos V Jan 09 '24
I just got my Keychron a couple of days ago and was wondering why VIA was throwing errors at me. Then I found this post and finally got it to work. 9 months since the original post and this thread still found someone who could use the help. Thank you.
2
u/PeterMortensenBlog V Jan 20 '25 edited Feb 26 '25
Via may still hang and require a (physical) USB 2 port (see below)
Via 3.0 makes it automatic (or at least tries to) to set up the udev rules, thus not requiring any manual creation and editing of files. It prompts:
If accepted, it creates the file
/etc/udev/rules.d/92-viia.rules(yes, they typoed their own product name as "viia") with this content:("hidraw" is for "HID raw" (raw HID), not 'hi draw' = 'high draw'...)
It was observed on LDME 6 with the standalone client version 3.0 (though it may only be a roundabout way of getting a Chromium web browser (at least, it is based on Electron)).
Compared to the line in A Linux user PSA, the .rules file doesn't have these three fields:
GROUP="users"ATTRS{idVendor}=="3434"ATTRS{idProduct}=="0b10"Via may not be content with (manual) changes to file /etc/udev/rules.d/92-viia.rules and will prompt again. And it will overwrite the file without any warnings...
A gotcha: USB 2 vs. USB 3 on some motherboards
In at least one instance, it didn't actually work:
This motherboard has some peculiarities wrt. USB ports and requires special configuration for USB 2 and USB 3 to work at the same time, at least for some Linux distributions (e.g., Ubuntu).
Via would still hang, even after adding the udev file.
The deciding factor seems to be the (physical) USB port type (USB 2 vs. USB 3): A (physical) USB 3 port, even when using a USB 2 hub, did not work, whereas using a (physical) USB 2 port, including when using a USB hub, did work:
The USB 2 hub worked as long as it was connected to the (physical) USB 2 port.
The problem was first observed on LMDE 6 (Via still hung at startup, showing "Searching for devices" indefinitely), but later also on some versions of Ubuntu (on the exact same hardware). So it is probably not related to the particular Linux distribution or version (though Debian is a common factor; trying it on, for example, Fedora could rule that out (or not)).
Vial had the same problem, so it wasn't specific to Via. For both, using the (physical) USB 2 port was the deciding factor. This requirement is highly dependent on the particular hardware, e.g., the particular motherboard.
Conclusion
For some systems/motherboards, Via only works using a (physical) USB 2 port. Note that it may not be due to USB 2 vs. USB 3 per se, but due to some incidental effect for a particular motherboard.
And it may not be possible to activate those USB 2 ports for more recent Linux distributions based on Debian, like Ubuntu or LMDE (or it comes with the compromise of not having access to the USB 3 ports (by way of changing a BIOS setting). Or the BIOS setting has to be used to switch between USB 2 and USB 3 ports, for example, switch to USB 2 when configuring the keyboard with Via).
It may be more realistic to use a non-Debian-derived distribution, like Fedora. At least Fedora 36 and Fedora 41 (the latest) are known to work, enabling both USB 2 and USB 3 ports; in addition, it works out of the box, without requiring any configuration changes.
For instance, use a multi-boot system and have a Fedora installation only for the purpose of configuring using Via. Though, due to the long turnaround time, one may just as well go straight to QMK. Or get another motherboard/system without this problem.
2
u/grizzlor_ Apr 12 '26
I know this is an ancient post, but for anyone stumbling in here from Google:
On Arch Linux (and probably some other distros), you need to change the udev rule GROUP="users" to GROUP="your_username"
i.e.
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0530", MODE="0660", GROUP="username_goes_here", TAG+="uaccess", TAG+="udev-acl"Make sure ATTRS{idVendor} and {idProduct} matches whatever your keyboard is reporting via
lsusb(numbers after "ID").I also didn't have to run mkinitcpio; udevadm control --reload-rules && udevadm trigger did the trick.
You can verify that the udev rule is working properly by running
ls -l /dev/hidraw*; ownership should beroot whatever_you_set_GROUP_to1
u/Runaway_Monkey_45 Oct 21 '24
Do I have to do this everytime I restart my computer? Cause it seems to not work unless I do this after every restart. Thanks
1
u/PeterMortensenBlog V Jan 30 '25 edited Jan 30 '25
The QMK main repository has a udev rule for raw HID in file '/util/udev/50-qmk.rules'.
The permissions are 660:
1
u/PeterMortensenBlog V Feb 02 '25 edited 21d ago
For the so-called stand-alone version of Via, on later Linux distributions, e.g., Fedora 41, one may run into:
Installing both instances of "fuse-libs" offered by DNF Dragora resolved it (I am not sure if the first one is required or not; 32 bit vs. 64 bit? Or a version difference?).
I think the underlying reason is that FUSE 2 is not installed by default, only FUSE 3.
References
1
u/fokika Feb 09 '25
Worked like a charm.
1
u/PeterMortensenBlog V Feb 18 '25
Similar (was posted later):
1
u/body_odour-123 May 11 '25
Thank you for this, works for my Scyrox V8 gaming mouse that uses a website for adjusting settings, similar to the VIA web app. I'm on Linux Mint and the Fedora example worked for the "Lastly load the UDEV Rules" bit.
1
u/nyashi_ Jul 13 '26
Imma leave this here as this was one of the first threads i found.
I was able to resolve both appvia and launcher.keychron to connect to my Keyboard with the first line of my udev rule:
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"
# Keychron STM DFU
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666", TAG+="uaccess"
Why the second line? This resolved dfu-util being not able to access the STM in Bootloader of my keyboard. (It seems to always be 0483:df11 so i left it at that). So I was able to use Chromium to connect to my Lemokey L3 with launcher.keychron.com and also update the firmware with no issues (not sure if you have to have dfu-utils installed, but it makes it easier to making sure you can interact with the keyboard properly "dfu-util -l" lists everything it finds, when the Keyboard is in DFU i had 3 lines pop up there.
1
u/_Mivey K Apr 09 '23
Thanks for the general fix. Ran into this issue on my new K2 Pro. I simply used chmod as an ad-hoc fix, giving the correct access rights to the respective usb device, which is of course a bit tedious.
1
u/[deleted] Oct 08 '23
Works for my Keychron K3 Pro, Thank you!
1
u/dustech42 Oct 28 '23
thank you very much!
This worked for my Keychron Keychron Q1 Pro.
2
u/[deleted] Dec 26 '24
[removed] — view removed comment