1

Is there any way how to forward (passthrough) physical serial port to XenGuest PV system? I need to be able to configure serial device with virtual server on XenServer 6.2.

I’m looking for a solution how to do serial port-forwarding.

EDIT: I was more reasonable to buy RS-232 to Ethernet converter. I've mentioned that under this comment https://serverfault.com/a/740196/187680. Main and the most important reason was the virtual machine is not dependant to one specific hosting server what enables to you more easily what how to manage XenServer updates and Fault-Tolerance of the virtual machine.

3 Answers 3

2

It's probably too late for you, but your question could be of general interest. If your serial port (or USB port or whatever) can be identified as PCI device, you can avoid XS to take into control that device and let manage it by guest OS.

  1. lspci to list devices and choose which one represents your serial port, in the following example the serial port PCI id is 02:00.0

    01:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
    02:00.0 Serial controller: MosChip Semiconductor Technology Ltd. PCIe 9922 Multi-I/O Controller
    05:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02)
    
  2. edit the /boot/extlinux.conf and look for "label xe" line, that identifies your boot default configuration; on the row beginning with "append /boot...", there are parameters; after "splash" add another parameter as "pciback.hide=(02.00.0)", where you should put in parenthesis the same PCI id you had found before. If the PCI devices you want to pass to guest are multiple, list them each one enclosed in parenthesis, separated by blanks, as in the example.

    label xe
      # XenServer
      kernel mboot.c32
      append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=752M,max:752M watchdog_timeout=300 lowmem_emergency_pool=1M crashkernel=64M@32M cpuid_mask_xsave_eax=0 console=vga vga=mode-0x0311 --- /boot/vmlinuz-2.6-xen root=LABEL=root-mvyxdjwc ro xencons=hvc console=hvc0 console=tty0 quiet vga=785 splash pciback.hide=(05:00.0) (02:00.0) (00:1d.0) --- /boot/initrd-2.6-xen.img
    
  3. Save the file, issue the extlinux -i /boot command and reboot your server.

  4. Now you should assign the PCI device(s) to the VM you want to manage them. Although there are more ways to get the UUID of a VM, you can list them all with xe vm-list command and choose the right one from the resulting list. In the example the wanted UUID is a82769ff-9dc4-56bb-61f9-57d741162a14

    uuid ( RO)           : a82769ff-9dc4-56bb-61f9-57d741162a14
         name-label ( RW): sersrv03.xyz.lan
        power-state ( RO): running
    
  5. And finally, the command that tells the VM to take into direct charge the PCI device(s) is the following, where you put the UUID of the wanted VM and the PCI id's of the PCI devices. In the example, there are two PCI devices listed, separated by comma.

    xe vm-param-set other-config:pci=0/0000:02:00.0,0/0000:00:1d.0 uuid=a82769ff-9dc4-56bb-61f9-57d741162a14
    
  6. Start the relevant VM and check if the new hardware is correctly detected.

This method comes from here, thanks to sotech for sharing.

Notes

  • Of course your device will be tied to a specific VM.
  • If your application depends on that specific PCI device, forget moving the VM elsewhere.
  • If your device is not listed as PCI, you are out of luck.
  • Not all devices are suitable to be managed this way. I had my bad time with an USB controlled UPS, that refused to be managed with this sort of passthrough.
  • I agree that TomTom's suggestion is the most general and canonical way to solve the problem with a serial port.
1
  • 1
    Welcome to Server Fault! Your answer suggests a workable solution to the question is available via another website. The Stack Exchange family of Q&A websites generally frowns on this type of answer because other websites may move, get deleted, or changed. Please read How do I write a good answer? and consider revising your answer to include the steps required to resolve the issue.
    – Paul
    Mar 26, 2015 at 0:48
0

Not possible. I suggest getting a serial to ethernet interface then use that that. Virtualization and serial ports are not really compatible.

2
  • What about in HVM mode? For example i don't have problem with serial port on vmware esxi. There passthrought works great. Jan 2, 2014 at 9:04
  • Yes, I agree with you. Serial to Ethernet is easiest way. Dec 2, 2015 at 10:00
0

I tried to make RS-232 pass-through the XenServer. And I didn’t succeed. The finally easiest way was to buy IP COM device. It makes VM independent to the host server and you are possible to use VM migration. I was surprised of stability of this device. No issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .