cant forward serial port to vm

atari

Active Member
Mar 4, 2016
27
0
41
50
neutrino-digital.com
after some update serial port forwarding dont work any more
in vm config:
serial0: /dev/ttyS0
in proxmox:
qm terminal 125
unable to find a serial interface
dmesg | grep ttyS
[ 0.853679] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 0.875268] 0000:00:16.3: ttyS4 at I/O 0xf0a0 (irq = 17, base_baud = 115200) is a 16550A

proxmox-ve: 5.4-1 (running kernel: 4.15.18-13-pve)
pve-manager: 5.4-5 (running version: 5.4-5/c6fdb264)
pve-kernel-4.15: 5.4-1
pve-kernel-4.15.18-13-pve: 4.15.18-37
pve-kernel-4.15.18-12-pve: 4.15.18-36
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-51
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-41
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-26
pve-cluster: 5.0-36
pve-container: 2.0-37
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-20
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 3.0.1-2
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-50
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.13-pve1~bpo2

on monitor:
info chardev
serial0: filename=serial
qmp: filename=unix:/var/run/qemu-server/125.qmp,server
qmp-event: filename=unix:
qga0: filename=disconnected:unix:/var/run/qemu-server/125.qga,server
 
Last edited:
in vm config:
serial0: /dev/ttyS0
in proxmox:
qm terminal 125
if you want to use qm terminal you have to set 'serial0: socket' and not a real device
 
please post the complete vm config, and the guest and host log
 
Here is data:

Guest OS (Windows 7) conf file
-----------------------------------------------------------------------------------
agent: 1
bootdisk: sata0
cores: 2
ide2: local:iso/virtio-win.iso,media=cdrom,size=362130K
memory: 4096
name: ******************
net0: virtio=DE:f4:5f:6F:8B:4A,bridge=vmbr0
numa: 0
ostype: win7
sata0: local:520/vm-520-disk-0.raw,size=50G
scsihw: virtio-scsi-pci
serial0: /dev/ttyS0
smbios1: uuid=4a40e825-3d2b-4fda-b3b4-a09c6fa5ce55
sockets: 1

Host OS dmesg:
-----------------------------------------------------------------------------------
dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 0.932088] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 0.952666] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A

pveversion:
-----------------------------------------------------------------------------------
proxmox-ve: 5.4-1 (running kernel: 4.15.18-14-pve)
pve-manager: 5.4-5 (running version: 5.4-5/c6fdb264)
pve-kernel-4.15: 5.4-2
pve-kernel-4.15.18-14-pve: 4.15.18-38
pve-kernel-4.15.18-5-pve: 4.15.18-24
pve-kernel-4.15.18-4-pve: 4.15.18-23
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: not correctly installed
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-9
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-51
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-42
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-26
pve-cluster: 5.0-37
pve-container: 2.0-37
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-20
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 3.0.1-2
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-51
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3

Additional information:

From host OS, when gues OS is down, /dev/ttyS0 - working properly. In guest OS /dev/ttyS0 is mapped as COM1.
Before upgrade host OS (proxmox, like kernel and other packages) COM1 is work properly.

I have old proxmox without upgrade with same settings. There all work:
pveversion ot it:
proxmox-ve: 5.3-1 (running kernel: 4.15.18-9-pve)
pve-manager: 5.3-11 (running version: 5.3-11/d4907f84)
pve-kernel-4.15: 5.3-3
pve-kernel-4.15.18-12-pve: 4.15.18-35
pve-kernel-4.15.18-9-pve: 4.15.18-30
pve-kernel-4.15.18-4-pve: 4.15.18-23
pve-kernel-4.15.18-2-pve: 4.15.18-21
pve-kernel-4.13.4-1-pve: 4.13.4-26
pve-kernel-4.10.17-4-pve: 4.10.17-24
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: not correctly installed
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-3
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-47
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-12
libpve-storage-perl: 5.0-39
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-23
pve-cluster: 5.0-33
pve-container: 2.0-35
pve-docs: 5.3-3
pve-edk2-firmware: 1.20181023-1
pve-firewall: 3.0-18
pve-firmware: 2.0-6
pve-ha-manager: 2.0-8
pve-i18n: 1.0-9
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 2.12.1-2
pve-xtermjs: 3.10.1-2
qemu-server: 5.0-47
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
 
what exactly is working/not working? does it work at all? does it stop working after a time? what do you try in the vm with the port?
any log messages from inside the guest? did you try with another guest os ? e.g. linux instead of windows?
 
Unfortunately, I can not explain everything.

The software that I use for serial port communication is specific, developed by my developers. The Linux version can only read from the serial port (I used it to test from host OS for communication to /dev/tsyS0 with another specific device - this works). The Windows version is used to read and write through the serial port (in guest OS).

Prior to the upgrade and the 2nd software(For Linux and Windows), they worked. After the upgrades, only the one for the Linux that runs through the host operating system works. In guest OS, serial port communication does not work with booting the operating system. In Windows i don't have any logs about this comunications.

I have not tested via linux guest OS. I tried Windows 10 guest, but the attempt was unsuccessful.
 
