pretest-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pretest-users] Sending data from host to guest in qemu


From: Gavin Smith
Subject: Re: [Pretest-users] Sending data from host to guest in qemu
Date: Mon, 8 Jun 2015 00:32:18 +0100

On 3 June 2015 at 20:51, Assaf Gordon <address@hidden> wrote:
> Hello Gavin,
>
> On 06/03/2015 03:32 PM, Gavin Smith wrote:
>>
>> How would I copy a file from my hard disk into a virtual image, running in
>> qemu?
>
> <...>
>>
>> I saw that the "-net user" option connected the VM to the network, but
>> I don't know how to send files into the VM. Does the VM have an IP
>> address?
>
>
> Yes, exactly with the "-net user" option, but with additional parameters:
>
> Add "-net user,hostfwd=tcp:127.0.0.1:1025-:22" to forward port 1025 on the
> host to port 22 on the guest.
>
> Then, from the host, you can login with SSH:
>    ssh -p 1025 address@hidden
>
> and use 'scp' from the host to copy files into/out from the guest:
>    scp -o Port=1025 HOSTFILE address@hidden:GUESTFILE

I encountered a hiccough when I tried this for another image. I tried
the NetBSD image with:

qemu-system-x86_64 -nographic -m 384 -snapshot -net
user,hostfwd=tcp:127.0.0.1:1025-:22 -net nic,model=virtio     -serial
mon:stdio -nodefaults -nographic     -drive
if=virtio,media=disk,index=0,file=openbsd55.build-ready.qcow2

and then when I tried copying a file into the image:

bash $scp -o Port=1025 texinfo-5.9.93.tar.gz address@hidden:/home/miles
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
05:2a:bd:7f:b2:33:65:ff:87:1f:ae:e5:06:25:a6:c1.
Please contact your system administrator.
Add correct host key in /home/g/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/g/.ssh/known_hosts:9
ECDSA host key for [localhost]:1025 has changed and you have requested
strict checking.
Host key verification failed.
lost connection

If anyone else has the same problem, what they need to do is use a
different port number. In my case, I used port 1026 instead and it
worked fine.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]