XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Issues getting serial to work

    Scheduled Pinned Locked Moved Compute
    3 Posts 2 Posters 658 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pyroteq
      last edited by

      G'day, can someone please help me before I go insane. I had already typed out a post and then when I went to post it asked me to confirm my email (despite posting before) which made me lose everything I typed which has made this even more frustrating after spending hours trying to get this working...

      Ok, so I have 2 hypevisors.

      I've managed to get serial connection working on it very easily in just a few minutes.

      Machine 1

      dmesg | grep tty
      [    0.000000] Command line: root=LABEL=root-pjvhsg ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:21:00.0)
      [    0.436953] Kernel command line: root=LABEL=root-pjvhsg ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:21:00.0)
      [    0.491878] console [tty0] enabled
      

      All I needed to do was edit the grub.cfg file, reboot and it showed up straight away on my laptop connected via serial hub.

      cat /boot/efi/EFI/xenserver/grub.cfg
      serial --unit=0 --speed=115200
      terminal_input serial console
      terminal_output serial console
      set default=0
      set timeout=5
      if [ -s $prefix/grubenv ]; then
              load_env
      fi
      
      if [ -n "$override_entry" ]; then
              set default=$override_entry
      fi
      
      menuentry 'XCP-ng' {
              search --label --set root root-pjvhsg
              multiboot2 /boot/xen.gz dom0_mem=4096M,max:4096M watchdog ucode=scan dom0_max_vcpus=1-16 crashkernel=256M,below=4G com1=115200,8n1 console=com1,vga vga=mode-0x0311
              module2 /boot/vmlinuz-4.19-xen root=LABEL=root-pjvhsg ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:21:00.0)
              module2 /boot/initrd-4.19-xen.img
      }
      

      Machine 2

      This one is a bit different as it doesn't have any serial headers on the motherboard so I've bought a PCIe serial/parallel card.

      lspci -v | grep -A 14 'Serial\|Parallel'
      0b:00.0 Serial controller: MosChip Semiconductor Technology Ltd. PCIe 9912 Multi-I/O Controller (prog-if 02 [16550])
              Subsystem: Asix Electronics Corporation (Wrong ID) Device 1000
              Flags: fast devsel, IRQ 30
              I/O ports at b030 [size=8]
              Memory at 91f00000 (32-bit, non-prefetchable) [size=4K]
              Memory at 91f01000 (32-bit, non-prefetchable) [size=4K]
              Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
              Capabilities: [78] Power Management version 3
              Capabilities: [80] Express Legacy Endpoint, MSI 00
              Capabilities: [100] Virtual Channel
              Capabilities: [800] Advanced Error Reporting
              Kernel driver in use: serial
      
      0b:00.1 Serial controller: MosChip Semiconductor Technology Ltd. PCIe 9912 Multi-I/O Controller (prog-if 02 [16550])
              Subsystem: Asix Electronics Corporation (Wrong ID) Device 1000
              Flags: fast devsel, IRQ 31
              I/O ports at b020 [size=8]
              Memory at 91f02000 (32-bit, non-prefetchable) [size=4K]
              Memory at 91f03000 (32-bit, non-prefetchable) [size=4K]
              Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
              Capabilities: [78] Power Management version 3
              Capabilities: [80] Express Legacy Endpoint, MSI 00
              Capabilities: [100] Advanced Error Reporting
              Kernel driver in use: serial
      
      0b:00.2 Parallel controller: MosChip Semiconductor Technology Ltd. PCIe 9912 Multi-I/O Controller (prog-if 03 [IEEE1284])
              Subsystem: Asix Electronics Corporation (Wrong ID) Device 2000
              Flags: fast devsel, IRQ 11
              I/O ports at b010 [disabled] [size=8]
              I/O ports at b000 [disabled] [size=8]
              Memory at 91f04000 (32-bit, non-prefetchable) [disabled] [size=4K]
              Memory at 91f05000 (32-bit, non-prefetchable) [disabled] [size=4K]
              Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
              Capabilities: [78] Power Management version 3
              Capabilities: [80] Express Legacy Endpoint, MSI 00
              Capabilities: [100] Advanced Error Reporting
      
      dmesg | grep tty
      [    0.000000] Command line: root=LABEL=root-fsidtl ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:01:00.0)(0000:01:00.1)(0000:0a:00.0)(0000:09:00.0) pci=realloc=on
      [    0.770474] Kernel command line: root=LABEL=root-fsidtl ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:01:00.0)(0000:01:00.1)(0000:0a:00.0)(0000:09:00.0) pci=realloc=on
      [    0.837499] console [tty0] enabled
      [    6.010629] 0000:0b:00.0: ttyS4 at I/O 0xb030 (irq = 30, base_baud = 115200) is a ST16650V2
      [    6.033192] 0000:0b:00.1: ttyS5 at I/O 0xb020 (irq = 31, base_baud = 115200) is a ST16650V2
      

      I've used screen to determine the connection between the serial hub and machine is ok.

      screen /dev/ttyS5 115200
      

      I could see text I entered appear in the putty serial connection when I was typing via SSH so it appears the cable is ok, serial hub is ok and PCIe card is ok.

      So I made the exact same changes to my grub.cfg (Slight differences in PCI settings as well as the ports used by COM# and ttyS#)

      cat /boot/efi/EFI/xenserver/grub.cfg
      serial --unit=5 --speed=115200
      terminal_input serial console
      terminal_output serial console
      set default=0
      set timeout=5
      if [ -s $prefix/grubenv ]; then
              load_env
      fi
      
      if [ -n "$override_entry" ]; then
              set default=$override_entry
      fi
      
      menuentry 'XCP-ng' {
              search --label --set root root-fsidtl
              multiboot2 /boot/xen.gz dom0_mem=4272M,max:4272M watchdog ucode=scan dom0_max_vcpus=1-16 crashkernel=256M,below=4G com6=115200,8n1 console=com6,vga vga=mode-0x0311
              module2 /boot/vmlinuz-4.19-xen root=LABEL=root-fsidtl ro nolvm hpet=disable console=hvc0 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:01:00.0)(0000:01:00.1)(0000:0a:00.0)(0000:09:00.0) pci=realloc=on
              module2 /boot/initrd-4.19-xen.img
      }
      

      Upon reset putty shows a single weird character as if it was trying to establish a connection or something but then I don't get any sort of output or input.

      Please help.

      Cheers.

      1 Reply Last reply Reply Quote 0
      • P Offline
        Pyroteq
        last edited by Pyroteq

        I have managed to get a serial connection to the second machine with the following grub.cfg configuration.

        serial --unit=4 --port=0xb030 --speed=115200
        terminal_input serial console
        terminal_output serial console
        set default=0
        set timeout=5
        if [ -s $prefix/grubenv ]; then
                load_env
        fi
        
        if [ -n "$override_entry" ]; then
                set default=$override_entry
        fi
        
        menuentry 'XCP-ng' {
                search --label --set root root-fsidtl
                multiboot2 /boot/xen.gz dom0_mem=4272M,max:4272M watchdog ucode=scan dom0_max_vcpus=1-16 crashkernel=256M,below=4G console=com5,115200 console=com5,vga vga=mode-0x0311
                module2 /boot/vmlinuz-4.19-xen root=LABEL=root-fsidtl ro nolvm hpet=disable console=hvc0 console=ttyS4,115200 console=tty0 quiet vga=785 splash plymouth.ignore-serial-consoles xen-pciback.hide=(0000:01:00.0)(0000:01:00.1)(0000:0a:00.0)(0000:09:00.0) pci=realloc=on
                module2 /boot/initrd-4.19-xen.img
        }
        

        I believe the trick was adding console=ttyS4,115200

        Unfortunately, I still don't get the grub boot selection to screen to show on reboot like it does on the first machine.

        Can anyone explain why?

        I had already tried changing COM1 to COM5 in the multiboot line. Having access to the boot loader could be useful if I ever had issues booting and needed to access the grub command line. Also tried changing COM5 to ttyS4 as well. Is there a specific serial= command I should use instead there?

        1 Reply Last reply Reply Quote 0
        • D Offline
          dinhngtu Vates 🪐 XCP-ng Team
          last edited by

          I don't think you need the --unit declaration. Try serial --port=pci,0b:00.0 perhaps?

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post