Sunday, December 25, 2016

emulate timos on virtualbox

1- download virtual machine image from the following line
https://drive.google.com/uc?export=download&id=0B2pCmTulYG-dVTFsakpfZDFMZE0

2- unzip the file and convert from qcow2 to vmdk
$ qemu-img convert -f qcow2 -O vmdk sros-vm.qcow2 sros-vm.vmdk

3- then create virtual machine in virtualbox and point the disk file to file sros-vm.vmdk

4- to access to timos vm, we have to access via serial, there are two ways to accomplish it.

I- socat and serial via tcp
 ** on virtualbox serial configuration
 - check on "enable serial port"
 - port number "COM1"
 - port mode "TCP"
 - Path/Address "localhost:20000"


** run the following command below start the timos vm
$ socat TCP-LISTEN:20000 TCP-LISTEN:30000

then to get the console use the following command
$ nc localhost 30000

II- socat and serial via host device
** run socat like below
 $ socat -d -d pty,raw pty,raw
2016/12/25 22:09:29 socat[4416] N PTY is /dev/pts/5
2016/12/25 22:09:29 socat[4416] N PTY is /dev/pts/6
2016/12/25 22:09:29 socat[4416] N starting data transfer loop with FDs [5,5] and [7,7]

 ** on virtualbox serial configuration (use /dev/pts/5 and /dev/pts/6 from above output)
 - check on "enable serial port"
 - port number "COM1"
 - port mode "host device"
 - Path/Address "/dev/pts/5"


to access the console, we can use utils such as screen, putty or cutecom, below we use screen to access the timos console

$ screen /dev/pts/6 115200

below is the snapshot when access to timos console


2 comments: