How to passthrough Serial from a USB-Serial Adapter?

KevinPeters

New Member
Sep 22, 2022
16
2
3
I have a PL2303 USB serial adapter that I am trying to use in a Windows 11 guest. I appreciate that the simplest thing to do is pass through the entire USB device to the guest, however there is no driver support in Windows 11 for this device. Therefore I want to pass just the serial port from the host to the guest. My expectation is that the serial port will just appear as a com port in the guest Windows.

How do I do this? On the VM I can add a serial port in the GUI but there are no options associated with it - it just maps to a "socket".

The device is recognised:
Bash:
$ sudo dmesg | grep pl2303
[    6.049664] usbcore: registered new interface driver pl2303
[    6.049704] usbserial: USB Serial support registered for pl2303
[    6.050432] pl2303 1-10:1.0: pl2303 converter detected
[    6.051565] usb 1-10: pl2303 converter now attached to ttyUSB0

module is loaded:
Bash:
kevin@abe:/dev/serial/by-id$ lsmod | grep pl2303
pl2303                 32768  0
usbserial              65536  2 pl2303,ftdi_sio

Device has a link:
Bash:
cd /dev/serial/by-id/
kevin@abe:/dev/serial/by-id$ ls -la
...
lrwxrwxrwx 1 root root 13 Nov  3 17:54 usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB0

I tried running these commands:
Bash:
root@abe:~# qm set 103 -args "-chardev tty,path=/dev/ttyUSB0,id=hostusbserial"
update VM 103: -args -chardev tty,path=/dev/ttyUSB0,id=hostusbserial
root@abe:~# qm set 103 -args "-device pci-serial,chardev=hostusbserial"
update VM 103: -args -device pci-serial,chardev=hostusbserial

But when I try to start the guest I get:
Code:
swtpm_setup: Not overwriting existing state file.
kvm: -chardev tty,path=/dev/ttyUSB0,id=hostusbserial: 'tty' is not a valid char driver name
stopping swtpm instance (pid 65135) due to QEMU startup error
TASK ERROR: start failed: QEMU exited with code 1

Any help appreciated!
 
That seems like a very sensible solution. I want to try it, but how the heck do I remove "-chardev tty,path=/dev/ttyUSB0,id=hostusbserial" and "-device pci-serial,chardev=hostusbserial"

Thank you for your help!
 
That seems like a very sensible solution. I want to try it, but how the heck do I remove "-chardev tty,path=/dev/ttyUSB0,id=hostusbserial" and "-device pci-serial,chardev=hostusbserial"
nano /etc/pve/qemu-server/103.conf or use your own favorite text editor to edit the VM configuration file directly?
 
  • Like
Reactions: KevinPeters
I appreciate that the simplest thing to do is pass through the entire USB device to the guest, however there is no driver support in Windows 11 for this device.
Isn't this normal? Linux has the drivers and depending on the genuineness of the device, it should work with the original driver, yet is is not present in Windows directly. Have you tried installing the driver?
 
Isn't this normal? Linux has the drivers and depending on the genuineness of the device, it should work with the original driver, yet is is not present in Windows directly. Have you tried installing the driver?
Thanks but I'm not sure I understand what you mean. The supplier of the device has decided somehow that the device is not to be supported in Windows 11 as per the attached screenshot.

I have removed the chardev reference (didn't realise it was just in the conf file!) so the VM now boots into Windows, however there are no com ports showing, so I need to debug more tomorrow.
 

Attachments

  • Prolific-PL2303TA-USB-to-Serial-and-Windows-11-Problem.jpeg
    Prolific-PL2303TA-USB-to-Serial-and-Windows-11-Problem.jpeg
    87.4 KB · Views: 18
Thanks but I'm not sure I understand what you mean. The supplier of the device has decided somehow that the device is not to be supported in Windows 11 as per the attached screenshot.
Ah, the vendor has no drivers for it ... that's sad. Maybe it is a conterfeit cloned module? There are a lot of people complaining about this for windows-based operating systems. Linux does not mind and any serial2usb bridge I tried over the years worked perfectly (genuine or clone).

Have you tried a CH34x, CP2102, FT232, ... ?
 
Ah, the vendor has no drivers for it ... that's sad. Maybe it is a conterfeit cloned module? There are a lot of people complaining about this for windows-based operating systems. Linux does not mind and any serial2usb bridge I tried over the years worked perfectly (genuine or clone).

Have you tried a CH34x, CP2102, FT232, ... ?
Yes, I suspect cloned/counterfeit to be something to do with it, or at least their attempt to clamp down on it. As a last resort I can create a new machine with Windows 10, but I thought this could be a good opportunity to learn!
 
Excellent! This works perfectly - Windows 11 can see the com port and I can connect to it just fine. Interestingly it didn't appear at first, I had to do a couple of reboots first.

How come you can't map the serial port via the GUI? Is it just a piece of functionality that hasn't made it to the top of the backlog?

Thanks to everyone that helped.
 
How come you can't map the serial port via the GUI? Is it just a piece of functionality that hasn't made it to the top of the backlog?
Serial is almost dead in virtualization as compared to former times, same as virtual floppy disks for e.g. winnt.sif stuff, as we used in the last decade or the one before that. You can see that with Windows 11 and no drivers for things like that. Use a supported serial adapter or don't use Windows.
 
Serial is almost dead in virtualization as compared to former times, same as virtual floppy disks for e.g. winnt.sif stuff, as we used in the last decade or the one before that. You can see that with Windows 11 and no drivers for things like that. Use a supported serial adapter or don't use Windows.
Thanks, but this is the one application that I still use that only supports Windows. Sometimes we don't get a choice in these things. I could buy a different cable but this is the only one that officially works with my device. Sometimes we have to make do with what we have and spend some time to make it work.
 
Thanks, but this is the one application that I still use that only supports Windows. Sometimes we don't get a choice in these things. I could buy a different cable but this is the only one that officially works with my device. Sometimes we have to make do with what we have and spend some time to make it work.
Yes sure. I just wanted to say that in those corner cases, the use of the CLI to get things done as the only way is totally acceptable.
 
  • Like
Reactions: KevinPeters

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!