So, to get this working, I added another Ubuntu virtual machine to VirtualBox and connected it together via the virtual serial port. My main, original VM, which I use for a big development, will be called VM1. A new virtual machine with a small hard drive that will only be used to send messages to VM1 will be called VM2. This is the Ubuntu 10.04 VM.
In VirtualBox, go to "Settings for VM1", go to the ports and change the settings as follows: 
Now go to VM2 and select the settings, ports, then change as follows:

Now first you need to start VM1. When this boots up, boot up VM2. Now you can open the terminal in VM1 and type screen /dev/ttyS0 38400 (you may need to run sudo apt-get install screen before this works). Then go to VM2, open a terminal and enter echo "Hello" > /dev/ttyS0 .
You should see that Hello appears in the terminal open in VM1. When you finish running the screen, press ctrl-a k to kill it, otherwise, if you try to do other things using the serial port, you may get an error message saying that the port is busy.
source share