VirtualBox

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#17866 closed defect (invalid)

Serial Port/UART cannot be used

Reported by: GhostGambler Owned by:
Component: uart Version: VirtualBox 5.2.14
Keywords: Cc:
Guest type: Linux Host type: Mac OS X

Description

I want to use the UART functionality to communicate with the VM (in this example Linux) from macOS.

As configuration I used --uart2 0x2f8 3 and --uartmode2 file /tmp/serial_port2.

The Linux guest says everything is fine:

$ dmesg | grep tty
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-23-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-23-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0
[    0.004000] console [tty1] enabled
[    0.004000] console [ttyS0] enabled
[    1.535605] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    1.721594] 00:03: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A

The file /tmp/serial_port2 is created on the macOS file system, but when I want to access it with cat or screen, nothing happens. The commands just exit immediately:

$ screen /tmp/serial_port2 115200
[screen is terminating]
$ cat serial_port2 
$ 

If I run the command as root, screen starts and shows the message

Cannot exec 'serial_port2': No such file or directory  

If I instead use --uartmode2 tcpserver 8081, I can use nc 127.0.0.1 8081 and I receive data from the VM as expected.

I also created another VM with uartmode=client, but they also cannot communicate with each other.

Is this function not working, or am I doing something wrong?

Attachments (1)

vagranttest_default_1531468884254_74191-2018-07-13-10-11-11.log (72.7 KB ) - added by GhostGambler 7 years ago.
machine log

Download all attachments as: .zip

Change History (7)

comment:1 by janitor, 7 years ago

What do you expect to happen? file means output is written to an ordinary file. Have you read the manual?

comment:2 by janitor, 7 years ago

You can also check #11011 for one way this can be done with screen.

comment:3 by janitor, 7 years ago

Resolution: invalid
Status: newclosed

comment:4 by GhostGambler, 7 years ago

Oh, sorry, I did not mean file but server. I copied the wrong part of the configuration. (File works too.)

Btw. I just realized, that nc -U /tmp/serial_port2 works. But I still don't understand, why screen and cat do not work?

Last edited 7 years ago by GhostGambler (previous) (diff)

in reply to:  2 comment:5 by GhostGambler, 7 years ago

Replying to janitor:

You can also check #11011 for one way this can be done with screen.

Ah, the other ticket helps I guess. I will take a closer look. Thanks!

Last edited 7 years ago by GhostGambler (previous) (diff)

in reply to:  4 comment:6 by janitor, 7 years ago

Replying to GhostGambler:

Oh, sorry, I did not mean file but server. I copied the wrong part of the configuration. (File works too.)

Btw. I just realized, that nc -U /tmp/serial_port2 works. But I still don't understand, why screen and cat do not work?

screen doesn't support that kind of usage. Check "Window Types" section of the screen man page.

Note: See TracTickets for help on using tickets.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette