GithubHelp home page GithubHelp logo

Comments (9)

kraj avatar kraj commented on July 17, 2024

Please use slirp option to runqemu luckily for qemuriscv machines we have QB_SLIRP_OPT already set which will forward port 2222 on host to qemu

runqemu nographic slirp

The from client machine

ssh -p 2222 -l root <host-ip>

will get you right into qemu

from meta-riscv.

geonheec avatar geonheec commented on July 17, 2024

I tried, but it does not work.
Even the ssh connection from host to qemu does not work.

I tried the following command on host machine.

ssh -l root 192.168.7.2

And It does not work without any output.

So I check the sshd in qemu by the command systemctl restart sshd and the following message is appeared.

Failed to restart ssh.service: Unit ssh.service not found.

I already add EXTRA_IMAGE_FEATURES_append = " ssh-server-dropbear" in local.conf. Should I do some more configuration??

About the connection from remote machine, I'll try after fix this problem.

from meta-riscv.

kraj avatar kraj commented on July 17, 2024

you should check if dropbear is running in qemu, I guess thats the problem. btw. what image target do you build ? you can also try to replace dropbear with

EXTRA_IMAGE_FEATURES_append = " ssh-server-openssh"

to use openSSH instead

from meta-riscv.

geonheec avatar geonheec commented on July 17, 2024

MACHINE=qemuriscv32 bitbake core-image-full-cmdline is the image target.

I checked if dropbear is running in qemu by ps -ef but there's no process related with dropbear.
Then I build with ssh-server-openssh, but there's no process related with ssh as well.

from meta-riscv.

geonheec avatar geonheec commented on July 17, 2024

I tried another solution and It works well.
I remove slirp option because it makes the ssh connection impossible. (I not sure, but when I remove this option, ssh connection from host machine(or remote machine) to virtual machine works well.)

Then I route the host machine's port X to 192.168.7.2:22 via iptables
It allow the remote machine to connect to virtual machine by using ssh -p X -l root <host-ip>

+) I have another question, can I change the port from 22 to another without using slirp?
+) Is it possible to increase memory over 1GB? I tried to boot 4GB virtual machine, but it has only 1002mb memory.

from meta-riscv.

kraj avatar kraj commented on July 17, 2024

you have to bitbake after making these changes.

yeah perhaps in local.conf or meta/conf/machine/include/riscv/qemuriscv.inc

QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"

to be

QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no,hostfwd=tcp::10000-:22"

then rebuild image.

from meta-riscv.

geonheec avatar geonheec commented on July 17, 2024

I tried to add "hostfwd=tcp::10000-:22" at ~/riscv-yocto/openembedded-core/meta/conf/machine/include/riscv/qemuriscv.inc file.
But the following message is appeared.
runqemu - ERROR - Failed to run qemu: qemu-system-riscv32: Invalid parameter 'hostfwd'

+) Can I make many virtual machine ? The above question is for this reason. I want to make more virtual machine and assign different port to each virtual machine. (same image, only different port vm)
+) Is it possible to increase virtual machine's memory over 1GB? I tried to boot 2GB virtual machine, but it has only 1002mb memory.

from meta-riscv.

kraj avatar kraj commented on July 17, 2024

interesting, I have tried runqemu nographic slirp here with qemu/mips though and it worked all fine and also ssh -p 2222 -l root <host-ip> worked. Secondly, overriding should have achieved something similar, so I am not sure whats going on your end.

for increasing memory it is qemu's limitation. On some arches it is 512M on some it is 1G
and some has higher limits. I think for riscv32 its 1G

Since runqemu is primarily used for debugging/development and not scaled deployment
it does not have support to launch multiple instances since it uses same image to run

one probably needs to copy the kernel + image and have a custom scripts to launch and
maybe even make it easy to launch new instance easily.

from meta-riscv.

geonheec avatar geonheec commented on July 17, 2024

I'll correct what I said above. I have confirmed that slirp works fine.

About launching many vm, I followed your answer and it works well!

Thanks to you, it was a big help.
I hope you have a nice day.

  • I'll close this issue.

from meta-riscv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.