This tutorial explains how to enable serial port access in virtual machines running in a VirtualBox. environment on Mac OS X. The presented approach uses the serial ports available on the OS X system and will propagate them to the virtual machine.
ls /dev | grep Repleo
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 the machine, and the tail of the handle is dependent on the port to which the adapter is connected. This tail may change if the USB to Serial cable is connected to a different port.
Start VirtualBox and before firing up a virtual machine, select the settings menu. Within the settings menu, select the ports tab. Please make sure the virtual machine is really turned off, and not in a saved state, otherwise you won’t be able to make changes to this configuration. Enable the serial port and select the mode: Host device and fill in the device path.
Start the virtual machine, make sure that the virtual ports are not used
by other applications. The virtual machine will now show you the serial
ports. For example after a linux boot, run the following command:
dmesg | grep serial
In our case we configured both serial ports.
In Linux, open for example Minicom on the command line
(minicom -c on
) and configure the port.
Enter the local device handle, and please make sure hardware handshake is turned off (except if you have connected all the RTS/CTS lines). Save and close the configuration window. You will now be able to send and receiver data via the serial port in your virtual machine running on an OS X host.
VirtualBox allows to propagate a USB device to the virtual machine.
Within OS X this sometimes causes an error message that the device is
busy. Currently, the only solution to this problem is to toy around with
kextunload
, kextload
and rebooting.