I'm running a Windows application in wine. The app can only see COM ports 1-4.

My system has the following usb-serial device:

# lsmod | grep cp210x
cp210x                 36864  0

# ls /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 0 Feb 14 00:42 /dev/ttyUSB0

How can I present this as COM1 to wine applications?

  • In older versions of Wine, edit the configuration file and use /dev/ttyUSB0 as name for the serial device. But newer Wine versions use the registry, and I've no idea where it is in the registry, and there doesn't seem to be documentation for it... ask on the Wine mailing list? (Why do people keep replacing working configuration files with stupid solutions?) – dirkt Feb 14 '20 at 8:42
  • a quick and dirty way would be to do a bind mount eg. mount -B /dev/ttyUSB0 /dev/ttyS0. With mount namespaces / unshare -Urm, you can limit this to a process and its descendants .Btw, it would be a better idea to add some udev rules to change the owner of that device; make it owned by a special group like gadget-user or similar, and add yourself to it). – mosvy Feb 14 '20 at 17:33

Here's how I solved this:

cd ~/.wine/dosdevices/
ln -s /dev/ttyUSB0 com5

That's all it required. My Windows app now gave me an option to use COM 5, and it worked right away.

In my research on this I did read that some people need to add a Wine registry key. I did not have to do this.

This is the common option that works with most applications:

[Hardware\\Devicemap\\Serialcomm] 1231984861

Here are the resources I used for my solution:

Set up the serial port in Wine · One Transistor https://www.onetransistor.eu/2015/12/wine-serial-port-linux.html

wine - Symbolic Link Between USB and COM Port - Ask Ubuntu https://askubuntu.com/questions/685985/symbolic-link-between-usb-and-com-port

Converting the /dev/ttyUSB to com port to use it with Wine in Linux - Super User https://superuser.com/questions/619528/converting-the-dev-ttyusb-to-com-port-to-use-it-with-wine-in-linux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.