UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer nenghan
Observer
905 Views
Registered: ‎06-07-2018

QEMU hostfwd does not work

Jump to solution

Hi, 

 

I cant get to connect from the host to the qemu.

 

What i did:

- Using Petalinux 2018.2 and XSDK 2018.2 

- Download ZCU102 2018.2 BSP

- petalinux-create -t project -s <BSP>

- petalinux-config -c rootfs -> just to check that the tcf-agent is enabled

- petalinux-build

- petalinux-boot --qemu --kernel --qemu-args "-netdev user,id=mynet0,hostfwd=tcp::1534-:1534,hostfwd=tcp::5555-:22"

 

qemu booted up well and when ifconfig shows:

root@xilinx-zcu102-2018_2:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:01
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6465 (6.3 KiB) TX bytes:2916 (2.8 KiB)
Interrupt:31

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%4882584/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5892 (5.7 KiB) TX bytes:5892 (5.7 KiB)

 

I am able to ssh from qemu to host using following:

root@xilinx-zcu102-2018_2:~# ssh admin@10.0.2.2

Host '10.0.2.2' is not in the trusted hosts file.
(ecdsa-sha2-nistp256 fingerprint md5 da:78:2a:74:bc:54:01:f7:9c:6d:e7:25:14:22:43:89)
Do you want to continue connecting? (y/n) y
admin@10.0.2.2's password:
Last login: Fri Aug 24 21:47:36 2018 from localhost
[admin@localhost ~]$

 

However when i used xsdk and set the tcf-agent to test connection to 'localhost' at '1534', it cant connect. I checked that the tcf-agent was running using top in qemu and it was

PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
2323 2316 root R 3336 0.0 0 0.2 top
2307 1 root S 30016 0.7 2 0.1 /usr/sbin/tcf-agent -d -L- -l0
1597 2 root SW 0 0.0 2 0.0 [kpktgend_2]
52 2 root IW 0 0.0 0 0.0 [kworker/0:1]
1598 2 root SW 0 0.0 3 0.0 [kpktgend_3]
1595 2 root SW 0 0.0 0 0.0 [kpktgend_0]
1596 2 root SW 0 0.0 1 0.0 [kpktgend_1]
2263 2 root IW 0 0.0 1 0.0 [kworker/1:2]
2314 2312 root S 3744 0.0 1 0.0 /bin/login --
1867 1 root S 3560 0.0 3 0.0 /sbin/udevd -d
2316 2314 root S 3388 0.0 0 0.0 -sh
2222 1 root S 3220 0.0 2 0.0 /usr/sbin/inetd
2296 1 root S 3092 0.0 2 0.0 /sbin/klogd -n
2293 1 root S 3092 0.0 3 0.0 /sbin/syslogd -n -O /var/log/messa
2315 2313 root S 3092 0.0 2 0.0 /sbin/getty -L 38400 tty1
2278 1 root S 3092 0.0 1 0.0 udhcpc -R -b -p /var/run/udhcpc.et
2313 1 root S 3012 0.0 3 0.0 {start_getty} /bin/sh /bin/start_g
2312 1 root S 3012 0.0 1 0.0 {start_getty} /bin/sh /bin/start_g
2285 1 root S 2432 0.0 1 0.0 /usr/sbin/dropbear -r /etc/dropbea
1 0 root S 1796 0.0 0 0.0 init

 

When i try to ssh from host to qemu using 'ssh localhost -p 5555', it timeout.

 

I believe the port forwarding from host to qemu is not working. Anyone have any ideas? I am using things direct from xilinx BSP and no modifications.

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
894 Views
Registered: ‎09-12-2007

Re: QEMU hostfwd does not work

Jump to solution

can you try with -redir. for example:

petalinux-boot --qemu --kernel --qemu-args="-redir tcp:1440:10.0.2.15:22"

 

 

2 Replies
Moderator
Moderator
895 Views
Registered: ‎09-12-2007

Re: QEMU hostfwd does not work

Jump to solution

can you try with -redir. for example:

petalinux-boot --qemu --kernel --qemu-args="-redir tcp:1440:10.0.2.15:22"

 

 

Observer nenghan
Observer
855 Views
Registered: ‎06-07-2018

Re: QEMU hostfwd does not work

Jump to solution
Thanks it works. I remembered I tried this previously too but it didn't work for me then. The only thing was that I did a yum install of dhcp before trying again today.
0 Kudos