agent: 1
balloon: 4096
bios: seabios
boot: cdn
bootdisk: sata0
cores: 2
cpuunits: 1000
ide2: none,media=cdrom
machine: q35
memory: 16386
name: 7
net0: e1000=36:62:61:32:64:62,bridge=vmbr0
numa: 0
onboot: 1
ostype: win7
protection: 1
sata0: local-lvm:vm-125-disk-1,size=128G
scsihw: virtio-scsi-pci
serial0: /dev/ttyS0
smbios1: uuid=c7ad79c7-2bc7-45df-8da3-ae3c37b2645a
sockets: 1
startup: order=6,up=300
usb0: host=0403:6014

serial worked before ufter uprade dont
 
Hello, same here.
No serial pass through to a vm after new pve install and backup/restore. (from pve 5.3 to 5.4)
I need it to switch my RS232 relay-card on an old Windows 2000.
Windows shows COM1 but no communication is possible.

boot: dcn
bootdisk: ide0
cores: 1
ide0: local-zfs:vm-101-disk-0,size=100G
ide1: none,media=cdrom
memory: 512
name: Server-Win2000
net0: rtl8139=5E:F4:36:BD:71:87,bridge=vmbr0
numa: 0
onboot: 1
ostype: w2k
serial0: /dev/ttyS0
smbios1: uuid=0cd6f5f3-4bf5-4fe8-8cf0-0c399fcac1ba
sockets: 1
vga: vmware


proxmox-ve: 5.4-1 (running kernel: 4.15.18-14-pve)
pve-manager: 5.4-5 (running version: 5.4-5/c6fdb264)
pve-kernel-4.15: 5.4-2
pve-kernel-4.15.18-14-pve: 4.15.18-39
pve-kernel-4.15.18-12-pve: 4.15.18-36
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-9
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-51
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-42
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-26
pve-cluster: 5.0-37
pve-container: 2.0-37
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-20
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 3.0.1-2
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-51
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.13-pve1~bpo2
 
Hi,
I tried with Ubuntu 16.04 serial pass through to a qm vm. Unfortunately, it does not work there to.
 
Same problem with COM1. USB port forwarding is working. But hardware COM1 does not now.
Now I am unable to control my solar invertor.
I will try to change connection to the USB.

qm monitor 117
Entering Qemu Monitor for VM 117 - type 'help' for help
qm> info chardev
serial0: filename=serial
qmp: filename=unix:/var/run/qemu-server/117.qmp,server
qmp-event: filename=unix:
qga0: filename=disconnected:unix:/var/run/qemu-server/117.qga,server
 
same problem for my since update to

Code:
proxmox-ve: (running kernel: 4.15.18-1-pve)
pve-manager: 5.4-6 (running version: 5.4-6/aa7856c5)
pve-kernel-4.15.18-1-pve: 4.15.18-19
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-10
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-52
libpve-guest-common-perl: 2.0-20
libpve-http-server-perl: 2.0-13
libpve-storage-perl: 5.0-43
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.1.0-3
lxcfs: 3.0.3-pve1
novnc-pve: 1.0.0-3
proxmox-widget-toolkit: 1.0-28
pve-cluster: 5.0-37
pve-container: 2.0-39
pve-docs: 5.4-2
pve-edk2-firmware: 1.20190312-1
pve-firewall: 3.0-21
pve-firmware: 2.0-6
pve-ha-manager: 2.0-9
pve-i18n: 1.1-4
pve-libspice-server1: 0.14.1-2
pve-qemu-kvm: 3.0.1-2
pve-xtermjs: 3.12.0-1
qemu-server: 5.0-51
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.13-pve1~bpo2

VM Config:

Code:
agent: 1
bootdisk: virtio0
cores: 4
ide2: none,media=cdrom
keyboard: de
machine: pc-i440fx-1.4
memory: 8192
name: SBS2011
net0: virtio=7A:45:29:90:30:A7,bridge=vmbr0
ostype: win7
parent: Sharepoint
serial0: socket (tried with ttyS0, but didn't work too)
sockets: 1
startup: down=600
tablet: 0
vga: qxl
virtio0: local:500/vm-500-disk-1.qcow2,cache=writeback,size=140G
virtio1: local:500/vm-500-disk-2.qcow2,backup=0,cache=writeback,size=100G


tried /dev/ttyS0 under pve and worked

Code:
OPTIONS: I18n
Compiled on Apr 22 2017, 09:14:19.
Port /dev/ttyS0, 18:35:55

Press CTRL-A Z for help on special keys

RING
RING
RING
 
after some tests, i have to report it always worked here
with an onboard serial (serial0: /dev/ttyS0)
and with an usb adapter (serial0: /dev/ttyUSB0)
 
I can confirm. After update, serial port passthrough stopped working. (hardware serial /dev/ttyS0 on the host)
Possibly with a change to qemu 3.0.1, but I'm not sure.\

Moved serial port communiaction to host instead.

BUT.
When I talk to serial from the host, I get:
kernel:[21765.588818] do_IRQ: 1.35 No irq handler for vector

Serial works even with those messages.
So, this may be something related with the kernel/hardware combination.
 
Last edited:

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!