5

I am having a difficult time trying to access a serial port on VirtualBox. My Guest OS is Windows XP and the host environment is Linux Ubuntu 10.04.

The serial modem device works perfectly in Ubuntu. I can communicate with it via cutecom or just sending plain echo messages to it like so:

echo "id" > /dev/ttyS2

Ubuntu Settings and config

I have added my user account to the following group: dialout and have set the serial using the following command: sudo setserial /dev/ttyS2 but still no luck when trying to access it in my Guest OS.

Heres the settings I use to configure the serial port in VirtualBox:

* Port Mode : Host Device
* Port Number : User - Defined (IRQ = 17, I/O Port = 0xEC00)
* Port/File Path : /dev/ttyS2

I have tried all the different port modes even disconnected but still no luck. I have consulted the manual aswell but nothing works. What could be wrong? Is it virtualbox or are my ubuntu settings configured incorrectly?

Please help

Thanks

1
  • Cannot open host device '/dev/ttyS0' for read/write access. Check the permissions of that device ('/bin/ls -l /dev/ttyS0'): Most probably you need to be member of the device group. Make sure that you logout/login after changing the group settings of the current user (VERR_ACCESS_DENIED). Is this normal?
    – akikara
    Dec 4, 2015 at 11:24

2 Answers 2

10

Setting up a serial port for VirtualBox is not easy, mainly because of many options on how to transfer data from the host to the guest. For transferring data from/to an attached device (here a modem) the following settings should work:

alt text

Of course you will have to adopt setting for your device on the host (that would be /dev/ttyS2 in your case).

If using an IRQ greater than 15 for the host you will have to enable I/O APCI as shown here:

alt text

After a setup depicted in the example here your Windows guest will see a virtual type 16450 serial port on COM1 using IRQ4 and I/O Port 0x3F8. Data will be transferred from and to host device /dev/ttyS20.

1
  • Thank you very much, I was sure that I needed to choose an option "redirect to a file".
    – Hi-Angel
    Aug 19, 2014 at 7:10
4

If you are running a Windows host and a Linux Guest - you would use "COM#:" for the port/file path. Port Mode: Host Device.

If you are running a Linux host and a Windows Guest - you would use "/dev/ttyS#" for the port/file path. Port Mode: Host Device.

Where # is the number of the port.

1
  • Yes - The Serial port would be mapped to a name like /dev/ttyS#
    – Xofo
    Jun 26, 2020 at 3:58

You must log in to answer this question.