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

Solution 1:

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.

Solution 2:

Symlinks should work; however, they must be located in ~/.wine/dosdevices/, not in any random directory. The WineHQ article also shows the names in lower-case.

4.3.1. Serial and Parallel Ports

Serial and parallel port configuration is very similar to drive configuration - simply create a symbolic link in ~/.wine/dosdevices with the name of the device. Windows serial ports follow a naming convention of the word "com" followed by a number, such as com1, com2, etc. Similarly, parallel ports use "lpt" followed by a number, such as lpt1. You should link these directly to the corresponding Unix devices, such as /dev/ttyS0 and /dev/lp0. For example, to configure one serial port and one parallel port, run the following commands:

ln -s /dev/ttyS0 com1
ln -s /dev/lp0 lpt1