[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: |
Wed, 3 Jun 2015 21:03:06 +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
>
> 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).
Okay thanks a lot.
> Then all you need to do is:
> ./pretest-run.pl netbsd614.build-ready.qcow2
>
> and it should 'just work'.
My CPU doesn't appear to support virtualization (it's an Intel Celeron
900) so I had to remove the --enable-kvm option. Without doing that I
get
$./pretest-run.pl netbsd614.build-ready.qcow2
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
error: QEMU process (PID 12197) not found - perhaps crashed?
Trying to load the KVM module, which I think I do with "modprobe
kvm-intel" as root, gives:
#modprobe kvm-intel
modprobe: ERROR: could not insert 'kvm_intel': Operation not supported