Serial Ports in Wine

Setting up serial ports in Wine is evidently automagic for the old-standard-hardware ports that appear as /dev/ttyS0. Unfortunately, that seems to not work for USB serial ports that appear as /dev/ttyUSB0 (or whatever is next in line when it’s plugged in).

The quick-and-dirty solution is to set up symlinks, thusly:

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

and so forth. As long as the USB gadget pops up with the same number, that’ll work.

It is best to avoid any built-in hardware ports that already have automagic com1 / com 2 / whatever identifiers. Start with com3 or higher unless you know com1 / com2 are vacant. I suppose some laptop IRDA (remember that?) ports may still show up as com3 / com 4.

Unlike the other devices, there’s no trailing colon. They’re also lowercase, although Windows sort of expects uppercase; that’s evidently handled under the covers.

This would be better handled by UDEV magic that creates the appropriate links on the fly based on the USB device ID, but just hand-creating the links works well enough for my simple needs so far.