Linux – Converting the /dev/ttyUSB to com port to use it with Wine in Linux

linuxserial portwine

I have some software which runs on Windows. I installed Wine and ran it in Linux. It works fine but the issue is it communicates with a serial port. Therefore the only option I can choose are com1, com2, …

But my device on the Linux machine is actually located at the /dev/ttyUSBn location. How do I use the above software in Linux Ubuntu?

I have tried ln -s /dev/ttyUSBn COM1 in the ~/.wine/dosdevices/. It does not appear to work.

Best Answer

Starting from Wine 2.8, the simple symlink-editing method of configuration doesn't work. One has to configure COM ports by editing Wine registry. From Wine User's Guide/Other Things to Configure/Serial and Parallel Ports:

To override Wine's default device mapping, run wine regedit and create string entries in HKEY_LOCAL_MACHINE\Software\Wine\Ports where the entry name is the Windows device name and the entry value is the path to the Unix device. Continuing with the above example, to make COM1 the first USB-attached serial port, create an entry with the name COM1 and the value /dev/ttyUSB0. You might also want to create an entry named COM5 with no value to remove the COM5 device which is now a duplicate of COM1. After editing the registry, shut down Wine with wineserver -k and the next time Wine runs a program, your changes will take effect.

Related Question