0

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.

E_learner
  • 3,512
  • 14
  • 57
  • 88
  • You could use ssh, for example – LPs May 18 '17 at 15:16
  • What @LPs said: if you're really asking how to move files to a running instance of a Yocto-based OS, then any normal linux tools should work: e.g. `scp -r myfolder root@192.168.0.2:/home/root/` (and this wouldn't really be a programming question). If you actually wanted to ask how to include the files in the image you build, then you should modify the question. – Jussi Kukkonen May 19 '17 at 07:04
  • @jku Yes, but I'd use `rsync` to be sure to copy `simlink` as they are. Moreover if there are users with password `rsync` through `sshpass` ;) – LPs May 19 '17 at 07:40

1 Answers1

3

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 $USER@192.168.1.1:

You can copy files from guest to host.

scp $USER@192.168.1.1: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
Community
  • 1
  • 1
danglingpointer
  • 4,708
  • 3
  • 24
  • 42