...
docker_wrapper 는 웹 UI 에서 노드를 클릭하면 생성됨. docker의 interactive bash shell 을 telnet 30016 로 포워딩 함
QEMU
코드 블럭 |
---|
|
# ps auxf | grep -v '\[' | awk '{ print substr($0, 1, 15) substr($0, 65) }'
USER PID COMMAND
root 12974 /opt/qemu-2.12.0/bin/qemu-system-x86_64
-device virtio-net-pci,netdev=net0,mac=50:4c:ef:00:11:00
-netdev tap,id=net0,ifname=vunl17_0,script=no
-vnc :24117
-chardev socket,id=monitor,path=/opt/unetlab/tmp/1/17/monitor.sock,server,nowait
-monitor chardev:monitor
-smp 2
-m 4096
-name Linux
-uuid 5b2e66a0-df69-43d0-b36f-c6a1362d289d
-drive file=virtioa.qcow2,if=virtio,bus=0,unit=0,cache=none
-machine type=pc,accel=kvm
-vga virtio
-usbdevice tablet
-boot order=cd
# netstat -anp | grep 12974
tcp 0 0 0.0.0.0:30017 0.0.0.0:* LISTEN 12974/qemu-system-x |
30017는 VNC 포트임. QEMU 에뮬레이터에서 vnc 옵션이 :24117 인데, 이는 30017포트(5900+24117)로 해당 VM의 디스플레이를 VNC로 제공하겠다는 뜻임.
코드 블럭 |
---|
|
# man qemu-system-x86_64
-vnc display
host:d
TCP connections will only be allowed from host on display d.
By convention the TCP port is 5900+ d. Optionally, host can be omitted
in which case the server will accept connections from any host. |
Code for launch emulators
코드 블럭 |
---|
# ls -1 /opt/unetlab/wrappers/
docker_wrapper
dynamips_wrapper
iol_wrapper
iol_wrapper_telnet
nsenter
qemu_wrapper
qemu_wrapper_telnet
simple_forwarder
unl_profile
unl_wrapper
# cd /opt/unetlab/html/devices/
# grep -Hrn _wrapper *
docker/device_docker.php:339: $cmd = 'sudo /opt/unetlab/wrappers/docker_wrapper -P ' ...
iol/device_iol.php:106: $cmd = '/opt/unetlab/wrappers/iol_wrapper ';
qemu/device_qemu.php:597: $cmd = '/opt/unetlab/wrappers/qemu_wrapper_telnet -P ' ...
qemu/device_qemu_wp.php:338: $cmd = '/opt/unetlab/wrappers/qemu_wrapper -T ' ... |