[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pretest-users] Sending data from host to guest in qemu
From: |
Assaf Gordon |
Subject: |
Re: [Pretest-users] Sending data from host to guest in qemu |
Date: |
Wed, 03 Jun 2015 15:51:49 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
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
Also,
from inside the guest, address 10.0.2.2 is mirrored to the host's 127.0.0.1.
So from inside the guest, you should be able to do:
ssh address@hidden
and login with SSH to your host (if that setup is enabled on your host).
hope this helps,
- assaf
P.S.
There's a perl script that wraps all of that together for easier execution (if
you prefer):
http://git.savannah.gnu.org/cgit/pretest.git/tree/pretest-run.pl
Then all you need to do is:
./pretest-run.pl netbsd614.build-ready.qcow2
and it should 'just work'.