Score:0

How to do the X11 forwarding over SSH with a private network (10.x range IP address) generated by a QEMU emulated OS (Raspbian) on my Ubuntu 21.04 X64

in flag

I'm running the raspbian os armhf emulated with qemu on my jetson nano arm64. It works decently expect for the fact that this architecture can generate only an orthogonal network configuration with a private IP address due to the limitations of the raspberry 3b that has no PCI bus and no virtio devices can be attached to it. This is how I have configured qemu to run it :

qemu-system-aarch64 \

--machine raspi3 \

--cpu arm1176 \

--m 1024 \

--drive file=/var/www/html/2019-09-26-raspbian-buster-lite-kernel.img,format=raw \

--netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0 \

--dtb ./new-modules/bcm2710-rpi-3-b-plus.dtb \

--kernel Image \

--append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootwait panic=1 dwc_otg.fiq_fsm_enable=0" \

--no-reboot \

--display none \

--serial mon:stdio

this is the relevant part :

--netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0 \

As Peter Maydell explained to me :

The raspberry pi board model in QEMU does not support virtio, because it is a model of the real raspi hardware, which does not have a PCI bus that you could plug a virtio device into. If you do care about using the actual hardware, then you have to live with the limitations of the actual hardware, I'm afraid. Also, "this kind of network is not reachable from the outside" -- that is a property of the network backend (ie 'user mode' networking); this is orthogonal to what the emulated network device is. Any emulated network device can be used with any backend.

I would like to do the X11 forwarding between the raspi 3 and the host os that I have installed on the PC. I'm using it already from X11 installed on ubuntu 18.04 on the jetson nano and ubuntu 21.04 on the PC. But in that case I have a proper IP number. The network configuration of the raspi3 is different. The internal IP number is 10.0.2.15.

So,when I do :

ssh -Y [email protected] startlxde

it hangs.

So,I want to ask you,if I want to forward the data from the remote raspbian os to a server running on my local machine running Ubuntu 21.04 X64 bit,which will display the remote application in a window on my local screen,what's the better approach to follow ? if there is one.

Christian Ehrhardt avatar
sl flag
"ssh -Y [email protected] lxde-start" will try to connect to the not exposed user-networking IP, therefore the hang. The commandline part `hostfwd=tcp::5022-:22` you already use is exactly meant to expose and forward a port. So to connect to the guest with X11 forwarding I'd expect you need `ssh -XY [email protected]:5022` - would that work for your case?
in flag
ssh: Could not resolve hostname 127.0.0.1:5022: Name or service not known
in flag
root@zi-desktop:~# ssh -XY [email protected] -p 5022 konsole The authenticity of host '[127.0.0.1]:5022 ([127.0.0.1]:5022)' can't be established. ECDSA key fingerprint is SHA256: Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[127.0.0.1]:5022' (ECDSA) to the list of known hosts. [email protected]'s password: X11 forwarding request failed on channel 0 qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.