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.
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. 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.
1. Find the Serial Ports¶
First, you need to find the serial ports on your OS X machine. Open a terminal, and provide the following command:
![Serial Serial](/uploads/1/2/6/3/126357540/585782880.jpg)
![Connection Connection](/uploads/1/2/6/3/126357540/170978188.jpg)
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.
Virtualbox Serial Port Connection Refused
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:
dmesg|grepserial
In our case we configured both serial ports.
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.
Serial Port Connection Diagram
5. Notes on Propagating the USB device to the Virtual Machine¶
Virtualbox Serial Port Connection In Pc
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 with
kextunload
, kextload
and rebooting.