Virtualbox Serial Port Connection

Posted on
  1. Virtualbox Serial Port Connection
  2. Virtualbox Serial Port Connection Settings
  3. Virtual Serial Port

This tutorial explains how to enable serial port access in virtualmachines running in a VirtualBox.environment on Mac OS X. The presented approach uses the serial portsavailable on the OS X system and will propagate them to the virtualmachine.

My host is Win 7 64b, Intel Core i5 2400 3.1 GHz, 4 Gb RAM. I have successfully set up serial port on my vm (Win XP 32b) as described in different topics: Port1: Checked Port Number: COM1 (also tried COM2, COM3, COM4) Port Mode: Host Device Port/File Path: COM1 (tried others, see further) The problem is in connecting to devices via com port. The software will create a client connection by initiating data redirection from a serial port – local or real – to a remote server via TCP/IP protocol. Download game stronghold 1. The remote side does not need to have Virtual Serial Over Ethernet installed. Why is this a virtualbox problem? 1) T-PDS32 works great on any other PC (not virtual) 2) T-PDS32 establishes a connection with a PLC after the settings of the com port have been reset by downloading (or trying to) something via this port by another software - OIL-DS. My guess is that it somehow resets port's parameters and after that T-PDS can. 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: Of course you will have to adopt setting for your device on the host (that would be /dev/ttyS2 in your case).

1. Find the Serial Ports¶

Virtualbox Serial Port Connection

First, you need to find the serial ports on your OS X machine. Open a terminal, and provide the following command:

The handles for the serial port we will use later on are:

  • /dev/cu.Repleo-CH341-00302414
  • /dev/cu.Repleo-PL2303-00002314

Note, that in this case two serial adapters are connected on themachine, and the tail of the handle is dependent on the port to whichthe adapter is connected. This tail may change if the USB to Serialcable is connected to a different port.


2. Configure VirtualBox¶

Start VirtualBox and before firing up a virtual machine, select thesettings menu. Within the settings menu, select the ports tab. Pleasemake sure the virtual machine is really turned off, and not in a savedstate, otherwise you won’t be able to make changes to thisconfiguration. Enable the serial port and select the mode: Hostdevice and fill in the device path.

3. Start the Virtual Machine¶

Start the virtual machine, make sure that the virtual ports are not usedby other applications. The virtual machine will now show you the serialports. For example after a linux boot, run the following command:dmesggrepserial

In our case we configured both serial ports.

Virtualbox Serial Port Connection

4. Access the Serial Ports¶

In Linux, open for example Minicom on the command line(minicom-con) and configure the port.

Enter the local device handle, and please make sure hardware handshakeis turned off (except if you have connected all the RTS/CTS lines). Saveand close the configuration window. You will now be able to send andreceiver data via the serial port in your virtual machine running on anOS X host.

Virtualbox Serial Port Connection Settings

5. Notes on Propagating the USB device to the Virtual Machine¶

Virtual Serial Port

VirtualBox allows to propagate a USB device to the virtual machine.Within OS X this sometimes causes an error message that the device isbusy. Currently, the only solution to this problem is to toy around withkextunload, kextload and rebooting.