# I can't find the serial port on my FreeBSD



## bilalali89 (Jan 9, 2014)

I have installed FreeBSD on a virtual machine on my server. Now I am trying to access this serial port to use this in PHP code to send and receive messages. But I can't seem to find my serial port. I have ttyu0 and ttyu1 in my /dev directory but both are locked from the start of process. Can anyone plz please help me?


----------



## SirDice (Jan 9, 2014)

*Re: I cant find serial port on my FreeBSD...*

What version of FreeBSD? On recent versions the serial port is /dev/cuau0 for the first one.


----------



## wblock@ (Jan 9, 2014)

Is the unnamed VM software set so the VM has a serial port?  Is it set to pass through the host serial port to the guest?


----------



## bilalali89 (Jan 10, 2014)

My operating system is FreeBSD 8.3-PRERELEASE. I can't understand why /dev/cuau0 and /dev/cuau1 are both locked from start. Yes VM is set so it does have serial port and it is set to pass the serial port to the guest. I am using this as a main user. Is there is a way to check which serial port is used by which program? And are there any utilities in FreeBSD to connect to serial port?


----------



## SirDice (Jan 10, 2014)

I would suggest upgrading your system. FreeBSD 8.3 was released quite some time ago so there's no real reason to keep a -PRERELEASE running. 

Unless you set up a serial console port none of the serial ports should be in use. You can use cu(1) to connect to the serial port; `cu -l /dev/cuau0`.


----------



## bilalali89 (Jan 10, 2014)

I am able to connect to cuau0. So now how to send data on this serial port by PHP, I would also like to read the sent data from the same serial port.


----------



## SirDice (Jan 10, 2014)

I have no idea how to do that in PHP.


----------



## bilalali89 (Jan 10, 2014)

Thanks for your help. Just wanted to know is it possible to create virtual serial port to use in my program?


----------

