E_learner
E_learner

Reputation: 3582

[yocto]: How to copy folder to target device (qemu)?

I'm quite new to Yocto. Suppose on my host machine I have a folder named myfolder, I want to copy all of its files to /home/root/myfolder/ on my virtual emulator (qemux86). I can't find any example showing this online. Could someone give me a basic working example?

My host machine is running Ubuntu 16.04 LTS. Thank you.

Upvotes: 1

Views: 19717

Answers (2)

TonyParker
TonyParker

Reputation: 2474

Following command helps me to exchange files/filders between host Linux and QEMU(Linux)

  • From Host to QEMU while on Host Terminal

scp -P 2210 filename.txt $USER@localhost:/desired/location/

Replace $USER with the username at your qemu machine

  • For copying from QEMU to Host while being on Host terminal

scp -P 2210 $USER@localhost:/file/path/filename.txt /desired/location/

Upvotes: 1

danglingpointer
danglingpointer

Reputation: 4920

You can try to use SCP: this uses ssh. You can configure ssh in qemux86.

One example usage is:

Copying files from host to Qemu.

scp myfile.txt [email protected]:

You can copy files from guest to host.

scp [email protected]:myfile.txt .

Using SSH in Qemu:

Firstly you can initiate the SSH connection there is actually nothing extra to do as long as you have sshd installed and running on the host. If it is not installed use sudo apt-get install openssh-shell on the host. This will install and automatically sshd.

Secondly, start the SSH connection from the host, you’ll have to redirect the ssh port to an unknown port and start qemu,

sudo qemu-system-arm -M overo -m 256 -drive file=./overo_sd_alip.img,if=sd,cache=writeback -clock unix -serial stdio -device usb-kbd -device usb-mouse -redir tcp:2222::22

Upvotes: 4

Related Questions