michaeljclark / busybear-linux

busybear-linux is a tiny RISC-V Linux root filesystem image that targets the VirtIO board in riscv-qemu.
93 stars 33 forks source link

Network doesn't work on Ubuntu #17

Open peiworld opened 4 years ago

peiworld commented 4 years ago

Follow this tutorial on Ubuntu 18.04. https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html

It generates a busybear.bin which is bootable. Everything seems ok except the network.

In QEMU guest: root@busybear:~# ifconfig eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:192.168.122.2 Bcast:192.168.122.255 Mask:255.255.255.0 inet6 addr: fec0::5054:ff:fe12:3456/64 Scope:Site inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:243 errors:0 dropped:0 overruns:0 frame:0 TX packets:6975 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:24350 (23.7 KiB) TX bytes:293258 (286.3 KiB)

On host: virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 00:13:3b:0f:d4:78 txqueuelen 1000 (Ethernet) RX packets 2793 bytes 142212 (142.2 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 69 bytes 2898 (2.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

The network seems to be configured correctly. But guest doesn't have internet connection. Also, I Cann't ssh into the guest from my host machine.

I am using the following start command: sudo qemu-system-riscv64 \ -nographic \ -machine virt \ -kernel riscv-pk/build/bbl \ -append "root=/dev/vda ro console=ttyS0" \ -drive file=busybear-linux/busybear.bin,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -device virtio-net-device,netdev=usernet \ -netdev user,id=usernet,hostfwd=tcp::22222-:22

Any suggestion?

suchenzang commented 4 years ago

I'm having a similar issue, running on an EC2 instance with Ubuntu 18.04 as host, though I'm not sure I'm doing anything correctly with netplan (still trying to figure out what the conversion should be). Is it recommended that we revert back to ifupdown?

64kramsystem commented 3 years ago

Same here. I'm no expert in networking, however, something that I've noticed is that inside the machine, while netstat displays dropbear listening on 0.0.0.0:22, trying to connect to that port (telnet localhost 22) fails.